
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Playfair+Display:wght@500;600;700&display=swap');

:root {
    --bg: #07111f;
    --panel: #0d1b2b;
    --teal: #5de4c2;
    --text: #f2f7f8;
    --muted: #9aabb9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

.accent {
    color: var(--teal);
}

/* NAVIGATION */

.navbar {
    width: 100%;
    min-height: 85px;
    padding: 0 8%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    background: rgba(7,17,31,0.92);
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.8px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #07111f;
    background: var(--teal);
    border-radius: 10px;
    font-family: 'Playfair Display', serif;
    font-size: 25px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 38px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.nav-links a:hover {
    color: var(--teal);
}

.nav-links .nav-button {
    color: #07111f;
    background: var(--teal);
    padding: 13px 21px;
    border-radius: 7px;
    transition: 0.3s;
}

.nav-links .nav-button:hover {
    color: #07111f;
    background: #9af4dc;
    transform: translateY(-2px);
}

/* HERO */

.hero {
    min-height: 650px;
    padding: 80px 10% 85px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 40px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 75% 45%, rgba(40,180,153,0.12), transparent 45%),
        radial-gradient(ellipse at 10% 90%, rgba(39,85,130,0.12), transparent 40%);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.eyebrow,
.section-tag {
    color: var(--teal);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(93,228,194,0.22);
    background: rgba(93,228,194,0.06);
    padding: 10px 15px;
    border-radius: 30px;
    margin-bottom: 27px;
}

.live-dot {
    width: 7px;
    height: 7px;
    display: inline-block;
    background: var(--teal);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--teal);
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(55px, 6.2vw, 82px);
    line-height: 1.09;
    letter-spacing: -2px;
    margin-bottom: 24px;
}

.gradient-text {
    background: linear-gradient(90deg, #5de4c2, #b0ffe6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-description {
    max-width: 465px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.9;
    margin-bottom: 32px;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    gap: 25px;
    background: var(--teal);
    color: #06151b;
    font-size: 14px;
    font-weight: 800;
    padding: 17px 23px;
    border-radius: 7px;
    transition: 0.3s;
    box-shadow: 0 8px 30px rgba(93,228,194,0.12);
}

.primary-button:hover {
    transform: translateY(-4px);
    background: #a1f5dd;
    box-shadow: 0 12px 35px rgba(93,228,194,0.22);
}

.primary-button span {
    font-size: 20px;
}

.hero-note {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #91a5b3;
    font-size: 11px;
}

.hero-note > span:first-child {
    color: var(--teal);
}

.note-divider {
    color: var(--teal);
}

/* BOOK ART */

.hero-art {
    min-height: 450px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.orbit {
    position: absolute;
    border: 1px solid rgba(93,228,194,0.12);
    border-radius: 50%;
    transform: rotate(-22deg);
}

.orbit-one {
    width: 410px;
    height: 280px;
}

.orbit-two {
    width: 490px;
    height: 350px;
    transform: rotate(32deg);
}

.book {
    position: absolute;
    width: 160px;
    height: 245px;
    border-radius: 4px 10px 10px 4px;
    box-shadow: 15px 25px 45px rgba(0,0,0,0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px 15px;
}

.book-back {
    background: linear-gradient(145deg, #b77a50, #593b36);
    transform: translate(-100px, -10px) rotate(-13deg);
    color: #ffe5bd;
}

.cover-top {
    font-size: 9px;
    letter-spacing: 3px;
}

.cover-title {
    font-family: 'Playfair Display', serif;
    font-size: 27px;
    font-weight: 700;
    line-height: 1.15;
    margin-top: 55px;
}

.cover-line {
    width: 40px;
    height: 2px;
    background: #f4d6a9;
    margin-top: 15px;
}

.cover-author {
    font-size: 7px;
    letter-spacing: 2px;
    margin-top: 12px;
}

.book-middle {
    background: linear-gradient(150deg, #294d68, #10273e);
    color: #d4f0ee;
    transform: translate(75px, -65px) rotate(13deg);
    z-index: 1;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.15);
}

.middle-symbol {
    font-size: 35px;
    color: #81dcca;
    margin-top: 25px;
}

.middle-title {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    text-align: center;
    line-height: 1.25;
    margin-top: 25px;
}

.middle-author {
    font-size: 7px;
    letter-spacing: 2px;
    margin-top: 20px;
}

.book-front {
    background: linear-gradient(145deg, #164e4a, #092a32);
    border: 1px solid rgba(128,239,211,0.45);
    color: #e1fff4;
    transform: translate(-5px, 50px) rotate(-3deg);
    z-index: 2;
    align-items: center;
}

.front-small {
    font-size: 8px;
    letter-spacing: 3px;
    color: #a4dfd0;
}

.front-title {
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    line-height: 1.1;
    text-align: center;
    margin-top: 22px;
    font-weight: 700;
}

.front-flower {
    font-size: 42px;
    color: #a8e8d4;
    margin-top: 8px;
}

.front-author {
    font-size: 7px;
    letter-spacing: 1.5px;
    margin-top: auto;
}

.floating-label {
    position: absolute;
    z-index: 3;
    border: 1px solid rgba(93,228,194,0.2);
    background: rgba(9,27,40,0.94);
    padding: 12px 15px;
    border-radius: 7px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.3px;
    color: #c6e6e0;
    box-shadow: 0 10px 35px rgba(0,0,0,0.3);
}

.label-top {
    top: 42px;
    right: 0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.label-bottom {
    bottom: 30px;
    left: 0;
}

.sparkle {
    color: var(--teal);
    margin-right: 7px;
}

/* DISCOVER */

.discover-section {
    padding: 95px 10%;
    background: #0a1725;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 30px;
    margin-bottom: 42px;
}

.section-heading h2,
.how-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 39px;
    margin-top: 13px;
}

.section-heading p {
    max-width: 330px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.genre-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 17px;
}

.genre-card {
    min-height: 190px;
    padding: 23px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
}

.genre-card:hover {
    transform: translateY(-6px);
    border-color: rgba(93,228,194,0.5);
}

.genre-card > span {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

.genre-card > div {
    font-size: 38px;
    margin-top: 30px;
    margin-bottom: 17px;
}

.genre-card h3 {
    font-size: 15px;
}

.genre-one {
    background: linear-gradient(140deg, #213b50, #112433);
}

.genre-two {
    background: linear-gradient(140deg, #49333f, #241e30);
}

.genre-three {
    background: linear-gradient(140deg, #59404d, #2c2537);
}

.genre-four {
    background: linear-gradient(140deg, #555037, #292a28);
}

.genre-five {
    background: linear-gradient(140deg, #283f59, #19263a);
}

.genre-six {
    background: linear-gradient(140deg, #28544f, #142e34);
}

/* HOW IT WORKS */

.how-section {
    padding: 95px 10%;
    text-align: center;
}

.how-section h2 {
    margin-bottom: 55px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    text-align: left;
}

.step {
    padding: 28px;
    background: var(--panel);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    position: relative;
}

.step-number {
    position: absolute;
    right: 25px;
    top: 25px;
    color: #597080;
    font-size: 12px;
    font-weight: 800;
}

.step-icon {
    width: 55px;
    height: 55px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(93,228,194,0.1);
    color: var(--teal);
    font-size: 28px;
    margin-bottom: 23px;
}

.step h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.step p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.bottom-button {
    margin-top: 45px;
}

/* FOOTER */

footer {
    min-height: 100px;
    padding: 25px 8%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid rgba(255,255,255,0.07);
    background: #050d18;
}

footer p,
.footer-copy {
    color: #8193a2;
    font-size: 11px;
}

/* RESPONSIVE */

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 65px;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-note {
        justify-content: center;
    }

    .hero-art {
        min-height: 430px;
    }

    .section-heading {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 650px) {
    .navbar {
        padding: 18px 5%;
        flex-wrap: wrap;
        gap: 18px;
    }

    .nav-links {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
        font-size: 11px;
    }

    .nav-links .nav-button {
        padding: 10px 12px;
    }

    .hero {
        padding: 65px 6%;
    }

    .hero h1 {
        font-size: 55px;
    }

    .hero-art {
        transform: scale(0.85);
        margin: -20px -30px;
    }

    .discover-section,
    .how-section {
        padding: 70px 6%;
    }

    .genre-grid,
    .steps {
        grid-template-columns: 1fr;
    }

    .section-heading h2,
    .how-section h2 {
        font-size: 31px;
    }

    footer {
        flex-direction: column;
        text-align: center;
    }
}

/* =========================================
   BOOKLENS AI - PROFESSIONAL SCANNER DESIGN
========================================= */

.scanner-page {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 15% 20%, rgba(37, 135, 125, 0.10), transparent 40%),
        radial-gradient(ellipse at 90% 80%, rgba(38, 83, 125, 0.10), transparent 40%),
        #07111f;
}

.scanner-page .navbar {
    min-height: 76px;
}

.scanner-nav-status {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 15px;
    border: 1px solid rgba(93, 228, 194, 0.2);
    background: rgba(93, 228, 194, 0.06);
    border-radius: 30px;
    color: var(--teal);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.4px;
}

.scanner-main {
    width: min(1420px, 90%);
    margin: auto;
    padding: 48px 0 35px;
}

.scanner-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 30px;
}

.scanner-heading h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(34px, 4vw, 48px);
    line-height: 1.2;
    margin: 12px 0;
    letter-spacing: -1px;
}

.scanner-heading p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.scanner-live-badge {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 17px;
    border: 1px solid rgba(93, 228, 194, 0.2);
    border-radius: 30px;
    background: rgba(93, 228, 194, 0.06);
    color: var(--teal);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

/* MAIN TWO-COLUMN LAYOUT */

.scanner-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.85fr);
    align-items: stretch;
    gap: 22px;
}

/* CAMERA CARD */

.camera-card,
.results-card {
    min-width: 0;
    background: linear-gradient(145deg, #102235, #0b1928);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.22);
}

.camera-card {
    padding: 18px;
}

.camera-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
    color: #dce9ec;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.1px;
}

.camera-topbar > div {
    display: flex;
    align-items: center;
    gap: 9px;
}

.camera-indicator {
    width: 8px;
    height: 8px;
    background: var(--teal);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--teal);
}

.camera-resolution {
    color: #8298a9;
    font-size: 9px;
    letter-spacing: 0.7px;
}

/* CAMERA VIEW */

.camera-stage {
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 300px;
    max-height: 520px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(ellipse, #193449 0%, #0b1928 75%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 11px;
}

#cameraVideo {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#cameraVideo.mirror {
    transform: scaleX(-1);
}

.camera-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    z-index: 2;
}

.camera-placeholder-icon {
    width: 75px;
    height: 75px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(93, 228, 194, 0.25);
    background: rgba(93, 228, 194, 0.07);
    border-radius: 22px;
    color: var(--teal);
    font-size: 42px;
    margin-bottom: 20px;
}

.camera-placeholder h3 {
    font-family: 'Playfair Display', serif;
    font-size: 25px;
    margin-bottom: 10px;
}

.camera-placeholder p {
    max-width: 300px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
    margin-bottom: 22px;
}

.camera-placeholder .primary-button {
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* SCANNING FRAME */

.scanner-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.scan-frame {
    position: relative;
    width: 65%;
    height: 75%;
    border: 1px solid rgba(93, 228, 194, 0.3);
    border-radius: 9px;
    box-shadow: 0 0 0 999px rgba(3, 12, 22, 0.13);
}

.corner {
    position: absolute;
    width: 28px;
    height: 28px;
    border-color: var(--teal);
    border-style: solid;
}

.top-left {
    top: -2px;
    left: -2px;
    border-width: 3px 0 0 3px;
    border-radius: 5px 0 0;
}

.top-right {
    top: -2px;
    right: -2px;
    border-width: 3px 3px 0 0;
    border-radius: 0 5px 0 0;
}

.bottom-left {
    bottom: -2px;
    left: -2px;
    border-width: 0 0 3px 3px;
    border-radius: 0 0 0 5px;
}

.bottom-right {
    bottom: -2px;
    right: -2px;
    border-width: 0 3px 3px 0;
    border-radius: 0 0 5px;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--teal), transparent);
    box-shadow: 0 0 14px var(--teal);
    animation: scanMove 3s ease-in-out infinite alternate;
}

@keyframes scanMove {
    from { top: 0; }
    to { top: calc(100% - 2px); }
}

.frame-label {
    margin-top: 16px;
    padding: 8px 13px;
    border: 1px solid rgba(93, 228, 194, 0.25);
    background: rgba(5, 18, 28, 0.85);
    border-radius: 5px;
    color: #b9f8e8;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.3px;
}

/* CAMERA STATUS */

.camera-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 17px 2px 10px;
}

.camera-status {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #a9bac7;
    font-size: 11px;
}

.status-circle {
    width: 8px;
    height: 8px;
    background: #718392;
    border-radius: 50%;
}

.status-circle.active {
    background: var(--teal);
    box-shadow: 0 0 10px var(--teal);
}

.status-circle.error {
    background: #ff7777;
    box-shadow: 0 0 10px #ff7777;
}

.stop-button {
    padding: 10px 16px;
    border: 1px solid rgba(255, 105, 105, 0.25);
    background: rgba(255, 105, 105, 0.08);
    border-radius: 6px;
    color: #ffaaaa;
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s;
}

.stop-button:hover:not(:disabled) {
    background: rgba(255, 105, 105, 0.17);
}

.stop-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.camera-tip {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 13px 12px;
    background: rgba(93, 228, 194, 0.045);
    border: 1px solid rgba(93, 228, 194, 0.10);
    border-radius: 7px;
    color: #9fb4bf;
    font-size: 10px;
    line-height: 1.6;
}

.camera-tip span {
    color: var(--teal);
}

/* RESULTS PANEL */

.results-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 19px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.results-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 25px;
    margin-top: 8px;
}

.ai-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(93, 228, 194, 0.1);
    color: var(--teal);
    font-size: 23px;
}

/* WAITING / ERROR STATE */

.prediction-state {
    flex: 1;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 28px 12px;
}

.state-icon {
    width: 65px;
    height: 65px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(93, 228, 194, 0.2);
    background: rgba(93, 228, 194, 0.06);
    color: var(--teal);
    border-radius: 19px;
    font-size: 35px;
    margin-bottom: 18px;
}

.prediction-state h3 {
    font-family: 'Playfair Display', serif;
    font-size: 21px;
    margin-bottom: 10px;
}

.prediction-state p {
    max-width: 290px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.8;
}

/* BEST RESULT */

.best-result {
    padding: 23px 19px;
    margin-top: 20px;
    border: 1px solid rgba(93, 228, 194, 0.23);
    background:
        radial-gradient(ellipse at top right, rgba(93, 228, 194, 0.13), transparent 60%),
        rgba(93, 228, 194, 0.045);
    border-radius: 11px;
}

.result-label {
    color: var(--teal);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.best-result h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(23px, 2.2vw, 31px);
    line-height: 1.3;
    margin: 12px 0 21px;
    overflow-wrap: anywhere;
}

.confidence-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #a8bac6;
    font-size: 11px;
}

.confidence-row strong {
    color: var(--teal);
    font-size: 19px;
    font-weight: 800;
}

.confidence-track {
    height: 8px;
    width: 100%;
    margin-top: 12px;
    overflow: hidden;
    background: #243b4b;
    border-radius: 20px;
}

.confidence-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #31b99e, #8af4d6);
    border-radius: 20px;
    box-shadow: 0 0 12px rgba(93, 228, 194, 0.25);
    transition: width 0.6s ease;
}

.prediction-note {
    margin-top: 17px;
    color: #9bb9b6;
    font-size: 10px;
}

/* TOP 5 PREDICTIONS */

.top-predictions {
    margin-top: 22px;
}

.top-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 17px;
}

