/* ==================== FLAWLESS SPLIT CSS (Mobile Pagination Fix) ==================== */

:root {
    --bg-grad-start: #1e3a8a;
    --bg-grad-end: #3b82f6;
    --white: #ffffff;
    --text-main: #0f172a;
    --text-sub: #64748b;
    --red: #ef4444;
    --green: #10b981;
    --orange: #f59e0b;
}

/* Base Section - Desktop */
.flawless-section {
    height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    display: flex;
}

/* --- Left Panel (Desktop) --- */
.intro-panel-flawless {
    background: linear-gradient(135deg, #0c1e47 0%, #1e3a8a 50%, #1e40af 100%);
    width: 30%;
    min-width: 380px;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 60px;
    position: relative;
    z-index: 20;
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.intro-panel-flawless::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(30, 58, 138, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(30, 64, 175, 0.4) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.restored-circle {
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, #dbeafe 100%);
    opacity: 0.1;
    z-index: 0;
}

.intro-content-wrapper {
    max-width: 320px;
    position: relative;
    z-index: 2;
}

.tag-vivid {
    font-size: 0.8rem;
    font-weight: 800;
    color: #93c5fd;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 15px;
}

.title-vivid {
    font-size: clamp(2rem, 3.5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    color: #ffffff;
    margin-bottom: 20px;
}

.line-vivid {
    width: 60px;
    height: 5px;
    background: linear-gradient(90deg, #ef4444, #f97316);
    margin-bottom: 25px;
    border-radius: 10px;
}

.desc-vivid {
    color: #cbd5e1;
    line-height: 1.6;
    font-size: 1rem;
}

/* --- Right Panel (Desktop) --- */
.scroll-area-flawless {
    width: 70%;
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #6766bc 50%, #7987c3 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.scroll-area-flawless::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 20%, rgba(147, 197, 253, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(96, 165, 250, 0.3) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.cards-track-flawless {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 40px 0;
    width: 100%;
    height: 100%;
    align-items: center;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 2;
}

.cards-track-flawless::-webkit-scrollbar {
    display: none;
}

/* --- Card Design --- */
.doc-card-flawless {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    height: 440px;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    scroll-snap-align: center;
    margin: 0 20px;
}

.doc-card-flawless:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
}

.card-strip { height: 8px; width: 100%; }
.card-strip.red { background: var(--red); }
.card-strip.green { background: var(--green); }
.card-strip.orange { background: var(--orange); }

.card-content {
    padding: 30px 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    justify-content: center;
}

.icon-bubble {
    width: 65px;
    height: 65px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.red-bubble { background: var(--red); }
.green-bubble { background: var(--green); }
.orange-bubble { background: var(--orange); }

.pill-badge {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.red-pill { background: #fee2e2; color: var(--red); }
.green-pill { background: #dcfce7; color: var(--green); }
.orange-pill { background: #ffedd5; color: var(--orange); }

.card-heading {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-sub);
    font-weight: 500;
}

.action-row {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 20px;
}

.btn-action {
    flex: 1;
    padding: 12px 0;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-action.view {
    background: #dbeafe;
    color: #1e40af;
}

/* --- Nav Buttons --- */
.nav-cluster-flawless {
    position: absolute;
    bottom: 40px;
    right: 60px;
    display: flex;
    gap: 15px;
    z-index: 30;
}

.nav-box-flawless {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 14px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s;
}

.nav-box-flawless:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}


/* =========================================================
   MOBILE OPTIMIZATIONS (100dvh + Centered Pagination)
   ========================================================= */

@media (max-width: 991px) {
    /* 1. Main Container: Full viewport height, no scroll */
    .flawless-section {
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    /* 2. Top Panel: Pushed down content to avoid header overlap */
    .intro-panel-flawless {
        width: 100%;
        min-width: unset;
        height: 40%;
        padding: 80px 20px 20px 20px;
        text-align: center;
        justify-content: flex-start;
        align-items: center;
        flex-shrink: 0;
    }

    .intro-content-wrapper {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .tag-vivid { margin-bottom: 5px; font-size: 0.7rem; }
    .title-vivid { font-size: 1.6rem; margin-bottom: 10px; }
    .line-vivid { margin: 8px auto; height: 4px; }
    .desc-vivid { 
        font-size: 0.85rem; 
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .restored-circle {
        width: 150px; height: 150px;
        right: -50px; bottom: -50px;
        opacity: 0.1;
    }

    /* 3. Bottom Panel: Cards + Pagination Area */
    .scroll-area-flawless {
        width: 100%;
        height: 60%;
        background: linear-gradient(180deg, #ffffff 0%, #6766bc 100%);
        padding: 0;
        justify-content: flex-start; /* Align track to top */
        padding-top: 15px; /* Slight top gap */
    }

    .cards-track-flawless {
        padding: 0 20px;
        height: 85%; /* Leave room for buttons at bottom */
        align-items: center;
        margin-bottom: 0;
    }

    /* 4. Documents Card: Smaller Height */
    .doc-card-flawless {
        /* Reduced height to 70% to show pagination clearly below */
        height: 70%; 
        max-height: 350px;
        
        width: 75vw;
        min-width: 260px;
        max-width: 340px;
        
        margin: 0 10px;
        border-radius: 18px;
    }

    .card-content { padding: 15px; }
    .icon-bubble { width: 45px; height: 45px; font-size: 1.3rem; margin-bottom: 10px; }
    .card-heading { font-size: 1rem; margin-bottom: 4px; }
    .pill-badge { margin-bottom: 6px; font-size: 0.6rem; padding: 4px 8px; }
    .action-row { margin-top: 10px; gap: 8px; }
    .btn-action { padding: 8px 0; font-size: 0.8rem; border-radius: 10px; }

    /* 5. Navigation Buttons: Centered at Bottom */
    .nav-cluster-flawless {
        bottom: 20px; /* Position safely from bottom edge */
        right: auto;
        left: 50%; /* Center horizontally */
        transform: translateX(-50%); /* Center correction */
        gap: 20px; /* Space between buttons */
        width: 100%;
        justify-content: center;
        padding-bottom: env(safe-area-inset-bottom); /* iPhone notch safety */
    }

    .nav-box-flawless {
        width: 44px; height: 44px;
        background: rgba(255,255,255,0.8); /* Lighter background for visibility */
        color: #333;
        border: 1px solid rgba(0,0,0,0.1);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
}

/* Download button variants */
.red-dl { background: #ef4444 !important; color: white !important; }
.green-dl { background: #10b981 !important; color: white !important; }
.orange-dl { background: #f97316 !important; color: white !important; }
.blue-dl { background: #3b82f6 !important; color: white !important; }

.btn-action.download:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}
