/* ============================================================
   RAG + ABSA PEMERINTAH KABUPATEN WAJO
   MAIN STYLESHEET
   ============================================================ */


/* ============================================================
   1. ROOT VARIABLES
   ============================================================ */

:root {

    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;

    --success: #16a34a;
    --success-light: #ecfdf3;

    --danger: #dc2626;
    --danger-light: #fef2f2;

    --warning: #d97706;
    --warning-light: #fffbeb;

    --info: #2563eb;
    --info-light: #eff6ff;

    --purple: #7c3aed;
    --purple-light: #f5f3ff;

    --text: #172033;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --border: #e2e8f0;
    --border-light: #edf2f7;

    --background: #f6f8fc;
    --surface: #ffffff;
    --surface-soft: #f8fafc;

    --shadow-sm:
        0 1px 3px rgba(15, 23, 42, 0.05);

    --shadow:
        0 10px 30px rgba(15, 23, 42, 0.06);

    --shadow-lg:
        0 20px 60px rgba(15, 23, 42, 0.14);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;

    --transition:
        0.2s ease;

}


/* ============================================================
   2. RESET
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {

    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--background);

    color: var(--text);

    line-height: 1.6;

    min-height: 100vh;

    -webkit-font-smoothing: antialiased;

}


button,
textarea,
select {
    font-family: inherit;
}


button {
    cursor: pointer;
}


.hidden {
    display: none !important;
}


/* ============================================================
   3. APP
   ============================================================ */

#app {
    min-height: 100vh;
}


/* ============================================================
   4. TOPBAR
   ============================================================ */

.topbar {

    position: sticky;

    top: 0;

    z-index: 100;

    background:
        rgba(255, 255, 255, 0.94);

    backdrop-filter:
        blur(16px);

    border-bottom:
        1px solid var(--border);

}


.topbar-inner {

    width: min(
        1500px,
        calc(100% - 48px)
    );

    min-height: 76px;

    margin: auto;

    display: flex;

    align-items: center;

    justify-content: space-between;

}


/* ============================================================
   BRAND
   ============================================================ */

.brand {

    display: flex;

    align-items: center;

    gap: 14px;

}


.brand-icon {

    width: 44px;

    height: 44px;

    border-radius: 12px;

    display: flex;

    align-items: center;

    justify-content: center;

    color: white;

    background:
        linear-gradient(
            135deg,
            #4f46e5,
            #6366f1
        );

    box-shadow:
        0 8px 20px rgba(
            79,
            70,
            229,
            0.25
        );

    font-size: 19px;

}


.brand-title {

    font-size: 16px;

    font-weight: 800;

    color: var(--text-dark);

}


.brand-subtitle {

    margin-top: 1px;

    font-size: 11px;

    color: var(--text-muted);

}


/* ============================================================
   SYSTEM STATUS
   ============================================================ */

.system-status {

    display: inline-flex;

    align-items: center;

    gap: 8px;

    padding:
        8px 13px;

    border-radius: 999px;

    font-size: 12px;

    font-weight: 700;

    border: 1px solid;

}


.system-status.checking {

    color: var(--warning);

    background: var(--warning-light);

    border-color:
        #fde68a;

}


.system-status.online {

    color: var(--success);

    background: var(--success-light);

    border-color:
        #bbf7d0;

}


.system-status.offline {

    color: var(--danger);

    background: var(--danger-light);

    border-color:
        #fecaca;

}


.status-dot {

    width: 8px;

    height: 8px;

    border-radius: 50%;

    background: currentColor;

    box-shadow:
        0 0 0 4px
        rgba(22, 163, 74, 0.08);

}


/* ============================================================
   5. MAIN CONTAINER
   ============================================================ */

.main-container {

    width: min(
        1500px,
        calc(100% - 48px)
    );

    margin: auto;

    padding:
        48px 0 70px;

}


