/* 
* Premium Bootstrap 5 Theme for JEE Main Platform
* Uses CSS Variables for easy customization
*/

:root {
    /* Brand Colors */
    --primary-color: #2563eb;
    /* Preplor Royal Blue */
    --primary-hover: #1d4ed8;
    /* Preplor Dark Royal Blue */
    --secondary-color: #f59e0b;
    /* Amber-500 */
    --secondary-hover: #d97706;
    /* Amber-600 */

    /* UI Colors */
    --background-color: #f3f4f6;
    /* Gray-100 */
    --card-bg: #ffffff;
    --text-main: #111827;
    /* Gray-900 */
    --text-muted: #6b7280;
    /* Gray-500 */
    --border-color: #e5e7eb;
    /* Gray-200 */

    /* Status Colors */
    --success: #10b981;
    /* Emerald-500 */
    --danger: #ef4444;
    /* Red-500 */
    --warning: #f59e0b;
    /* Amber-500 */
    --info: #3b82f6;
    /* Blue-500 */

    /* Dimensions */
    --border-radius: 1rem;
    /* 16px */
    --border-radius-sm: 0.5rem;
    /* 8px */
    --navbar-height: 70px;

    /* Effects */
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography Tweaks */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

/* Ensure headings with text-white or inside dark containers always render in pure white */
h1.text-white,
h2.text-white,
h3.text-white,
h4.text-white,
h5.text-white,
h6.text-white,
.text-white > h1,
.text-white > h2,
.text-white > h3,
.text-white > h4,
.text-white > h5,
.text-white > h6,
.text-white h1,
.text-white h2,
.text-white h3,
.text-white h4,
.text-white h5,
.text-white h6,
.bg-primary h1, .bg-primary h2, .bg-primary h3, .bg-primary h4, .bg-primary h5, .bg-primary h6,
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6,
.checkout-header h1, .checkout-header h2, .checkout-header h3, .checkout-header h4, .checkout-header h5, .checkout-header h6,
.series-banner h1, .series-banner h2, .series-banner h3, .series-banner h4, .series-banner h5, .series-banner h6 {
    color: #ffffff !important;
}

/* Card Overrides */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Button Overrides */
.btn {
    border-radius: var(--border-radius-sm);
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-transform: capitalize;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
    background-color: #ffffff;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    color: var(--text-main);
}

/* Navbar Customization */
.navbar {
    background-color: var(--card-bg);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    min-height: var(--navbar-height);
    height: auto;
    padding: 0.5rem 1rem;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted) !important;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

/* Stats Card Specifics */
.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 1.5rem;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-hover);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0.5rem 0 1rem 0;
}

/* Legacy Utility Classes (kept for compatibility during migration) */
.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-success {
    color: var(--success) !important;
}

/* Dashboard Grid Wrapper */
.dashboard-container {
    padding: 2rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Test Card Styles */
.test-card {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: var(--box-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid transparent;
}

.test-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-4px);
}

.test-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.test-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    text-transform: uppercase;
}

/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 450px;
    width: 100%;
    border-radius: 1.5rem;
}

/* Table Styling */
.table thead th {
    background-color: #f9fafb;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom-width: 1px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* MathJax Textbook Rendering Tweaks */
mjx-container, mjx-math, mjx-mrow, mjx-container[jax="CHTML"][display="true"], mjx-container[jax="CHTML"]:not([display="true"]) {
    max-width: 100%;
    color: #1f2937;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

mjx-container[jax="CHTML"][display="true"] {
    margin: 1.25em 0 !important;
    padding: 0.25em 0;
}

mjx-container[jax="CHTML"]:not([display="true"]) {
    font-size: 1.05em;
    line-height: 1.6;
}

mjx-mspace {
    white-space: normal !important;
}

mjx-text {
    white-space: normal !important;
}

/* ── Free Trial System & Modern UI/UX Components ─────────── */
.trial-hero-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    border-radius: 20px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.trial-hero-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.trial-hero-card::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -10%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.glass-pill {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 50px;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Shimmer Button Animation */
.btn-shimmer {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border: none;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
    transition: all 0.3s ease;
}

.btn-shimmer:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(245, 158, 11, 0.5);
    color: #ffffff;
}

.btn-shimmer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(25deg);
    animation: shimmerSweep 3s infinite;
}

@keyframes shimmerSweep {
    0% { left: -60%; }
    30% { left: 140%; }
    100% { left: 140%; }
}

/* Live Pulsing Badge */
.badge-pulse {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-pulse .pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    position: relative;
}

.badge-pulse .pulse-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #ef4444;
    animation: pulseRing 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulseRing {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* Timer Digits Styling */
.countdown-box {
    display: flex;
    align-items: center;
    gap: 6px;
}

.countdown-box .timer-unit {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 6px 10px;
    text-align: center;
    min-width: 44px;
}

.countdown-box .timer-num {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fbbf24;
    line-height: 1;
    font-family: 'Outfit', monospace;
}

.countdown-box .timer-lbl {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    margin-top: 2px;
}

/* Active Trial Status Bar */
.trial-active-bar {
    background: linear-gradient(90deg, #1e1b4b 0%, #312e81 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    padding: 18px 24px;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.trial-progress-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    overflow: hidden;
}

.trial-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #3b82f6 100%);
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Locked Card Overlay */
.test-card-locked {
    position: relative;
    overflow: hidden;
    filter: grayscale(0.2);
}

.test-card-locked::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    z-index: 5;
    border-radius: var(--border-radius);
}

.locked-overlay-content {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

/* High Contrast Navigation Bar Styling */
.blog-nav {
    background: #0f172a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    padding: 14px 0 !important;
}

.blog-nav .navbar-nav .nav-link {
    color: #f1f5f9 !important;
    font-size: 0.98rem !important;
    font-weight: 500 !important;
    padding: 8px 16px !important;
    transition: all 0.2s ease-in-out !important;
    opacity: 0.95 !important;
}

.blog-nav .navbar-nav .nav-link:hover,
.blog-nav .navbar-nav .nav-link:focus {
    color: #38bdf8 !important;
    opacity: 1 !important;
    transform: translateY(-1px);
}

.blog-nav .navbar-nav .nav-link.active {
    color: #38bdf8 !important;
    font-weight: 700 !important;
    opacity: 1 !important;
    background: rgba(56, 189, 248, 0.12) !important;
    border-radius: 20px !important;
    padding: 8px 18px !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
}

.blog-nav .btn-signin-nav {
    color: #ffffff !important;
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    font-weight: 600 !important;
    padding: 8px 24px !important;
    border-radius: 30px !important;
    transition: all 0.25s ease-in-out !important;
    text-decoration: none !important;
    display: inline-block !important;
}

.blog-nav .btn-signin-nav:hover {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.25) !important;
}
