/* ============================================
   GST Invoice Data Extraction - Educational Resource
   Digital E-Filing Coach | Amanuddin Education
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;800;900&family=Source+Sans+3:wght@400;600;700;800&family=Fira+Code:wght@500&display=swap');

/* ---------- CSS Variables ---------- */
:root {
    --bg-primary: rgb(15, 23, 42);
    --bg-secondary: rgb(30, 41, 59);
    --bg-card: rgb(39, 52, 74);
    --bg-card-hover: rgb(48, 64, 90);
    --accent-gold: rgb(234, 179, 8);
    --accent-gold-light: rgb(253, 224, 71);
    --accent-blue: rgb(56, 189, 248);
    --accent-green: rgb(52, 211, 153);
    --accent-red: rgb(248, 113, 113);
    --accent-violet: rgb(167, 139, 250);
    --accent-orange: rgb(251, 146, 60);
    --text-primary: rgb(241, 245, 249);
    --text-secondary: rgb(148, 163, 184);
    --text-muted: rgb(100, 116, 139);
    --border-main: rgb(234, 179, 8);
    --border-subtle: rgb(51, 65, 85);
    --border-card: rgb(71, 85, 105);
    --shadow-gold: rgba(234, 179, 8, 0.15);
    --shadow-dark: rgba(0, 0, 0, 0.4);
    --gradient-header: linear-gradient(135deg, rgb(15, 23, 42) 0%, rgb(30, 58, 95) 50%, rgb(15, 23, 42) 100%);
    --gradient-gold: linear-gradient(135deg, rgb(234, 179, 8), rgb(251, 191, 36));
    --radius: 12px;
    --transition: 0.3s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    font-weight: 600;
    min-height: 100vh;
}

/* ---------- Noise Texture Overlay ---------- */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* ---------- Sticky Navigation ---------- */
.sticky-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 2px solid var(--border-main);
    box-shadow: 0 4px 24px var(--shadow-dark);
    padding: 0 20px;
    transition: var(--transition);
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    font-family: 'Playfair Display', serif;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--accent-gold);
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.nav-btn:hover, .nav-btn.active {
    color: var(--accent-gold);
    background: rgba(234, 179, 8, 0.08);
    border-color: rgba(234, 179, 8, 0.25);
}

.nav-btn .icon {
    font-size: 1rem;
}

/* Mobile hamburger */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--accent-gold);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 4px;
}

/* ---------- Print Button ---------- */
.print-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-gold);
    color: var(--bg-primary);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 6px 24px var(--shadow-gold), 0 2px 8px var(--shadow-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.print-fab:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 10px 32px var(--shadow-gold);
}

/* ---------- Main Container ---------- */
.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 90px 24px 60px;
    position: relative;
    z-index: 1;
}

/* ---------- Hero Section ---------- */
.hero {
    text-align: center;
    padding: 60px 30px 50px;
    background: var(--gradient-header);
    border: 2px solid var(--border-main);
    border-radius: var(--radius);
    margin-bottom: 48px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -60%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: radial-gradient(ellipse at center, rgba(234, 179, 8, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-block;
    padding: 6px 20px;
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.35);
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-gold);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: 16px;
}

.hero h1 .gold {
    color: var(--accent-gold);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 24px;
    font-weight: 600;
}

.hero-brand {
    font-size: 0.85rem;
    color: var(--accent-gold-light);
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ---------- Section ---------- */
.section {
    margin-bottom: 44px;
    scroll-margin-top: 80px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border-main);
}

.section-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--gradient-gold);
    color: var(--bg-primary);
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 1.15rem;
    border-radius: 10px;
    flex-shrink: 0;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-weight: 800;
    font-size: 1.55rem;
    color: var(--text-primary);
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 28px 30px;
    margin-bottom: 20px;
    transition: var(--transition);
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(234, 179, 8, 0.3);
    box-shadow: 0 4px 20px var(--shadow-gold);
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--accent-gold);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title .card-icon {
    font-size: 1.3rem;
}

/* ---------- Instruction List ---------- */
.instruction-list {
    list-style: none;
    counter-reset: inst;
}

.instruction-list li {
    counter-increment: inst;
    padding: 12px 16px 12px 50px;
    margin-bottom: 10px;
    background: rgba(30, 41, 59, 0.6);
    border-left: 3px solid var(--accent-blue);
    border-radius: 0 8px 8px 0;
    position: relative;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition);
}

.instruction-list li::before {
    content: counter(inst);
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    background: var(--accent-blue);
    color: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
}

.instruction-list li:hover {
    background: rgba(56, 189, 248, 0.08);
    border-left-color: var(--accent-gold);
}

/* ---------- Bullet List ---------- */
.bullet-list {
    list-style: none;
    padding-left: 0;
}

.bullet-list li {
    padding: 8px 0 8px 28px;
    position: relative;
    font-weight: 600;
    color: var(--text-primary);
}

.bullet-list li::before {
    content: '▸';
    position: absolute;
    left: 6px;
    color: var(--accent-gold);
    font-weight: 800;
    font-size: 1.1rem;
}

/* ---------- Field Definition Grid ---------- */
.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.field-item {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 16px 18px;
    transition: var(--transition);
}

.field-item:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 2px 12px var(--shadow-gold);
}