/* ============================================================
   6. HERO
   ============================================================ */

.hero-section {

    max-width: 900px;

    margin:
        0 auto 38px;

    text-align: center;

}


.hero-badge {

    display: inline-flex;

    align-items: center;

    gap: 8px;

    padding:
        7px 12px;

    border-radius: 999px;

    background:
        var(--primary-light);

    color:
        var(--primary);

    font-size: 11px;

    font-weight: 800;

    letter-spacing:
        0.04em;

    margin-bottom: 16px;

}


.hero-section h1 {

    font-size:
        clamp(
            30px,
            4vw,
            46px
        );

    line-height: 1.12;

    letter-spacing:
        -0.04em;

    color:
        var(--text-dark);

    font-weight: 900;

}


.hero-section h1 span {

    display: block;

    margin-top: 6px;

    color:
        var(--primary);

}


.hero-section p {

    max-width: 750px;

    margin:
        16px auto 0;

    color:
        var(--text-muted);

    font-size: 14px;

}


/* ============================================================
   7. CONTENT LAYOUT
   ============================================================ */

.content-layout {

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        360px;

    gap: 26px;

    align-items: start;

}


.main-column {

    min-width: 0;

}


.sidebar {

    display: flex;

    flex-direction: column;

    gap: 20px;

}


/* ============================================================
   8. CARD
   ============================================================ */

.card,
.side-card {

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius);

    box-shadow:
        var(--shadow-sm);

}


.card {

    padding: 26px;

    margin-bottom: 22px;

}


.side-card {

    padding: 20px;

}


/* ============================================================
   9. CARD HEADER
   ============================================================ */

.card-header {

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;

}


.card-kicker {

    display: flex;

    align-items: center;

    gap: 7px;

    color:
        var(--primary);

    font-size: 11px;

    font-weight: 800;

    letter-spacing:
        0.04em;

    margin-bottom: 6px;

}


.card-header h2 {

    color:
        var(--text-dark);

    font-size: 19px;

    font-weight: 800;

}


.card-header-icon {

    width: 42px;

    height: 42px;

    flex: 0 0 42px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 12px;

    background:
        var(--primary-light);

    color:
        var(--primary);

}


/* ============================================================
   10. QUERY INPUT
   ============================================================ */

.query-wrapper {

    position: relative;

}


.query-input {

    width: 100%;

    min-height: 150px;

    resize: vertical;

    padding:
        18px 18px 38px;

    border:
        1px solid var(--border);

    border-radius:
        14px;

    outline: none;

    background:
        #fbfcff;

    color:
        var(--text-dark);

    font-size: 14px;

    line-height: 1.7;

    transition:
        border var(--transition),
        box-shadow var(--transition),
        background var(--transition);

}


.query-input::placeholder {

    color:
        #a0aec0;

}


.query-input:focus {

    background:
        white;

    border-color:
        #818cf8;

    box-shadow:
        0 0 0 4px
        rgba(
            79,
            70,
            229,
            0.08
        );

}


.character-counter {

    position: absolute;

    bottom: 12px;

    left: 16px;

    right: 16px;

    display: flex;

    justify-content: space-between;

    align-items: center;

    font-size: 10px;

    color:
        var(--text-light);

}


/* ============================================================
   11. QUERY OPTIONS
   ============================================================ */

.query-options {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-top: 13px;

}


.topk-control {

    display: flex;

    align-items: center;

    gap: 9px;

}


.topk-control label {

    font-size: 12px;

    color:
        var(--text-muted);

    font-weight: 600;

}


.topk-select {

    border:
        1px solid var(--border);

    background:
        white;

    border-radius: 9px;

    padding:
        7px 28px 7px 10px;

    color:
        var(--text-dark);

    font-size: 12px;

    outline: none;

}


.keyboard-hint {

    color:
        var(--text-light);

    font-size: 11px;

}


.keyboard-hint strong {

    color:
        var(--text-muted);

}


