/* =============================================
   CourseHub — Premium Dark Glassmorphism Theme
   ============================================= */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Kantumruy+Pro:ital,wght@0,300..700;1,300..700&display=swap');

/* --- CSS Custom Properties --- */
:root {
    /* Colors */
    --bg-primary: #0a1628;
    --bg-secondary: #0f1d32;
    --bg-card: rgba(15, 29, 50, 0.6);
    --bg-card-hover: rgba(20, 40, 70, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-strong: rgba(255, 255, 255, 0.1);

    --blue-500: #3b82f6;
    --blue-400: #60a5fa;
    --blue-600: #2563eb;
    --cyan-500: #06b6d4;
    --cyan-400: #22d3ee;
    --green-500: #10b981;
    --green-400: #34d399;
    --red-500: #ef4444;
    --red-400: #f87171;
    --yellow-500: #f59e0b;
    --yellow-400: #fbbf24;
    --purple-500: #8b5cf6;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #60a5fa;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(59, 130, 246, 0.3);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #3b82f6, #06b6d4);
    --gradient-card: linear-gradient(145deg, rgba(15, 29, 50, 0.8), rgba(10, 22, 40, 0.6));
    --gradient-hero: linear-gradient(135deg, #0a1628 0%, #1a2940 40%, #0f2847 100%);
    --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);
    --gradient-danger: linear-gradient(135deg, #ef4444, #f97316);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.15);
    --shadow-glow-cyan: 0 0 30px rgba(6, 182, 212, 0.15);

    /* Spacing & Sizing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Kantumruy Pro', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--text-accent);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--cyan-400);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Animated Background --- */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 80%, rgba(139, 92, 246, 0.04) 0%, transparent 50%);
    animation: bgShift 20s ease-in-out infinite alternate;
    z-index: -1;
    pointer-events: none;
}

@keyframes bgShift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-5%, -5%) rotate(3deg); }
}

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-sm {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-md {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===========================================
   NAVIGATION
   =========================================== */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.navbar-brand svg {
    width: 32px;
    height: 32px;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.navbar-links a {
    padding: 8px 18px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.navbar-links a:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.navbar-links a.active {
    color: var(--blue-400);
    background: rgba(59, 130, 246, 0.1);
}

.btn-nav {
    padding: 8px 20px !important;
    background: var(--gradient-primary) !important;
    color: #fff !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
}

.btn-nav:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ===========================================
   HERO SECTION
   =========================================== */

.hero {
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--blue-400);
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero h1 .gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 48px;
}

.hero-stat {
    text-align: center;
}

.hero-stat .number {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-stat .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===========================================
   GLASSMORPHISM CARDS
   =========================================== */

.glass-card {
    background: var(--gradient-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

/* ===========================================
   COURSE GRID
   =========================================== */

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.courses-section {
    padding: 60px 0 80px;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
}

.course-card {
    display: flex;
    flex-direction: column;
}

.course-card .card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a2940, #0f2847);
}

.course-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.course-card:hover .card-image img {
    transform: scale(1.05);
}

.course-card .card-image .placeholder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 3rem;
    color: var(--text-muted);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.1));
}

.course-card .price-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 14px;
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-accent);
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--cyan-400);
}

.course-card .card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-card .card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--text-primary);
}

.course-card .card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 20px;
}

.course-card .card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ===========================================
   BUTTONS
   =========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.35);
    color: #fff;
}

.btn-success {
    background: var(--gradient-success);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.35);
    color: #fff;
}

.btn-danger {
    background: var(--gradient-danger);
    color: #fff;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--blue-500);
    color: var(--blue-400);
    background: rgba(59, 130, 246, 0.05);
}

.btn-ghost {
    background: var(--bg-glass);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: var(--bg-glass-strong);
    color: var(--text-primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 16px 40px;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ===========================================
   FORMS
   =========================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--blue-500);
}

/* ===========================================
   PAYMENT / QR PAGE
   =========================================== */

.payment-page {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.payment-card {
    width: 100%;
    max-width: 480px;
    text-align: center;
    padding: 40px 32px;
}

.payment-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.payment-card .subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.qr-wrapper {
    display: inline-block;
    padding: 20px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    margin: 24px 0;
    box-shadow: var(--shadow-md);
}

.qr-wrapper canvas,
.qr-wrapper img {
    display: block;
}

.payment-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 24px 0;
}

.payment-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
}

.payment-info-row .label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.payment-info-row .value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Countdown Timer */
.countdown {
    margin: 24px 0;
}