.top-heading h3 {
    font-size: 14px;
}

.top-heading span {
    color: #7d9b9d;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
}

#predictionList {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.prediction-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prediction-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #dce8eb;
    font-size: 11px;
}

.prediction-item-top strong {
    color: var(--teal);
    font-size: 11px;
    font-weight: 700;
}

.prediction-track {
    height: 6px;
    width: 100%;
    background: #263a4a;
    border-radius: 20px;
    overflow: hidden;
}

.prediction-bar {
    height: 100%;
    background: linear-gradient(90deg, #258c80, #5de4c2);
    border-radius: 20px;
    transition: width 0.5s ease;
}

/* BOTTOM STATISTICS */

.result-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: auto;
    padding-top: 22px;
}

.footer-stat {
    padding: 14px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.065);
    border-radius: 8px;
}

.footer-stat span {
    display: block;
    color: var(--teal);
    font-size: 23px;
    font-weight: 800;
    margin-bottom: 4px;
}

.footer-stat small {
    color: #92a6b5;
    font-size: 10px;
}

/* LOADING */

.camera-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    background: rgba(5, 15, 26, 0.91);
}

.camera-loading p {
    color: #c8d9dd;
    font-size: 12px;
}

.loader {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(93, 228, 194, 0.15);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spinLoader 0.8s linear infinite;
}