/* ============================================================
   12. BUTTONS
   ============================================================ */

.query-actions {

    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 18px;

}


.btn {

    border: none;

    border-radius: 11px;

    min-height: 42px;

    padding:
        0 17px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    font-size: 12px;

    font-weight: 700;

    transition:
        all var(--transition);

}


.btn-primary {

    color: white;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            #6366f1
        );

    box-shadow:
        0 7px 18px
        rgba(
            79,
            70,
            229,
            0.2
        );

}


.btn-primary:hover {

    transform:
        translateY(-1px);

    box-shadow:
        0 10px 22px
        rgba(
            79,
            70,
            229,
            0.28
        );

}


.btn-secondary {

    color:
        var(--text-muted);

    background:
        white;

    border:
        1px solid var(--border);

}


.btn-secondary:hover {

    background:
        var(--surface-soft);

    border-color:
        #cbd5e1;

}


/* ============================================================
   13. LOADING
   ============================================================ */

.loading-card {

    overflow: hidden;

}


.loading-content {

    display: flex;

    align-items: center;

    gap: 15px;

}


.loading-spinner {

    width: 42px;

    height: 42px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 12px;

    background:
        var(--primary-light);

    color:
        var(--primary);

    font-size: 18px;

}


.loading-spinner i,
.pdf-spinner i {

    animation:
        spin 1s linear infinite;

}


@keyframes spin {

    to {
        transform: rotate(360deg);
    }

}


.loading-content h3 {

    font-size: 14px;

    color:
        var(--text-dark);

}


.loading-content p {

    margin-top: 3px;

    color:
        var(--text-muted);

    font-size: 11px;

}


.loading-progress {

    height: 4px;

    margin-top: 20px;

    background:
        #eef2ff;

    border-radius: 999px;

    overflow: hidden;

}


.loading-progress-bar {

    width: 45%;

    height: 100%;

    background:
        linear-gradient(
            90deg,
            var(--primary),
            #8b5cf6
        );

    border-radius: inherit;

    animation:
        loadingProgress 1.5s ease-in-out infinite;

}


@keyframes loadingProgress {

    0% {
        transform: translateX(-110%);
    }

    100% {
        transform: translateX(250%);
    }

}


/* ============================================================
   14. ANSWER
   ============================================================ */

.answer-box {

    padding:
        20px;

    border:
        1px solid #dbe4f0;

    background:
        linear-gradient(
            135deg,
            #fafbff,
            #f8fafc
        );

    border-radius:
        14px;

}


.answer-label {

    display: flex;

    align-items: center;

    gap: 7px;

    color:
        var(--primary);

    font-size: 11px;

    font-weight: 800;

    margin-bottom: 10px;

}


.answer-text {

    color:
        var(--text-dark);

    font-size: 14px;

    line-height: 1.8;

    white-space: pre-wrap;

}


/* ============================================================
   15. COPY BUTTON
   ============================================================ */

.icon-button {

    width: 38px;

    height: 38px;

    border:
        1px solid var(--border);

    background:
        var(--surface-soft);

    border-radius: 11px;

    color:
        var(--text-muted);

    transition:
        all var(--transition);

}


.icon-button:hover {

    color:
        var(--primary);

    background:
        var(--primary-light);

    border-color:
        #c7d2fe;

}


/* ============================================================
   16. ANALYSIS GRID
   ============================================================ */

.analysis-grid {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 10px;

    margin-top: 14px;

}


.metric-card {

    min-width: 0;

    padding:
        15px;

    border:
        1px solid var(--border);

    border-radius:
        13px;

    display: flex;

    align-items: center;

    gap: 10px;

    background:
        white;

}


.metric-icon {

    width: 34px;

    height: 34px;

    flex: 0 0 34px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 9px;

    font-size: 13px;

}


.metric-icon.aspect {

    color:
        var(--primary);

    background:
        var(--primary-light);

}