.field-name {
    font-family: 'Fira Code', monospace;
    font-weight: 500;
    font-size: 0.92rem;
    color: var(--accent-green);
    margin-bottom: 6px;
}

.field-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ---------- Table ---------- */
.table-wrapper {
    overflow-x: auto;
    border: 2px solid var(--border-main);
    border-radius: var(--radius);
    margin: 20px 0;
}

.gst-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    white-space: nowrap;
}

.gst-table thead {
    background: linear-gradient(135deg, rgb(30, 58, 95), rgb(39, 52, 74));
}

.gst-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 800;
    color: var(--accent-gold);
    border-bottom: 2px solid var(--border-main);
    letter-spacing: 0.3px;
    font-size: 0.82rem;
    text-transform: uppercase;
}

.gst-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
    color: var(--text-primary);
}

.gst-table tbody tr:hover {
    background: rgba(234, 179, 8, 0.05);
}

/* ---------- Validation Rules ---------- */
.validation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.validation-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    transition: var(--transition);
}

.validation-item:hover {
    border-color: var(--accent-green);
    background: rgba(52, 211, 153, 0.06);
}

.validation-check {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
}

.validation-text {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
}

/* ---------- Flowchart Container ---------- */
.flowchart-wrapper {
    background: var(--bg-secondary);
    border: 2px solid var(--border-main);
    border-radius: var(--radius);
    padding: 30px 20px;
    overflow-x: auto;
    margin: 20px 0;
}

.flowchart-wrapper svg {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

/* ---------- Disclaimer ---------- */
.disclaimer {
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-left: 4px solid var(--accent-red);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 20px 24px;
    margin-top: 40px;
}

.disclaimer-title {
    font-family: 'Playfair Display', serif;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--accent-red);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.disclaimer p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ---------- Footer ---------- */
.footer {
    text-align: center;
    padding: 40px 20px 30px;
    margin-top: 50px;
    border-top: 2px solid var(--border-main);
}

.footer-brand {
    font-family: 'Playfair Display', serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--accent-gold);
    margin-bottom: 8px;
}

.footer-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ---------- Back to Top ---------- */
.back-top {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 8px 20px;
    background: transparent;
    border: 1px solid var(--border-main);
    border-radius: 30px;
    color: var(--accent-gold);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Source Sans 3', sans-serif;
}

.back-top:hover {
    background: rgba(234, 179, 8, 0.1);
}

/* ---------- Export Status ---------- */
.export-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.export-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--accent-green);
}

.export-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ---------- Few-Shot Example ---------- */
.example-box {
    background: rgba(167, 139, 250, 0.06);
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: var(--radius);
    padding: 22px 26px;
    margin-top: 16px;
}

.example-box .example-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--accent-violet);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.example-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 0.88rem;
}

.example-row span {
    color: var(--text-secondary);
    font-weight: 600;
}

.example-row strong {
    color: var(--accent-gold-light);
    font-weight: 800;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(15, 23, 42, 0.97);
        backdrop-filter: blur(16px);
        flex-direction: column;
        padding: 12px 16px;
        border-bottom: 2px solid var(--border-main);
        gap: 2px;
    }

    .nav-links.open {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    .nav-btn {
        padding: 10px 14px;
        font-size: 0.88rem;
        justify-content: flex-start;
    }

    .hero {
        padding: 40px 20px 36px;
    }

    .field-grid,
    .validation-grid {
        grid-template-columns: 1fr;
    }

    .main-container {
        padding: 80px 14px 40px;
    }
}

/* ---------- Print Styles ---------- */
@media print {
    .sticky-nav,
    .print-fab,
    .back-top,
    .hamburger {
        display: none !important;
    }

    body {
        background: #fff;
        color: #111;
        font-size: 11pt;
    }

    body::before {
        display: none;
    }

    .main-container {
        padding: 0;
        max-width: 100%;
    }

    .hero {
        background: #f8f8f8;
        border-color: #333;
        color: #111;
    }

    .hero h1, .hero h1 .gold {
        color: #111;
    }

    .hero-subtitle, .hero-brand {
        color: #444;
    }

    .hero-badge {
        color: #333;
        border-color: #999;
        background: #eee;
    }

    .section-header {
        border-bottom-color: #333;
    }

    .section-number {
        background: #333;
        color: #fff;
    }

    .section-title {
        color: #111;
    }

    .card {
        background: #f9f9f9;
        border-color: #ccc;
        break-inside: avoid;
    }

    .card-title {
        color: #222;
    }

    .instruction-list li {
        background: #f4f4f4;
        border-left-color: #555;
        color: #111;
    }

    .instruction-list li::before {
        background: #555;
        color: #fff;
    }

    .gst-table th {
        background: #eee;
        color: #111;
        border-color: #333;
    }

    .gst-table td {
        color: #111;
        border-color: #ccc;
    }

    .field-item {
        background: #f5f5f5;
        border-color: #ccc;
    }

    .field-name {
        color: #1a7a4a;
    }

    .field-desc {
        color: #333;
    }

    .disclaimer {
        background: #fff5f5;
        border-color: #d00;
    }

    .flowchart-wrapper {
        background: #fff;
        border-color: #333;
    }

    .footer {
        border-top-color: #333;
    }

    .footer-brand {
        color: #111;
    }

    .footer-sub {
        color: #666;
    }
}