@import url("https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap");

:root {
    --bg: #121212;
    --text: #e0e0e0;
    --text-muted: #9e9e9e;
    --text-heading: #ffffff;
    --primary: #d4a373;
    --primary-hover: #c29363;
    --card-bg: #1e1e1e;
    --border: #333333;
    --premium-bg: #0a0a0a;
    --premium-text: #ffffff;
    --gold: #d4a373;
    --success: #6bbd7c;
    --danger: #db6b6b;
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
    --nav-bg: #1a1a1a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: "Inter", sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Libre Baskerville", serif;
    color: var(--text-heading);
}

#app {
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg);
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    position: relative;
    display: flex;
    flex-direction: column;
}

.page {
    display: none;
    flex: 1;
    padding: 24px 20px 80px 20px; /* space for bottom nav */
    flex-direction: column;
}

.page.active {
    display: flex;
    animation: fadeIn 0.4s ease forwards;
}

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

header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

header h2 {
    font-weight: 700;
    font-size: 24px;
    text-align: center;
    flex: 1;
}

.page > p {
    color: var(--text-muted) !important;
    font-size: 14px;
}

.back-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    font-size: 20px;
    color: var(--text-heading);
    cursor: pointer;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--card-shadow);
    transition: background 0.2s;
}

.back-btn:active {
    background: #2a2a2a;
}

.courses-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 24px 20px;
    border-radius: 24px;
    font-size: 18px;
    font-family: "Libre Baskerville", serif;
    cursor: pointer;
    color: var(--text-heading);
    box-shadow: var(--card-shadow);
    transition:
        transform 0.2s,
        box-shadow 0.2s;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.card:active {
    transform: scale(0.98);
}

.card::after {
    content: "→";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 20px;
    font-family: "Inter", sans-serif;
}

.card.premium {
    border-color: rgba(212, 163, 115, 0.5);
    box-shadow: 0 4px 15px rgba(212, 163, 115, 0.05);
    background: var(--card-bg);
    color: var(--text-heading);
}

.card.premium::after {
    color: var(--primary);
}

.card.premium-extra {
    background: var(--premium-bg);
    color: var(--gold);
    border: 1px solid var(--gold);
    box-shadow: 0 4px 20px rgba(212, 163, 115, 0.1);
}

.card.premium-extra::after {
    color: var(--gold);
    content: "✨";
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.cal-day {
    aspect-ratio: 1;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Inter", sans-serif;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-heading);
    box-shadow: var(--card-shadow);
    transition: 0.2s;
}

.cal-day.completed {
    background: rgba(212, 163, 115, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.cal-day.current {
    background: var(--primary);
    border-color: var(--primary);
    color: #121212;
    box-shadow: 0 0 15px rgba(212, 163, 115, 0.4);
}

.cal-day.locked {
    opacity: 0.5;
    filter: grayscale(1);
    cursor: not-allowed;
    box-shadow: none;
    background: #1a1a1a;
    color: #555;
    border-color: #222;
}

.cal-day:active {
    transform: scale(0.92);
}

.banner {
    background: var(--card-bg);
    border: 1px solid var(--primary);
    border-radius: 24px;
    padding: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--text);
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
}

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

.banner strong {
    color: var(--gold);
}

.btn {
    background: var(--primary);
    color: #121212;
    border: none;
    padding: 18px 24px;
    border-radius: 20px;
    font-family: "Inter", sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    width: 100%;
    transition:
        opacity 0.2s,
        transform 0.2s;
    display: block;
    text-align: center;
    box-shadow: 0 4px 15px rgba(212, 163, 115, 0.2);
}

.btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn.secondary {
    background: var(--card-bg);
    color: var(--primary);
    border: 1px solid var(--primary);
    box-shadow: none;
}

.mt-4 {
    margin-top: 16px;
}

.btn.small {
    width: auto;
    padding: 12px 20px;
    display: inline-block;
    border-radius: 16px;
}

.btn.success {
    background: var(--success);
    box-shadow: 0 4px 15px rgba(107, 189, 124, 0.2);
    color: #121212;
}
.btn.danger {
    background: var(--danger);
    box-shadow: 0 4px 15px rgba(219, 107, 107, 0.2);
    color: #121212;
}

.bottom-bar {
    margin-top: auto;
    padding-top: 30px;
    padding-bottom: 20px;
}

.center-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 16px;
}

.icon-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(212, 163, 115, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 44px;
    margin-bottom: 10px;
}

.icon-circle.gold {
    background: rgba(212, 163, 115, 0.15);
}

.lesson-content {
    background: var(--card-bg);
    padding: 32px 24px;
    border-radius: 32px;
    line-height: 1.8;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
    font-size: 15px;
    color: var(--text);
}

.lesson-content h3 {
    margin-bottom: 16px;
    color: var(--text-heading);
    font-size: 20px;
}
.lesson-content p {
    margin-bottom: 16px;
    color: var(--text);
}
.lesson-content ul {
    padding-left: 20px;
    margin-bottom: 16px;
}
.lesson-content li {
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

/* To'lov sahifasi */
.credit-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 24px;
    padding: 28px;
    position: relative;
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-bottom: 24px;
}

.credit-card::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(212, 163, 115, 0.1) 0%,
        transparent 60%
    );
    pointer-events: none;
}