.metric-icon.sentiment {

    color:
        var(--success);

    background:
        var(--success-light);

}


.metric-icon.intent {

    color:
        var(--warning);

    background:
        var(--warning-light);

}


.metric-icon.retrieval {

    color:
        var(--purple);

    background:
        var(--purple-light);

}


.metric-content {

    min-width: 0;

}


.metric-label {

    color:
        var(--text-light);

    font-size: 10px;

}


.metric-value {

    margin-top: 2px;

    color:
        var(--text-dark);

    font-size: 13px;

    font-weight: 800;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

}


/* ============================================================
   17. CONFIDENCE
   ============================================================ */

.confidence-card {

    margin-top: 14px;

    padding:
        17px;

    border:
        1px solid #ddd6fe;

    border-radius:
        14px;

    background:
        linear-gradient(
            135deg,
            #faf8ff,
            #f5f3ff
        );

}


.confidence-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

}


.confidence-title {

    color:
        var(--purple);

    font-size: 12px;

    font-weight: 800;

}


.confidence-description {

    margin-top: 2px;

    color:
        var(--text-muted);

    font-size: 10px;

}


.confidence-header strong {

    color:
        var(--purple);

    font-size: 15px;

}


.confidence-track {

    height: 7px;

    margin-top: 12px;

    overflow: hidden;

    background:
        #e9e4ff;

    border-radius:
        999px;

}


.confidence-bar {

    height: 100%;

    border-radius:
        inherit;

    background:
        linear-gradient(
            90deg,
            #7c3aed,
            #8b5cf6
        );

    transition:
        width 0.5s ease;

}


/* ============================================================
   18. KEYWORDS
   ============================================================ */

.keywords-grid {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 10px;

    margin-top: 14px;

}


.keyword-card {

    padding:
        14px;

    border:
        1px solid var(--border);

    border-radius:
        13px;

    min-height: 90px;

}


.keyword-title {

    display: flex;

    align-items: center;

    gap: 6px;

    color:
        var(--text-muted);

    font-size: 10px;

    font-weight: 700;

    margin-bottom: 10px;

}


.keyword-title i {

    color:
        var(--primary);

}


.keyword-list {

    display: flex;

    flex-wrap: wrap;

    gap: 5px;

}


.keyword {

    display: inline-flex;

    align-items: center;

    padding:
        4px 8px;

    border-radius:
        999px;

    background:
        var(--surface-soft);

    border:
        1px solid var(--border-light);

    color:
        var(--text-muted);

    font-size: 10px;

}


.keyword-empty {

    color:
        var(--text-light);

    font-size: 10px;

}


/* ============================================================
   19. SOURCES
   ============================================================ */

.sources-section {

    margin-top: 22px;

    padding-top: 18px;

    border-top:
        1px solid var(--border);

}


.section-title {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 11px;

}


.section-title > div {

    display: flex;

    align-items: center;

    gap: 7px;

    color:
        var(--text-dark);

    font-size: 12px;

    font-weight: 800;

}


.section-title > div i {

    color:
        var(--primary);

}


.section-title > span {

    min-width: 22px;

    height: 22px;

    padding:
        0 7px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    border-radius: 999px;

    background:
        var(--primary-light);

    color:
        var(--primary);

    font-size: 10px;

    font-weight: 800;

}


.sources-list {

    display: flex;

    flex-direction: column;

    gap: 8px;

}


.source-item {

    padding:
        13px;

    border:
        1px solid var(--border);

    border-radius:
        12px;

    background:
        var(--surface-soft);

    display: grid;

    grid-template-columns:
        34px
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 10px;

    transition:
        all var(--transition);

}


.source-item:hover {

    background:
        white;

    border-color:
        #c7d2fe;

    box-shadow:
        var(--shadow-sm);

    transform:
        translateY(-1px);

}


