/* ============================================
   TestIQ - Main Stylesheet
   India's #1 Mock Test Marketplace
   ============================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --success: #059669;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* Base */
* { box-sizing: border-box; }
body {
    font-family: var(--font-family);
    color: var(--gray-800);
    line-height: 1.6;
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: all 0.2s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* Top Bar */
.top-bar {
    background: var(--secondary);
    padding: 8px 0;
    font-size: 13px;
    color: var(--gray-400);
}
.top-bar a { color: var(--gray-400); }
.top-bar a:hover { color: #fff; }

/* Navbar */
.navbar {
    padding: 12px 0;
    z-index: 1030;
    position: relative; /* anchor for mega menu */
}
.navbar > .container {
    position: relative; /* mega menu positions relative to this */
}
.brand-text {
    font-size: 28px;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: -1px;
    line-height: 1;
}
.navbar-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
}
.navbar-partner-sep {
    color: #cbd5e1;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    margin: 0 2px;
    user-select: none;
}
@media (max-width: 576px) {
    .navbar-logo-img { height: 32px; }
    .brand-text { font-size: 22px; }
}
.nav-link {
    font-weight: 500;
    color: var(--gray-700) !important;
    padding: 8px 16px !important;
    border-radius: 6px;
    transition: all 0.2s;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary) !important;
    background: var(--primary-light);
}

/* ── Mega Menu ─────────────────────────────────────────────────────────────── */

/* Make navbar container the positioning context */
.navbar > .container,
.navbar > .container-fluid {
    position: relative;
}

/* The dropdown li must be static so the menu spans full navbar width */
.mega-dropdown {
    position: static !important;
}

/* Override Bootstrap dropdown-menu completely */
.mega-menu.dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    margin-top: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-top: 3px solid var(--primary) !important;
    border-radius: 0 0 12px 12px !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.14) !important;
    z-index: 1050 !important;
    max-height: 72vh;
    overflow-y: auto;
    background: #fff;
}

/* 5-column grid inside the menu */
.mega-menu-inner {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
}

/* Each category column */
.mega-col {
    padding: 18px 16px 14px;
    border-right: 1px solid #f1f5f9;
    min-width: 0; /* allow text-overflow to work */
}
.mega-col:last-child { border-right: none; }

/* Column header — category name */
.mega-col-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mega-col-header i {
    font-size: 11px;
    flex-shrink: 0;
    color: var(--primary);
}

/* Sub-category group */
.mega-sub-group { margin-bottom: 8px; }

.mega-sub-title {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    padding: 3px 0 2px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}
.mega-sub-title:hover { color: var(--primary); }

.mega-exam-link {
    display: block;
    font-size: 11px;
    color: #64748b;
    padding: 2px 0 2px 10px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    line-height: 1.5;
}
.mega-exam-link:hover {
    color: var(--primary);
    border-left-color: var(--primary);
}

.mega-view-all {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    margin-top: 8px;
    padding: 3px 10px;
    background: var(--primary-light);
    border-radius: 20px;
    transition: all 0.15s;
}
.mega-view-all:hover {
    background: var(--primary);
    color: #fff;
}

/* Responsive: tablet → 3 cols, mobile → collapse into accordion */
@media (max-width: 1199px) {
    .mega-menu-inner { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 991px) {
    .mega-menu.dropdown-menu {
        position: static !important;
        box-shadow: none !important;
        border: none !important;
        border-top: 2px solid var(--primary-light) !important;
        border-radius: 0 !important;
        max-height: none;
        overflow-y: visible;
    }
    .mega-menu-inner { grid-template-columns: repeat(2, 1fr); }
    .mega-col { border-right: none; border-bottom: 1px solid #f1f5f9; }
}
@media (max-width: 575px) {
    .mega-menu-inner { grid-template-columns: 1fr; }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.05)" d="M0,96L48,112C96,128,192,160,288,186.7C384,213,480,235,576,213.3C672,192,768,128,864,128C960,128,1056,192,1152,208C1248,224,1344,192,1392,176L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
}
.hero-section h1 {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}
.hero-section p { color: rgba(255,255,255,0.85); font-size: 1.15rem; }
.hero-stats {
    display: flex;
    gap: 40px;
    margin-top: 30px;
}
.hero-stat {
    text-align: center;
}
.hero-stat .number {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
}
.hero-stat .label {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Section Styles */
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 8px;
}
.section-subtitle {
    color: var(--gray-500);
    font-size: 1rem;
}

/* Category Cards */
.category-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.category-card .icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    color: var(--primary);
}
.category-card h5 {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--secondary);
}
.category-card p {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 0;
}

/* Exam Cards */
.exam-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.exam-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.exam-card > div:first-child img {
    transition: transform 0.4s ease;
}
.exam-card:hover > div:first-child img {
    transform: scale(1.04);
}
.exam-card .card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}
.exam-card .card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.exam-card .exam-category {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.exam-card h5 {
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 10px;
    line-height: 1.3;
}
.exam-card .exam-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 16px;
}
.exam-card .exam-meta span i { margin-right: 4px; }
.exam-card .card-footer {
    padding: 16px 20px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.exam-card .price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success);
}
.exam-card .price .original {
    font-size: 0.85rem;
    color: var(--gray-400);
    text-decoration: line-through;
    margin-left: 6px;
    font-weight: 400;
}