.countdown-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.countdown-timer {
    font-size: 2.5rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.countdown-timer.expired {
    background: var(--gradient-danger);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Payment Status */
.payment-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 600;
    margin: 20px 0;
}

.payment-status.checking {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-400);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.payment-status.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green-400);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.payment-status.expired {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red-400);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Pulse animation for checking */
.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--blue-400);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

.payment-status.success .pulse-dot {
    background: var(--green-400);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ===========================================
   SUCCESS PAGE
   =========================================== */

.success-page {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.success-card {
    text-align: center;
    max-width: 520px;
    width: 100%;
    padding: 48px 36px;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: var(--gradient-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.success-icon svg {
    width: 40px;
    height: 40px;
    color: #fff;
}

.success-card h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.success-card .subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.telegram-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 36px;
    background: linear-gradient(135deg, #0088cc, #00a8e8);
    color: #fff;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(0, 136, 204, 0.3);
}

.telegram-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 136, 204, 0.4);
    color: #fff;
}

.telegram-btn svg {
    width: 24px;
    height: 24px;
}

/* ===========================================
   CHECKOUT PAGE
   =========================================== */

.checkout-page {
    padding: 40px 24px;
    min-height: calc(100vh - 70px);
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    max-width: 900px;
    margin: 0 auto;
}

.checkout-form-card {
    padding: 36px;
}

.checkout-summary-card {
    padding: 28px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.checkout-summary-card .course-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.checkout-summary-card .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.checkout-summary-card .summary-row:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--cyan-400);
}

.checkout-summary-card .summary-row .label {
    color: var(--text-secondary);
}

/* ===========================================
   COURSE DETAIL PAGE
   =========================================== */

.course-detail {
    padding: 40px 0 80px;
}

.course-detail-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 40px;
}

.course-detail .course-image {
    width: 100%;
    height: 400px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(135deg, #1a2940, #0f2847);
    margin-bottom: 32px;
}

.course-detail .course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-detail .course-image .placeholder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 4rem;
    color: var(--text-muted);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.1));
}

.course-detail h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.3;
}

.course-detail .description {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    white-space: pre-line;
}

.purchase-card {
    padding: 32px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.purchase-card .price {
    font-size: 2.5rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.purchase-card .price-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.purchase-card .features {
    list-style: none;
    margin-bottom: 28px;
}

.purchase-card .features li {
    padding: 8px 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.purchase-card .features li::before {
    content: '✓';
    color: var(--green-400);
    font-weight: 700;
}

/* ===========================================
   ADMIN PANEL
   =========================================== */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 24px 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.admin-sidebar .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.admin-sidebar .sidebar-brand .icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.admin-sidebar .nav-item:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.admin-sidebar .nav-item.active {
    background: rgba(59, 130, 246, 0.08);
    color: var(--blue-400);
    border-left-color: var(--blue-500);
}

.admin-sidebar .nav-item svg {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.admin-sidebar .nav-item.active svg {
    opacity: 1;
}

.admin-sidebar .sidebar-section {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 20px 24px 8px;
    font-weight: 600;
}

.admin-main {
    margin-left: 260px;
    flex: 1;
    padding: 32px;
    min-height: 100vh;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.admin-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
}

.admin-header .breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card .stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--blue-400); }
.stat-card .stat-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--green-400); }
.stat-card .stat-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--cyan-400); }
.stat-card .stat-icon.yellow { background: rgba(245, 158, 11, 0.15); color: var(--yellow-400); }
.stat-card .stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--purple-500); }

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Admin Tables */
.admin-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead th {
    padding: 14px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
}

.admin-table tbody td {
    padding: 14px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.admin-table tbody tr:hover {
    background: var(--bg-glass);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--yellow-400);
}

.badge-completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--green-400);
}

.badge-expired {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red-400);
}

.badge-failed {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red-400);
}

.badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--green-400);
}

.badge-inactive {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-muted);
}

/* ===========================================
   LOGIN PAGE
   =========================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 36px;
    text-align: center;
}

.login-card h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.login-card .subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.login-card .form-group {
    text-align: left;
}

/* ===========================================
   ALERTS / FLASH MESSAGES
   =========================================== */

.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

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

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--green-400);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--red-400);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--blue-400);
}

/* ===========================================
   FOOTER
   =========================================== */

.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer a {
    color: var(--text-secondary);
}

.footer a:hover {
    color: var(--blue-400);
}

/* ===========================================
   UTILITY CLASSES
   =========================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--text-accent); }
.text-success { color: var(--green-400); }
.text-danger { color: var(--red-400); }
.text-warning { color: var(--yellow-400); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.d-flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===========================================
   RESPONSIVE
   =========================================== */