.cc-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
}

.cc-chip {
    width: 44px;
    height: 32px;
    background: linear-gradient(135deg, #ffd700, #daa520);
    border-radius: 6px;
    position: relative;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.3);
}
.cc-chip::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0, 0, 0, 0.2);
}
.cc-chip::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(0, 0, 0, 0.2);
}

.cc-bank {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1.5px;
}

/* Karta raqamini bir qatorga sig'dirish va nusxalash tugmasi dizayni */
.cc-number-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.cc-number {
    font-family: "Inter", monospace;
    font-size: 19px; /* Raqam kattaligi qisqartirildi (sig'ishi uchun) */
    letter-spacing: 2px; /* Oraliq masofa qisqartirildi */
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.copy-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    font-size: 16px;
}

.copy-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.3);
}

.cc-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.cc-name {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.cc-amount {
    color: var(--gold);
    font-weight: 700;
    font-size: 18px;
}

/* IDEAL FILE UPLOAD STYLES */
.file-upload {
    margin-top: 24px;
    padding: 40px 20px;
    border: 2px dashed var(--primary);
    border-radius: 24px;
    text-align: center;
    background: rgba(212, 163, 115, 0.05);
    box-shadow: var(--card-shadow);
    cursor: pointer;
    display: block;
    transition: all 0.3s ease;
}

.file-upload:active {
    transform: scale(0.97);
    background: rgba(212, 163, 115, 0.1);
}

.file-upload.success {
    border-style: solid;
    border-color: var(--success);
    background: rgba(107, 189, 124, 0.1);
}

.card.locked-course::after {
    content: "🔒";
    color: var(--text-muted);
    font-size: 18px;
    filter: grayscale(1);
    opacity: 0.5;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

.demo-admin {
    margin-top: 50px;
    padding: 24px;
    border: 1px dashed var(--border);
    background: var(--card-bg);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    box-shadow: var(--card-shadow);
}

.demo-admin small {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    margin-bottom: 8px;
}

/* Premium Visuals */
.premium-theme {
    background: var(--premium-bg);
    color: var(--premium-text);
}

.premium-theme header h2 {
    color: var(--premium-text);
}

.premium-theme .page > p {
    color: #a8a29e !important;
}

.premium-theme .back-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--nav-bg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    z-index: 100;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: "Inter", sans-serif;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: color 0.2s;
    flex: 1;
}

.nav-btn span {
    font-size: 22px;
    filter: grayscale(1) opacity(0.5);
    transition: filter 0.2s;
}

.nav-btn.active {
    color: var(--primary);
}

.nav-btn.active span {
    filter: none;
}

/* Leaderboard */
.leaderboard {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-row {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--card-shadow);
}

.user-rank {
    width: 25px;
    font-weight: 700;
    color: var(--text-muted);
    font-family: "Libre Baskerville", serif;
    font-size: 16px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #2a2a2a;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    margin-right: 14px;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-heading);
}

.user-score {
    font-weight: 700;
    font-size: 14px;
    color: var(--gold);
}