.source-rank {

    width: 30px;

    height: 30px;

    border-radius: 9px;

    background:
        var(--primary-light);

    color:
        var(--primary);

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 11px;

    font-weight: 800;

}


.source-main {

    min-width: 0;

}


.source-document {

    color:
        var(--text-dark);

    font-size: 11px;

    font-weight: 800;

}


.source-meta {

    display: flex;

    flex-wrap: wrap;

    gap: 7px;

    margin-top: 2px;

    color:
        var(--text-muted);

    font-size: 9px;

}


.source-score {

    font-size: 10px;

    color:
        var(--primary);

    font-weight: 800;

}


.source-open {

    border:
        1px solid var(--border);

    background:
        white;

    color:
        var(--primary);

    border-radius: 9px;

    padding:
        7px 9px;

    font-size: 10px;

    font-weight: 700;

    transition:
        all var(--transition);

}


.source-open:hover {

    background:
        var(--primary-light);

    border-color:
        #c7d2fe;

}


.sources-empty {

    padding:
        20px;

    text-align: center;

    color:
        var(--text-light);

    font-size: 11px;

    border:
        1px dashed var(--border);

    border-radius:
        12px;

}


/* ============================================================
   20. PROCESSING INFO
   ============================================================ */

.processing-info {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 8px;

    margin-top: 18px;

    padding-top: 16px;

    border-top:
        1px solid var(--border);

}


.processing-info > div {

    padding:
        9px;

    border-radius:
        10px;

    background:
        var(--surface-soft);

}


.processing-info span {

    display: block;

    color:
        var(--text-light);

    font-size: 9px;

}


.processing-info strong {

    display: block;

    margin-top: 2px;

    color:
        var(--text-dark);

    font-size: 10px;

}


/* ============================================================
   21. ERROR CARD
   ============================================================ */

.error-card {

    display: flex;

    align-items: center;

    gap: 15px;

    padding:
        20px;

    border-color:
        #fecaca;

    background:
        #fffafa;

}


.error-icon {

    width: 42px;

    height: 42px;

    flex: 0 0 42px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 12px;

    background:
        var(--danger-light);

    color:
        var(--danger);

}


.error-content {

    flex: 1;

}


.error-content h3 {

    color:
        var(--danger);

    font-size: 13px;

}


.error-content p {

    margin-top: 2px;

    color:
        var(--text-muted);

    font-size: 11px;

}


/* ============================================================
   22. SIDEBAR
   ============================================================ */

.side-card-header {

    display: flex;

    align-items: center;

    gap: 11px;

    margin-bottom: 17px;

}


.side-icon {

    width: 38px;

    height: 38px;

    flex: 0 0 38px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 11px;

    color:
        var(--primary);

    background:
        var(--primary-light);

}


.side-card-header h3 {

    color:
        var(--text-dark);

    font-size: 13px;

    font-weight: 800;

}


.side-card-header p {

    margin-top: 1px;

    color:
        var(--text-light);

    font-size: 10px;

}


/* ============================================================
   23. CORPUS DOCUMENTS
   ============================================================ */

.corpus-document {

    display: grid;

    grid-template-columns:
        38px
        minmax(0, 1fr)
        34px;

    align-items: center;

    gap: 9px;

    padding:
        12px;

    border:
        1px solid var(--border);

    border-radius:
        12px;

    background:
        var(--surface-soft);

    margin-bottom: 8px;

    transition:
        all var(--transition);

}


.corpus-document:hover {

    background:
        white;

    border-color:
        #c7d2fe;

    transform:
        translateY(-1px);

}


.document-icon {

    width: 38px;

    height: 38px;

    border-radius: 10px;

    display: flex;

    align-items: center;

    justify-content: center;

    color:
        var(--danger);

    background:
        var(--danger-light);

}


.document-info {

    min-width: 0;

}


.document-info strong {

    display: block;

    color:
        var(--text-dark);

    font-size: 11px;

    font-weight: 800;

}