/* Pricing Cards */
.pricing-card {
    background: #fff;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}
.pricing-card.popular {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}
.pricing-card.popular::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 16px;
    border-radius: 20px;
}
.pricing-card .duration {
    font-size: 14px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.pricing-card .price-amount {
    font-size: 3rem;
    font-weight: 800;
    color: var(--secondary);
    margin: 16px 0;
}
.pricing-card .price-amount small {
    font-size: 1rem;
    color: var(--gray-400);
    font-weight: 400;
}
.pricing-card .original-price {
    text-decoration: line-through;
    color: var(--gray-400);
    font-size: 1.1rem;
}
.pricing-card .discount-badge {
    display: inline-block;
    background: #dcfce7;
    color: var(--success);
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 20px;
}
.pricing-card .features {
    list-style: none;
    padding: 0;
    margin: 24px 0;
    text-align: left;
}
.pricing-card .features li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-100);
}
.pricing-card .features li i {
    color: var(--success);
    margin-right: 8px;
    width: 16px;
}

/* Blog Cards */
.blog-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}
.blog-card:hover {
    box-shadow: var(--shadow-md);
}
.blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.blog-card .card-body { padding: 20px; }
.blog-card .blog-category {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
}
.blog-card h5 {
    font-weight: 600;
    margin: 8px 0;
    line-height: 1.4;
}
.blog-card .blog-meta {
    font-size: 13px;
    color: var(--gray-500);
}

/* Newsletter */
.newsletter-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

/* Footer */
.site-footer {
    background: var(--secondary);
    padding: 60px 0 0;
    color: var(--gray-400);
}
.footer-brand {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
}
.footer-desc {
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.7;
}
.footer-title {
    color: #fff;
    font-weight: 600;
    margin-bottom: 16px;
    font-size: 15px;
}
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links li { margin-bottom: 10px; }
.footer-links a {
    color: var(--gray-400);
    font-size: 14px;
    transition: all 0.2s;
}
.footer-links a:hover { color: #fff; padding-left: 4px; }
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: var(--gray-400);
    margin-right: 8px;
    transition: all 0.2s;
}
.social-links a:hover {
    background: var(--primary);
    color: #fff;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    margin-top: 40px;
    font-size: 14px;
}
.payment-icons { height: 28px; opacity: 0.7; }

/* Cookie Consent */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--secondary);
    padding: 16px 0;
    z-index: 9999;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-2px); }
.back-to-top.show { display: flex; }

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
    font-size: 14px;
}
.breadcrumb-item a { color: var(--gray-500); }
.breadcrumb-item.active { color: var(--gray-700); }

/* Tabs (Exam Detail) */
.exam-tabs .nav-link {
    color: var(--gray-600);
    font-weight: 500;
    padding: 12px 20px;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: none;
}
.exam-tabs .nav-link:hover { color: var(--primary); }
.exam-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: none;
}

/* Ad Zones */
.ad-zone {
    margin: 20px 0;
    text-align: center;
    min-height: 90px;
}

/* Content area float image — responsive */
.content-area img[style*="float:right"] {
    float: right;
}
@media (max-width: 576px) {
    .content-area img[style*="float:right"] {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 200px !important;
        margin: 0 0 16px 0 !important;
        display: block;
    }
}

/* Exam Rating */
.exam-rating {
    font-size: 13px;
}
.exam-rating .fa-star, .exam-rating .fa-star-half-alt {
    font-size: 12px;
}

/* Duration Tabs */
.duration-tabs .btn, .dur-tab-group .btn {
    border-radius: 20px !important;
    font-weight: 500;
    font-size: 14px;
    margin: 0 4px;
}
.dur-tab-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}
.dur-tab-group .btn {
    margin: 0;
}
/* Sidebar pricing tabs — no wrap, smaller */
.card .dur-tab-group {
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
}
.card .dur-tab-group .btn {
    font-size: 11px !important;
    padding: 3px 8px !important;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .dur-tab-group .btn {
        padding: 6px 14px !important;
        font-size: 13px !important;
    }
}

/* Pagination */
.pagination .page-link {
    border-radius: 6px;
    margin: 0 3px;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    font-weight: 500;
    padding: 8px 14px;
}
.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* Hero 50/50 split — image left, content right */
@media (max-width: 767px) {
    .row.g-0 [class*="col-lg-5"],
    .row.g-0 [class*="col-md-5"] {
        min-height: 200px !important;
    }
}
    .hero-section { padding: 50px 0; }
    .hero-section h1 { font-size: 2rem; }
    .hero-stats { gap: 20px; }
    .pricing-card.popular { transform: none; }
}
@media (max-width: 767px) {
    .hero-stats { flex-wrap: wrap; gap: 16px; }
    .hero-stat .number { font-size: 1.5rem; }
    .section-title { font-size: 1.4rem; }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.bg-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232563eb' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}
.lazy-load.loaded { opacity: 1; }
