/* CSS Custom Properties & Color Themes */
:root, [data-theme="theme-emerald"] {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --primary-light: #d1fae5;
    --accent-color: #0284c7;
    --header-bg: #0f172a;
    --card-hover-border: #10b981;
    --nav-bg: #064e3b;
    --hero-gradient: linear-gradient(135deg, #064e3b 0%, #0f172a 100%);
    --hero-overlay: linear-gradient(120deg, rgba(6, 78, 59, 0.9) 0%, rgba(15, 23, 42, 0.72) 100%);
}

[data-theme="theme-navy"] {
    --primary-color: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #dbeafe;
    --accent-color: #0ea5e9;
    --header-bg: #0f172a;
    --card-hover-border: #1e40af;
    --nav-bg: #1e3a8a;
    --hero-gradient: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    --hero-overlay: linear-gradient(120deg, rgba(30, 58, 138, 0.9) 0%, rgba(15, 23, 42, 0.72) 100%);
}

[data-theme="theme-burgundy"] {
    --primary-color: #9f1239;
    --primary-dark: #881337;
    --primary-light: #ffe4e6;
    --accent-color: #e11d48;
    --header-bg: #18181b;
    --card-hover-border: #9f1239;
    --nav-bg: #881337;
    --hero-gradient: linear-gradient(135deg, #881337 0%, #18181b 100%);
    --hero-overlay: linear-gradient(120deg, rgba(136, 19, 55, 0.9) 0%, rgba(24, 24, 27, 0.76) 100%);
}

body {
    font-family: 'Inter', sans-serif;
    color: #334155;
    background-color: #f8fafc;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

a:hover {
    color: #000;
}

.fs-7 { font-size: 0.875rem; }
.fs-8 { font-size: 0.75rem; }

/* Dynamic Theme Classes */
.bg-theme-primary { background-color: var(--primary-color) !important; color: #ffffff !important; }
.bg-theme-nav { background-color: var(--nav-bg) !important; }
.text-theme-primary { color: var(--primary-color) !important; }
.topbar-social-links a {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    color: #fff;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.topbar-social-links a:hover,
.topbar-social-links a:focus-visible {
    border-color: var(--primary-color);
    color: #fff;
    background-color: var(--primary-color);
}

.btn-theme-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
.btn-theme-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}
.border-theme-primary { border-color: var(--primary-color) !important; }

/* Hover Submenu for Desktop */
@media (min-width: 1200px) {
    .navbar .nav-item.dropdown:hover > .dropdown-menu {
        display: block;
        margin-top: 0;
        animation: fadeIn 0.2s ease-in-out;
    }

    .navbar .dropdown-submenu {
        position: relative;
    }

    .navbar .dropdown-submenu > .dropdown-menu {
        top: 0;
        left: 100%;
        margin-top: -0.5rem;
        max-height: min(60vh, calc(100vh - 26rem));
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .navbar .dropdown-submenu:hover > .dropdown-menu {
        display: block;
    }

    .navbar .dropdown-submenu > .dropdown-toggle::after {
        float: right;
        margin-top: 8px;
        transform: rotate(-90deg);
    }

    /* .navbar-nav > .nav-item:nth-child(5) > .dropdown-menu {
        right: 0;
        left: auto;
    }

    .navbar-nav > .nav-item:nth-child(5) .dropdown-submenu > .dropdown-menu {
        right: 100%;
        left: auto;
    } */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Submenu Styling */
.dropdown-menu {
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
    padding: 0.5rem;
    min-width: 280px;
}

.dropdown-item {
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

@media (max-width: 1199.98px) {
    .navbar .navbar-collapse {
        max-height: 70vh;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .navbar .navbar-nav {
        align-items: stretch;
    }

    .navbar .dropdown-menu {
        max-height: none;
        overflow: visible;
    }

    .navbar .dropdown-submenu > .dropdown-menu {
        margin-left: 0.75rem;
        border-left: 2px solid var(--primary-light);
    }
}

/* Card Hover Elevation */
.hover-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
}

.hover-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.08);
    border-color: var(--card-hover-border);
}

/* Hero Section */
.hero-wrapper {
    background-image: var(--hero-overlay), url("../gst-hero.jpg");
    background-position: center, center 52%;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}

.client-logo-window {
    overflow: hidden;
    padding: 0.5rem 0;
}

.client-logo-track,
.client-logo-set {
    display: flex;
    width: max-content;
}

.client-logo-track {
    animation: client-logo-scroll 55s linear infinite;
}

.client-logo-set {
    flex-shrink: 0;
    align-items: center;
    gap: 1.25rem;
    padding-right: 1.25rem;
}

.client-logo-card {
    display: flex;
    width: 180px;
    height: 100px;
    flex: 0 0 180px;
    align-items: center;
    justify-content: center;
    padding: 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.client-logo-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.client-logo-window:hover .client-logo-track {
    animation-play-state: paused;
}

@keyframes client-logo-scroll {
    to { transform: translateX(-50%); }
}

.theme-switcher-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    transition: transform 0.2s;
}

.theme-switcher-btn:hover, .theme-switcher-btn.active {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* Seamless news ticker */
.news-ticker {
    min-width: 0;
}

.news-ticker-track {
    display: flex;
    width: max-content;
    animation: news-ticker-scroll 60s linear infinite;
}

.news-ticker-content {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    white-space: nowrap;
    padding-right: 3rem;
}

.news-ticker-content > span {
    flex-shrink: 0;
}

.news-update-item {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
}

.cbic-resource-card {
    min-height: 150px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cbic-resource-card:hover {
    transform: translateY(-3px);
    border-color: #cbd5e1;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.cbic-resource-icon {
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    font-size: 1.25rem;
}

.cbic-resource-card h6 {
    font-size: 0.95rem;
    line-height: 1.45;
}

.law-card {
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.law-card-header {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0 !important;
}

.law-card-header h5 {
    color: #0f172a;
}

.law-card-header small {
    color: #64748b;
    font-size: 0.75rem;
}

.law-card-cgst { border-top: 3px solid #2563eb; }
.law-card-cgst .law-card-header i { color: #2563eb; }
.law-card-utgst { border-top: 3px solid #16a34a; }
.law-card-utgst .law-card-header i { color: #16a34a; }
.law-card-igst { border-top: 3px solid #e11d48; }
.law-card-igst .law-card-header i { color: #e11d48; }
.law-card-other { border-top: 3px solid #475569; }
.law-card-other .law-card-header i { color: #475569; }

.law-card .card-body {
    padding: 0.5rem 1rem 1rem;
}

.law-card .card-body li {
    line-height: 1.5;
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

.gst-booklet-card,
.due-dates-card {
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.gst-booklet-card {
    max-width: 380px;
}

.due-dates-section .gst-booklet-card,
.due-dates-section .due-dates-card {
    height: 480px;
}

.due-dates-card {
    display: flex;
    flex-direction: column;
}

.due-dates-card .table-responsive {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
}

.gst-booklet-cover {
    color: #fff;
    background: var(--hero-gradient);
}

.gst-booklet-cover .badge {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.65rem;
    letter-spacing: 0.08em;
}

.gst-booklet-mark {
    display: flex;
    width: 52px;
    height: 52px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.14);
    font-size: 1.5rem;
}

.gst-booklet-cover p {
    color: rgba(255, 255, 255, 0.8);
}

.gst-booklet-card .card-body {
    min-height: 220px;
}

@media (min-width: 992px) {
    .gst-booklet-cover {
        padding: 1.5rem !important;
    }

    .gst-booklet-mark {
        width: 46px;
        height: 46px;
        margin-bottom: 0.75rem !important;
        font-size: 1.3rem;
    }

    .gst-booklet-card .card-body {
        min-height: 205px;
        padding: 1.5rem !important;
    }
}

.due-dates-header {
    color: #0f172a;
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.due-dates-header p {
    color: #64748b;
    font-size: 0.8rem;
}

.due-dates-header-icon {
    display: flex;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 0.8rem;
    color: var(--primary-dark);
    background-color: var(--primary-light);
    font-size: 1.2rem;
}

.due-dates-table {
    color: #334155;
    font-size: 0.875rem;
}

.due-dates-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: #475569;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.due-dates-table tbody td {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
    border-color: #edf1f5;
    font-weight: 500;
}

.due-dates-table tbody td:last-child {
    color: #1e293b;
}

.due-date-pill {
    display: inline-block;
    padding: 0.4rem 0.7rem;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    color: #1e40af;
    background-color: #eff6ff;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.due-date-urgent {
    border-color: #fecaca;
    color: #b91c1c;
    background-color: #fef2f2;
}

@media (max-width: 575.98px) {
    .due-dates-header {
        padding-right: 1rem !important;
        padding-left: 1rem !important;
    }

    .due-dates-table {
        font-size: 0.8rem;
    }

    .due-dates-table th:first-child,
    .due-dates-table td:first-child {
        padding-left: 0.75rem !important;
    }

    .due-dates-table th:last-child,
    .due-dates-table td:last-child {
        padding-right: 0.75rem !important;
    }

    .due-date-pill {
        padding: 0.35rem 0.5rem;
        font-size: 0.72rem;
    }
}

.news-ticker:hover .news-ticker-track,
.news-ticker:focus-within .news-ticker-track {
    animation-play-state: paused;
}

@keyframes news-ticker-scroll {
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .news-ticker {
        overflow: visible !important;
    }

    .news-ticker-track {
        animation: none;
        transform: none;
        width: 100%;
    }

    .news-ticker-content {
        display: block;
        white-space: normal;
    }

    .news-ticker-content[aria-hidden="true"] {
        display: none;
    }

    .client-logo-window {
        overflow: visible;
    }

    .client-logo-track {
        width: 100%;
        animation: none;
        transform: none;
    }

    .client-logo-set {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0 1rem;
    }

    .client-logo-set[aria-hidden="true"] {
        display: none;
    }
}

.bg-grd {
    background: linear-gradient(90deg, #086a4f, #194237, #086a4f);
}