.document-info span {

    display: block;

    margin-top: 2px;

    color:
        var(--text-light);

    font-size: 9px;

    line-height: 1.4;

}


.document-button {

    width: 32px;

    height: 32px;

    border:
        1px solid var(--border);

    background:
        white;

    border-radius: 9px;

    color:
        var(--primary);

    transition:
        all var(--transition);

}


.document-button:hover {

    color:
        white;

    background:
        var(--primary);

    border-color:
        var(--primary);

}


.corpus-note {

    display: flex;

    align-items: flex-start;

    gap: 7px;

    margin-top: 13px;

    padding:
        11px;

    border-radius:
        10px;

    background:
        var(--info-light);

    color:
        #475569;

    font-size: 9px;

    line-height: 1.6;

}


.corpus-note i {

    color:
        var(--info);

    margin-top: 2px;

}


/* ============================================================
   24. TECHNOLOGY
   ============================================================ */

.technology-list {

    display: flex;

    flex-direction: column;

    gap: 13px;

}


.technology-item {

    display: grid;

    grid-template-columns:
        34px
        1fr;

    gap: 9px;

}


.technology-icon {

    width: 34px;

    height: 34px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 9px;

    background:
        var(--surface-soft);

    color:
        var(--primary);

    font-size: 12px;

}


.technology-item strong {

    display: block;

    color:
        var(--text-dark);

    font-size: 10px;

}


.technology-item span {

    display: block;

    margin-top: 2px;

    color:
        var(--text-muted);

    font-size: 9px;

    line-height: 1.5;

}


/* ============================================================
   25. EXAMPLES
   ============================================================ */

.example-list {

    display: flex;

    flex-direction: column;

    gap: 7px;

}


.example-question {

    width: 100%;

    text-align: left;

    padding:
        10px 11px;

    border:
        1px solid var(--border);

    border-radius:
        10px;

    background:
        var(--surface-soft);

    color:
        var(--text-muted);

    font-size: 9px;

    line-height: 1.5;

    transition:
        all var(--transition);

}


.example-question:hover {

    color:
        var(--primary);

    background:
        var(--primary-light);

    border-color:
        #c7d2fe;

}


/* ============================================================
   26. SYSTEM INFORMATION
   ============================================================ */

.system-info-list {

    display: flex;

    flex-direction: column;

    gap: 7px;

}


.system-info-list > div {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    padding:
        9px 10px;

    border-radius:
        9px;

    background:
        var(--surface-soft);

}


.system-info-list span {

    color:
        var(--text-muted);

    font-size: 10px;

}


.system-info-list strong {

    color:
        var(--text-dark);

    font-size: 10px;

}


/* ============================================================
   27. FOOTER
   ============================================================ */

.footer {

    border-top:
        1px solid var(--border);

    background:
        white;

}


.footer-inner {

    width: min(
        1500px,
        calc(100% - 48px)
    );

    margin: auto;

    min-height: 80px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 30px;

}


.footer-inner strong {

    display: block;

    color:
        var(--text-dark);

    font-size: 11px;

}


.footer-inner span {

    display: block;

    margin-top: 2px;

    color:
        var(--text-light);

    font-size: 9px;

}


.footer-status {

    display: flex !important;

    align-items: center;

    gap: 7px;

    color:
        var(--success) !important;

    font-size: 10px !important;

    font-weight: 700;

    white-space: nowrap;

}


/* ============================================================
   28. PDF MODAL
   ============================================================ */

.pdf-modal {

    position: fixed;

    inset: 0;

    z-index: 1000;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

}


.pdf-overlay {

    position: absolute;

    inset: 0;

    background:
        rgba(
            15,
            23,
            42,
            0.72
        );

    backdrop-filter:
        blur(5px);

}