@keyframes spinLoader {
    to { transform: rotate(360deg); }
}

/* BOTTOM INFORMATION */

.scanner-bottom-info {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 25px 10px 5px;
    color: #8196a5;
    font-size: 10px;
    letter-spacing: 0.3px;
}

.scanner-bottom-info > span:first-child {
    color: var(--teal);
}

.info-divider {
    color: var(--teal);
}

/* HIDDEN ELEMENTS */

.scanner-page [hidden] {
    display: none !important;
}

/* RESPONSIVE TABLET */

@media (max-width: 950px) {
    .scanner-main {
        width: 94%;
        padding-top: 35px;
    }

    .scanner-layout {
        grid-template-columns: 1fr 0.9fr;
        gap: 14px;
    }

    .camera-card {
        padding: 13px;
    }

    .results-card {
        padding: 17px;
    }

    .best-result {
        padding: 18px 14px;
    }
}

/* RESPONSIVE MOBILE */

@media (max-width: 700px) {
    .scanner-main {
        width: 92%;
        padding-top: 30px;
    }

    .scanner-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .scanner-heading h1 {
        font-size: 35px;
    }

    .scanner-heading p {
        font-size: 12px;
    }

    .scanner-layout {
        grid-template-columns: 1fr;
    }

    .camera-stage {
        min-height: 250px;
    }

    .results-card {
        min-height: 450px;
    }

    .scanner-bottom-info {
        line-height: 1.8;
        text-align: center;
    }
}