@media (max-width: 1024px) {
    .course-detail-grid {
        grid-template-columns: 1fr;
    }

    .purchase-card {
        position: static;
    }

    .checkout-grid {
        grid-template-columns: 1fr;
    }

    .checkout-summary-card {
        position: static;
    }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }

    .hero-stats {
        gap: 24px;
        flex-wrap: wrap;
    }

    .course-grid {
        grid-template-columns: 1fr;
    }

    .navbar-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(10, 22, 40, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border-color);
    }

    .navbar-links.open {
        display: flex;
    }

    .navbar-links a {
        width: 100%;
        padding: 12px 18px;
    }

    .menu-toggle {
        display: flex;
    }

    /* Admin responsive */
    .admin-sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
        padding: 20px 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .payment-card {
        padding: 28px 20px;
    }

    .success-card {
        padding: 32px 20px;
    }

    .countdown-timer {
        font-size: 2rem;
    }
}

/* ===========================================
   SCROLLBAR
   =========================================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-glass-strong);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ===========================================
   ANIMATIONS
   =========================================== */

.fade-in {
    animation: fadeIn 0.5s ease;
}

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

.slide-up {
    animation: slideUp 0.5s ease;
}

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

/* Staggered card animation */
.course-card:nth-child(1) { animation-delay: 0.05s; }
.course-card:nth-child(2) { animation-delay: 0.1s; }
.course-card:nth-child(3) { animation-delay: 0.15s; }
.course-card:nth-child(4) { animation-delay: 0.2s; }
.course-card:nth-child(5) { animation-delay: 0.25s; }
.course-card:nth-child(6) { animation-delay: 0.3s; }

.course-card {
    animation: fadeIn 0.5s ease both;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-glass) 25%, var(--bg-glass-strong) 50%, var(--bg-glass) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Responsive Video Player --- */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: #000;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- KHQR Receipt Card (ABA/Bakong style) --- */
.khqr-receipt-card {
    background: #ffffff;
    border-radius: 20px; /* reduced from 24px */
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 300px; /* reduced from 340px */
    margin: 0 auto 16px; /* reduced from 24px */
    text-align: left;
    color: #333333;
}

.khqr-receipt-header {
    background: #e11d48; /* Red header color */
    padding: 12px 20px; /* reduced from 16px 24px */
    text-align: center;
    position: relative;
}

.khqr-receipt-header::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 10px 0 0;
    border-color: #e11d48 transparent transparent transparent;
}

.khqr-logo-text {
    color: #ffffff;
    font-size: 1.2rem; /* reduced from 1.4rem */
    font-weight: 800;
    letter-spacing: 1px;
    font-family: 'Inter', sans-serif;
}

.khqr-receipt-body {
    padding: 18px 20px 10px; /* reduced from 24px 28px 16px */
}

.khqr-merchant-name {
    font-size: 0.75rem; /* reduced from 0.8rem */
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.khqr-amount-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.khqr-amount-value {
    font-size: 1.6rem; /* reduced from 2rem */
    font-weight: 800;
    color: #0f172a;
    font-family: 'Inter', sans-serif;
}

.khqr-currency-code {
    font-size: 0.85rem; /* reduced from 0.95rem */
    font-weight: 700;
    color: #475569;
}

.khqr-receipt-separator {
    border-top: 2px dashed #cbd5e1;
    margin: 6px 12px; /* reduced from 8px 16px */
    height: 1px;
}

.khqr-receipt-qr-section {
    padding: 10px 20px 20px; /* reduced from 16px 28px 28px */
    text-align: center;
}

.qr-container {
    position: relative;
    display: inline-block;
    padding: 10px;
    background: #ffffff;
    border-radius: 12px;
}

/* Make sure container canvas is centered and styled nicely */
.qr-container canvas,
.qr-container img {
    margin: 0 auto;
    max-width: 100%;
}

.qr-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px; /* reduced from 38px */
    height: 32px; /* reduced from 38px */
    background: #0f172a; /* Dark background like ABA style */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid #ffffff; /* reduced from 3.5px */
    color: #ffffff;
    font-weight: 800;
    font-size: 0.95rem; /* reduced from 1.15rem */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    font-family: 'Kantumruy Pro', 'Inter', sans-serif;
}

/* ===========================================
   CUSTOM MODAL STYLING
   =========================================== */
.custom-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000; /* Ensure it is above other elements */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal-overlay.open {
    display: flex;
    opacity: 1;
}