.pdf-dialog {

    position: relative;

    z-index: 1;

    width: min(
        1200px,
        96vw
    );

    height: min(
        900px,
        94vh
    );

    display: flex;

    flex-direction: column;

    overflow: hidden;

    border-radius:
        20px;

    background:
        white;

    box-shadow:
        0 30px 90px
        rgba(
            0,
            0,
            0,
            0.3
        );

    animation:
        modalIn 0.2s ease;

}


@keyframes modalIn {

    from {

        opacity: 0;

        transform:
            translateY(10px)
            scale(0.98);

    }

    to {

        opacity: 1;

        transform:
            translateY(0)
            scale(1);

    }

}


/* ============================================================
   29. PDF HEADER
   ============================================================ */

.pdf-header {

    min-height: 68px;

    padding:
        12px 16px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    border-bottom:
        1px solid var(--border);

    background:
        white;

}


.pdf-title-wrapper {

    display: flex;

    align-items: center;

    gap: 11px;

}


.pdf-icon {

    width: 42px;

    height: 42px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 11px;

    color:
        var(--danger);

    background:
        var(--danger-light);

}


.pdf-title-wrapper h3 {

    color:
        var(--text-dark);

    font-size: 13px;

    font-weight: 800;

}


.pdf-title-wrapper p {

    margin-top: 1px;

    color:
        var(--text-light);

    font-size: 9px;

}


.pdf-close {

    width: 36px;

    height: 36px;

    border: none;

    border-radius: 10px;

    color:
        var(--text-muted);

    background:
        var(--surface-soft);

    transition:
        all var(--transition);

}


.pdf-close:hover {

    color:
        var(--danger);

    background:
        var(--danger-light);

}


/* ============================================================
   30. PDF TOOLBAR
   ============================================================ */

.pdf-toolbar {

    min-height: 45px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    padding:
        6px 14px;

    border-bottom:
        1px solid var(--border);

    background:
        var(--surface-soft);

}


.pdf-page-info {

    display: flex;

    align-items: center;

    gap: 6px;

    color:
        var(--text-muted);

    font-size: 10px;

}


.pdf-page-info i {

    color:
        var(--primary);

}


.pdf-toolbar-actions {

    display: flex;

    align-items: center;

    gap: 7px;

}


.pdf-toolbar-button {

    border:
        1px solid var(--border);

    background:
        white;

    color:
        var(--primary);

    border-radius:
        8px;

    padding:
        7px 10px;

    font-size: 10px;

    font-weight: 700;

}


.pdf-toolbar-button:hover {

    background:
        var(--primary-light);

    border-color:
        #c7d2fe;

}


/* ============================================================
   31. PDF CONTENT
   ============================================================ */

.pdf-content {

    position: relative;

    flex: 1;

    min-height: 0;

    background:
        #475569;

}


.pdf-frame {

    width: 100%;

    height: 100%;

    display: block;

    border: none;

    background:
        white;

}


.pdf-loading {

    position: absolute;

    inset: 0;

    z-index: 2;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 10px;

    background:
        #f8fafc;

    color:
        var(--text-muted);

    font-size: 11px;

}


.pdf-spinner {

    width: 38px;

    height: 38px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 10px;

    background:
        var(--primary-light);

    color:
        var(--primary);

    font-size: 17px;

}


.pdf-error {

    position: absolute;

    inset: 0;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    padding: 30px;

    background:
        white;

    text-align: center;

}


.pdf-error > i {

    color:
        var(--danger);

    font-size: 30px;

    margin-bottom: 12px;

}


.pdf-error h3 {

    color:
        var(--text-dark);

    font-size: 15px;

}


.pdf-error p {

    margin-top: 4px;

    color:
        var(--text-muted);

    font-size: 11px;

}


/* ============================================================
   32. PDF FOOTER
   ============================================================ */

.pdf-footer {

    min-height: 48px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    padding:
        7px 14px;

    border-top:
        1px solid var(--border);

    background:
        white;

}