@media (max-width: 420px) {
    .camera-topbar {
        font-size: 9px;
    }

    .camera-resolution {
        font-size: 8px;
    }

    .camera-placeholder h3 {
        font-size: 21px;
    }

    .camera-placeholder p {
        font-size: 10px;
    }

    .camera-tip {
        font-size: 9px;
    }

    .results-header h2 {
        font-size: 22px;
    }
}

/* ==========================================
   PREMIUM AI BOOK SCANNER - UI UPGRADE
   ========================================== */

:root {
    --scanner-bg: #080f1d;
    --scanner-panel: #101c2d;
    --scanner-panel-light: #16263a;
    --scanner-teal: #20c9ad;
    --scanner-teal-light: #65f2d6;
    --scanner-text: #f0f5fa;
    --scanner-muted: #8fa3b9;
    --scanner-border: rgba(111, 153, 181, 0.18);
}

/* Preserve hidden elements */

[hidden] {
    display: none !important;
}

/* Main scanner layout */

.scanner-layout {
    gap: 28px;
    align-items: stretch;
}

/* Camera panel */

#cameraStage {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: #050b15;
    border: 1px solid var(--scanner-border);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.3);
    transition: border-color 0.3s ease;
}

#cameraStage:hover {
    border-color: rgba(32, 201, 173, 0.45);
}