.custom-modal-content {
    position: relative;
    width: 100%;
    max-width: 340px; /* reduced from 380px */
    margin: 16px;
    padding: 16px; /* reduced from 24px */
    background: #0a1628; /* Same background color as theme */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal-overlay.open .custom-modal-content {
    transform: scale(1);
}

.custom-modal-close {
    position: absolute;
    top: 24px; /* positioned to overlap receipt header cleanly */
    right: 28px;
    background: rgba(0, 0, 0, 0.25);
    border: none;
    color: #ffffff;
    font-size: 1rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: var(--transition-fast);
}

.custom-modal-close:hover {
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
}

/* Modal States */
.modal-loading-view,
.modal-error-view,
.modal-success-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 10px;
    text-align: center;
}

.modal-spinner {
    width: 40px; /* reduced from 48px */
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--cyan-400);
    animation: modalSpin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes modalSpin {
    to { transform: rotate(360deg); }
}

.modal-error-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--red-400);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--red-400);
    font-size: 1.6rem;
    margin-bottom: 16px;
}

.modal-success-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--green-400);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-400);
    font-size: 1.6rem;
    margin-bottom: 16px;
}

.custom-modal-btn {
    display: inline-block;
    width: 100%;
    padding: 10px 20px; /* reduced padding */
    background: var(--gradient-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 12px;
    transition: var(--transition-fast);
    text-align: center;
}

.custom-modal-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.custom-modal-btn.telegram-btn {
    background: linear-gradient(135deg, #0088cc, #00a2ed);
}

.custom-modal-btn.tool-btn {
    background: var(--gradient-success);
}

/* --- Infinite Scroll Banner --- */
.scroll-banner-container {
    width: 100%;
    overflow: hidden;
    background: rgba(10, 22, 40, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px 0;
    margin: 20px 0 40px;
    position: relative;
}

/* Gradient overlays to fade in/out edges */
.scroll-banner-container::before,
.scroll-banner-container::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100px;
    z-index: 2;
    pointer-events: none;
}

.scroll-banner-container::before {
    left: 0;
    background: linear-gradient(to right, #0a1628, transparent);
}

.scroll-banner-container::after {
    right: 0;
    background: linear-gradient(to left, #0a1628, transparent);
}

.scroll-banner-track {
    display: flex;
    width: max-content;
    animation: infiniteScroll 25s linear infinite;
    gap: 40px;
    padding-left: 20px;
}

.scroll-banner-track:hover {
    animation-play-state: paused;
}

@keyframes infiniteScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.scroll-banner-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 50px;
    transition: var(--transition-fast);
}

.scroll-banner-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(59, 130, 246, 0.3);
    transform: scale(1.03);
}

/* Bank Dot Colors & Gradients */
.bank-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px currentColor;
}

.bank-dot.khqr {
    background: linear-gradient(135deg, #ef4444, #3b82f6, #fbbf24, #10b981);
    color: rgba(59, 130, 246, 0.6);
}

.bank-dot.bakong {
    background: linear-gradient(135deg, #e11d48, #9f1239);
    color: rgba(225, 29, 72, 0.6);
}

.bank-dot.aba {
    background: linear-gradient(135deg, #005a9c, #0087cd);
    color: rgba(0, 135, 205, 0.6);
}

.bank-dot.acleda {
    background: linear-gradient(135deg, #c7a13c, #0f406e);
    color: rgba(199, 161, 60, 0.6);
}

.bank-dot.canadia {
    background: linear-gradient(135deg, #e31b23, #ffc61a);
    color: rgba(227, 27, 35, 0.6);
}

.bank-dot.wing {
    background: linear-gradient(135deg, #84bd00, #5c8b00);
    color: rgba(132, 189, 0, 0.6);
}

.bank-dot.sathapana {
    background: linear-gradient(135deg, #1b4d3e, #cfaf3c);
    color: rgba(27, 77, 62, 0.6);
}

.bank-dot.prince {
    background: linear-gradient(135deg, #512d6d, #f68b1f);
    color: rgba(81, 45, 109, 0.6);
}

/* --- Navbar Search Styling --- */
.navbar-search {
    flex: 1;
    max-width: 320px;
    margin: 0 20px;
    position: relative;
    display: block;
}

.navbar-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}

.navbar-search input:focus {
    border-color: var(--blue-500) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2) !important;
}

@media (max-width: 768px) {
    .navbar-search {
        max-width: 200px;
        margin: 0 10px;
    }
}

@media (max-width: 576px) {
    .navbar-search {
        max-width: 130px;
        margin: 0 6px;
    }
    .navbar-search input::placeholder {
        color: transparent;
    }
}

@media (max-width: 420px) {
    .navbar-search {
        display: none;
    }
}