.pdf-footer > div {

    display: flex;

    align-items: center;

    gap: 6px;

    color:
        var(--text-light);

    font-size: 9px;

}


.pdf-footer > div i {

    color:
        var(--primary);

}


.pdf-new-tab-button {

    border: none;

    background:
        var(--primary-light);

    color:
        var(--primary);

    border-radius:
        8px;

    padding:
        7px 10px;

    font-size: 9px;

    font-weight: 700;

}


/* ============================================================
   33. SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {

    width: 8px;

    height: 8px;

}


::-webkit-scrollbar-track {

    background:
        #f1f5f9;

}


::-webkit-scrollbar-thumb {

    background:
        #cbd5e1;

    border-radius:
        999px;

}


::-webkit-scrollbar-thumb:hover {

    background:
        #94a3b8;

}


/* ============================================================
   34. RESPONSIVE - TABLET
   ============================================================ */

@media (
    max-width: 1100px
) {

    .content-layout {

        grid-template-columns:
            1fr;

    }


    .sidebar {

        display: grid;

        grid-template-columns:
            repeat(2, 1fr);

        align-items: start;

    }


    .analysis-grid {

        grid-template-columns:
            repeat(2, 1fr);

    }


}


/* ============================================================
   35. RESPONSIVE - MOBILE
   ============================================================ */

@media (
    max-width: 700px
) {

    .topbar-inner,
    .main-container,
    .footer-inner {

        width:
            calc(100% - 28px);

    }


    .topbar-inner {

        min-height:
            68px;

    }


    .brand-icon {

        width: 40px;

        height: 40px;

    }


    .brand-title {

        font-size: 14px;

    }


    .brand-subtitle {

        font-size: 9px;

    }


    .system-status {

        padding:
            7px 9px;

        font-size: 9px;

    }


    .main-container {

        padding:
            30px 0 45px;

    }


    .hero-section {

        margin-bottom:
            25px;

    }


    .hero-section h1 {

        font-size:
            30px;

    }


    .hero-section p {

        font-size:
            12px;

    }


    .card {

        padding:
            18px;

    }


    .card-header h2 {

        font-size:
            16px;

    }


    .query-options {

        align-items:
            flex-start;

        flex-direction:
            column;

    }


    .query-actions {

        width:
            100%;

    }


    .query-actions .btn {

        flex:
            1;

    }


    .analysis-grid {

        grid-template-columns:
            repeat(2, 1fr);

    }


    .keywords-grid {

        grid-template-columns:
            1fr;

    }


    .processing-info {

        grid-template-columns:
            repeat(2, 1fr);

    }


    .sidebar {

        display:
            flex;

    }


    .footer-inner {

        flex-direction:
            column;

        align-items:
            flex-start;

        justify-content:
            center;

        padding:
            16px 0;

    }


    .pdf-modal {

        padding:
            8px;

    }


    .pdf-dialog {

        width:
            100%;

        height:
            96vh;

        border-radius:
            14px;

    }


    .pdf-toolbar-button {

        padding:
            6px 8px;

    }


    .pdf-footer {

        flex-direction:
            column;

        align-items:
            flex-start;

        padding:
            9px 12px;

    }

}


/* ============================================================
   36. SMALL MOBILE
   ============================================================ */

@media (
    max-width: 430px
) {

    .system-status {

        width:
            10px;

        height:
            10px;

        padding: 0;

        border: none;

        background:
            transparent;

        font-size: 0;

    }


    .status-dot {

        width:
            10px;

        height:
            10px;

    }


    .analysis-grid {

        grid-template-columns:
            1fr;

    }


    .metric-card {

        padding:
            12px;

    }


    .source-item {

        grid-template-columns:
            30px
            minmax(0, 1fr);

    }


    .source-open {

        grid-column:
            2;

        justify-self:
            start;

    }


    .pdf-title-wrapper p {

        display:
            none;

    }

}