#cameraVideo {
    width: 100%;
    display: block;
    object-fit: cover;
    border-radius: 16px;
}

/* Scanner overlay */

#scannerOverlay {
    pointer-events: none;
    position: absolute;
    inset: 0;
}

/* Animated scanning frame */

#scannerOverlay::after {
    content: "";
    position: absolute;
    inset: 9%;
    border: 2px solid rgba(32, 201, 173, 0.7);
    border-radius: 15px;
    box-shadow:
        0 0 12px rgba(32, 201, 173, 0.2),
        inset 0 0 12px rgba(32, 201, 173, 0.08);
    animation: scannerGlow 2.5s ease-in-out infinite;
}

@keyframes scannerGlow {
    0%, 100% {
        border-color: rgba(32, 201, 173, 0.4);
        box-shadow: 0 0 8px rgba(32, 201, 173, 0.1);
    }
    50% {
        border-color: var(--scanner-teal-light);
        box-shadow: 0 0 24px rgba(32, 201, 173, 0.3);
    }
}

/* Capture button */

.capture-analyze-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 14px 25px !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #20c9ad, #087d70) !important;
    color: #041713 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    letter-spacing: 1.3px !important;
    border: 1px solid rgba(101, 242, 214, 0.5) !important;
    box-shadow: 0 6px 22px rgba(32, 201, 173, 0.2) !important;
    transition: all 0.25s ease !important;
}

.capture-analyze-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(32, 201, 173, 0.35) !important;
}

.capture-analyze-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.capture-analyze-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

/* Camera buttons */

#startCameraBtn,
#stopCameraBtn {
    border-radius: 10px;
    transition: all 0.25s ease;
}

#startCameraBtn:hover,
#stopCameraBtn:hover {
    transform: translateY(-2px);
}

/* Camera status */

#cameraStatus {
    color: var(--scanner-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.status-circle {
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.status-circle.active {
    background: var(--scanner-teal) !important;
    box-shadow: 0 0 12px rgba(32, 201, 173, 0.8);
}

.status-circle.error {
    background: #ff5964 !important;
    box-shadow: 0 0 10px rgba(255, 89, 100, 0.5);
}

/* Results panel */

#predictionState,
#bestResult,
#topPredictions {
    border-radius: 18px;
    background: linear-gradient(
        145deg,
        var(--scanner-panel-light),
        var(--scanner-panel)
    );
    border: 1px solid var(--scanner-border);
    padding: 24px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.17);
}

/* Empty / ready state */

#predictionState {
    text-align: center;
    color: var(--scanner-text);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#predictionState h3 {
    font-size: 19px;
    margin: 12px 0 8px;
}

#predictionState p {
    color: var(--scanner-muted);
    font-size: 13px;
    line-height: 1.7;
    max-width: 330px;
}

.state-icon {
    color: var(--scanner-teal-light);
    font-size: 35px;
    animation: iconPulse 2s infinite;
}

@keyframes iconPulse {
    50% {
        opacity: 0.55;
        transform: scale(1.12);
    }
}

/* Best genre result */

#bestResult {
    animation: resultAppear 0.55s ease both;
}

#bestGenre {
    color: var(--scanner-teal-light);
    font-size: clamp(25px, 3vw, 36px);
    font-weight: 850;
    letter-spacing: -0.8px;
    overflow-wrap: anywhere;
}

#bestConfidence {
    color: var(--scanner-teal-light);
    font-size: 23px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

#bestConfidenceBar {
    height: 9px;
    border-radius: 20px;
    background: linear-gradient(90deg, #087f70, #65f2d6);
    box-shadow: 0 0 12px rgba(32, 201, 173, 0.25);
    transition: width 0.8s ease;
}

/* Top five predictions */

#topPredictions {
    margin-top: 18px;
    animation: resultAppear 0.7s ease both;
}

#topPredictions h3 {
    color: var(--scanner-text);
    font-size: 17px;
    margin-bottom: 20px;
}

.prediction-item {
    margin-bottom: 19px;
    padding: 13px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.045);
    border-radius: 11px;
    transition: all 0.25s ease;
}

.prediction-item:hover {
    background: rgba(32, 201, 173, 0.07);
    border-color: rgba(32, 201, 173, 0.25);
    transform: translateX(3px);
}

.prediction-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--scanner-text);
    font-size: 13px;
    font-weight: 600;
}

.prediction-item-top strong {
    color: var(--scanner-teal-light);
    font-variant-numeric: tabular-nums;
}

.prediction-track {
    height: 7px;
    overflow: hidden;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.09);
}

.prediction-bar {
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, #087f70, #65f2d6);
    box-shadow: 0 0 10px rgba(32, 201, 173, 0.3);
    transition: width 0.9s ease;
}

/* Frame counter */

#framesCount {
    color: var(--scanner-teal-light);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* Result entrance animation */

@keyframes resultAppear {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading animation */

#cameraLoading {
    color: var(--scanner-teal-light);
}

/* Mobile responsive */

@media (max-width: 768px) {
    .scanner-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    #cameraStage {
        border-radius: 15px;
    }

    #bestResult,
    #topPredictions,
    #predictionState {
        padding: 19px;
    }

    .capture-analyze-btn {
        width: 100%;
        margin: 10px 0 !important;
    }

    #bestGenre {
        font-size: 27px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #scannerOverlay::after,
    .state-icon {
        animation: none;
    }

    * {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* AI FRAME ANALYSIS */

#aiFrameProgress {
    margin: 18px 0;
    padding: 20px;
    border-radius: 16px;
    background: linear-gradient(145deg, #14283b, #0d1929);
    border: 1px solid rgba(32, 201, 173, 0.2);
    animation: resultAppear 0.4s ease;
}

.ai-progress-heading {
    display: flex;
    justify-content: space-between;
    color: #eaf5fa;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

#aiProgressText {
    color: #65f2d6;
    font-size: 14px;
}

.ai-progress-track {
    height: 7px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
}

#aiProgressBar {
    height: 100%;
    width: 0%;
    border-radius: 20px;
    background: linear-gradient(90deg, #087f70, #65f2d6);
    box-shadow: 0 0 14px rgba(32,201,173,0.4);
    transition: width 0.4s ease;
}

.ai-frame-list {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 19px 0 13px;
}

.ai-frame {
    width: 39px;
    height: 39px;
    border-radius: 11px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #8fa3b9;
    position: relative;
    transition: 0.3s ease;
}

.frame-check {
    display: none;
    color: #65f2d6;
    font-weight: 900;
}

.ai-frame.completed {
    background: rgba(32,201,173,0.15);
    border-color: #20c9ad;
    color: #65f2d6;
}

.ai-frame.completed .frame-number {
    display: none;
}

.ai-frame.completed .frame-check {
    display: block;
}

.ai-frame.processing {
    border-color: #65f2d6;
    box-shadow: 0 0 15px rgba(32,201,173,0.3);
    animation: framePulse 0.9s infinite alternate;
}

@keyframes framePulse {
    from { transform: scale(1); }
    to { transform: scale(1.09); }
}

#aiProgressMessage {
    color: #9eb2c6;
    font-size: 12px;
    text-align: center;
    margin: 0;
}

/* =================================
   PROFESSIONAL RESULT PRESENTATION
   ================================= */

#bestResult {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(32, 201, 173, 0.3);
    background:
        radial-gradient(
            circle at top right,
            rgba(32, 201, 173, 0.13),
            transparent 45%
        ),
        linear-gradient(145deg, #14283b, #0b1727);
    padding: 27px;
}

#bestResult::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(
        90deg,
        #087f70,
        #65f2d6,
        #087f70
    );
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin-bottom: 23px;
}

.match-label {
    color: #65f2d6;
    background: rgba(32, 201, 173, 0.13);
    border: 1px solid rgba(32, 201, 173, 0.3);
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
}

.frame-label {
    color: #b0c4d7;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
}

#bestGenre {
    display: block;
    margin-top: 10px;
    margin-bottom: 12px;
    text-shadow: 0 0 20px rgba(32, 201, 173, 0.15);
}

#bestConfidence {
    font-size: 25px;
    letter-spacing: -0.5px;
}

/* Top 5 analysis */

#topPredictions {
    border: 1px solid rgba(111, 153, 181, 0.22);
    background: linear-gradient(145deg, #122237, #0c1726);
}

/* Completion summary */

.scan-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 23px;
    padding: 15px;
    border-radius: 12px;
    background: rgba(32, 201, 173, 0.07);
    border: 1px solid rgba(32, 201, 173, 0.2);
}

.summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(32, 201, 173, 0.17);
    color: #65f2d6;
    font-weight: 900;
}

.scan-summary strong {
    display: block;
    color: #65f2d6;
    font-size: 12px;
    margin-bottom: 4px;
}

.scan-summary p {
    color: #9eb2c6;
    font-size: 11px;
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .result-meta {
        gap: 7px;
    }

    .match-label,
    .frame-label {
        font-size: 9px;
    }

    #bestResult {
        padding: 20px;
    }
}
