* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}

/* Premium User Enhancements */
.premium-welcome {
    text-align: center;
    margin-bottom: 3rem;
}

.welcome-text {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.progress-circle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 3rem 0;
}

.progress-ring {
    position: relative;
    width: 200px;
    height: 200px;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    fill: none;
    stroke: var(--border);
    stroke-width: 12;
}

.progress-ring-progress {
    fill: none;
    stroke: url(#gradient);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.progress-ring-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-percentage {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

.progress-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.progress-stat {
    text-align: center;
}

.progress-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.progress-stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Mistakes Review Section */
.mistakes-dashboard {
    margin: 2rem 0;
}

.mistakes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.mistakes-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.chapter-weakness-chart {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.mistakes-list {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid var(--border);
    max-height: 400px;
    overflow-y: auto;
}

.mistake-item {
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--danger);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mistake-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.mistake-question {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.mistake-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.mistake-chapter {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    transform: scale(1.05);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    font-size: 0.875rem;
}

.premium-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Main Layout */
.main-container {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1.25rem 1rem;
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: 70px;
    bottom: 0;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.nav-item {
    padding: 0.625rem 0.875rem;
    border-radius: 10px;
    margin-bottom: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9375rem;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

/* Content Area */
.content {
    margin-left: 280px;
    flex: 1;
    padding: 1.25rem;
    max-width: 1400px;
}

/* Hero */
.hero {
    text-align: center;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.feature-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    text-align: left;
    transition: all 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.feature-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.feature-title {
    font-weight: 600;
    margin-bottom: 0.4375rem;
    font-size: 1rem;
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-tertiary);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    font-weight: 700;
}

.btn-gold:hover:not(:disabled) {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(251, 191, 36, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.0625rem;
}

/* Quiz Interface */
.quiz-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1rem;
    height: calc(100vh - 140px);
}

.quiz-main {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    position: relative;
}

.quiz-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.progress-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid var(--border);
}

.progress-header {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    margin-bottom: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress-bar-container {
    height: 6px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
}

.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
    transition: transform 0.2s ease;
}

.stat-box:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    transition: color 0.3s ease;
}

.stat-label {
    font-size: 0.625rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.3125rem;
}

.question-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    padding-bottom: 1.125rem;
    border-bottom: 2px solid var(--border);
}

.question-number {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--primary);
}

.question-meta {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.report-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.report-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.report-btn:active {
    transform: scale(0.95);
}

.question-text {
    font-size: 1.4375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.75rem;
    line-height: 1.6;
    letter-spacing: -0.01em;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
    padding-right: 80px;
}

.option {
    padding: 1.125rem 1.375rem;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.0625rem;
    position: relative;
    line-height: 1.6;
    font-weight: 500;
}

.option:hover:not(.locked) {
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.option.selected {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.option.correct {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.option.incorrect {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.option.locked {
    cursor: not-allowed;
}

.feedback-box {
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1.125rem;
    font-weight: 500;
    display: none;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.feedback-box.correct {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--success);
    color: var(--success);
}

.feedback-box.incorrect {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--danger);
    color: var(--danger);
}

.quiz-controls {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1.25rem;
}

/* Floating Next Button */
.floating-next {
    position: absolute;
    right: -70px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 10;
}

.floating-next:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-xl);
}

.floating-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--text-tertiary);
}

.floating-next.answered {
    animation: pulse 0.5s ease;
}

@keyframes pulse {

    0%,
    100% {
        transform: translateY(-50%) scale(1);
    }

    50% {
        transform: translateY(-50%) scale(1.15);
    }
}

/* Results Page */
.results-container {
    max-width: 1200px;
    margin: 0 auto;
}

.results-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.results-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.score-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.score-card {
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border);
}

.score-card-value {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.375rem;
}

.score-card-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    min-height: 260px;
    display: flex;
    flex-direction: column;
}

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.chart-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-style: italic;
    font-size: 0.875rem;
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.review-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.review-item {
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--danger);
}

.review-question {
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.review-answers {
    display: flex;
    flex-direction: column;
    gap: 0.4375rem;
    font-size: 0.8125rem;
}

.review-correct {
    color: var(--success);
}

.review-incorrect {
    color: var(--danger);
}

/* Pricing */
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem auto;
    max-width: 1100px;
    align-items: center;
    justify-items: center;
}

.pricing-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 1.75rem 1.5rem;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    width: 100%;
    max-width: 340px;
}

.pricing-card.featured {
    border-color: var(--success);
    transform: scale(1.08);
    box-shadow: var(--shadow-xl);
    z-index: 2;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.pricing-card.featured {
    border-color: var(--primary);
    transform: scale(1.05);
}

.best-value {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 0.375rem 1rem;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-lg);
}

.pricing-name {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.625rem;
}

.pricing-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0.625rem 0 0.5rem;
}

.pricing-price small {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.pricing-total {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1.125rem;
    font-weight: 500;
    padding: 0.3125rem 0.875rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: inline-block;
}

.pricing-features {
    list-style: none;
    margin: 1.125rem 0 1.375rem;
    text-align: left;
    width: 100%;
}

.pricing-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.pricing-features li:last-child {
    border-bottom: none;
}

.pricing-features li::before {
    content: "✓";
    color: var(--success);
    font-weight: bold;
    margin-right: 0.75rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    position: relative;
}

.auth-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: fadeIn 0.3s ease;
}

.auth-loading-overlay.active {
    display: flex;
}

/* Modern Single Gradient Spinner - CLEAN & MINIMAL */
.auth-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 2rem;
}

.auth-spinner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(99, 102, 241, 0.1);
    border-top-color: var(--primary);
    animation: cleanSpin 1s linear infinite;
}

@keyframes cleanSpin {
    to {
        transform: rotate(360deg);
    }
}

.modal h2 {
    margin-bottom: 1.5rem;
    font-size: 1.875rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 1rem;
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1.125rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: none;
}

/* Notification */
.notification {
    position: fixed;
    top: 90px;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-xl);
    z-index: 3000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading */
.loading-spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
        padding: 1rem;
    }

    .quiz-layout {
        grid-template-columns: 1fr;
    }

    .quiz-sidebar {
        order: -1;
        flex-direction: row;
        gap: 0.75rem;
        overflow-x: auto;
        margin-bottom: 1rem;
    }

    .floating-next {
        display: none;
    }

    .options-container {
        padding-right: 0;
    }

    .stats-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 1rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .welcome-text {
        font-size: 1.5rem;
    }

    .progress-ring {
        width: 160px;
        height: 160px;
    }

    .progress-ring svg {
        width: 160px;
        height: 160px;
    }

    .progress-ring-circle,
    .progress-ring-progress {
        cx: 80;
        cy: 80;
        r: 74;
    }

    .progress-percentage {
        font-size: 2rem;
    }

    .progress-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .quiz-main {
        padding: 1.25rem;
        border-radius: 16px;
    }

    .question-text {
        font-size: 1.125rem;
        margin-bottom: 1.5rem;
    }

    .option {
        font-size: 0.9375rem;
        padding: 1rem 1.25rem;
    }

    .quiz-controls {
        flex-wrap: wrap;
    }

    .quiz-controls .btn {
        flex: 1;
        min-width: 100px;
    }

    .stats-overview-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .score-card {
        padding: 1rem;
    }

    .score-card-value {
        font-size: 1.875rem;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .pricing-card {
        max-width: 100%;
    }

    .pricing-card.featured {
        transform: scale(1);
        order: -1;
    }

    .form-input {
        font-size: 1rem;
        padding: 0.875rem;
    }

    .mistake-item {
        font-size: 0.875rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .mistakes-header {
        flex-direction: column;
        gap: 1rem;
    }

    .mistakes-header div {
        flex-direction: column;
        width: 100%;
    }

    .mistakes-header .btn {
        width: 100%;
    }


    .modal {
        padding: 2rem;
        width: 95%;
    }

    .auth-spinner {
        width: 50px;
        height: 50px;
    }

    .auth-loading-text {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .auth-spinner {
        width: 50px;
        height: 50px;
    }

    .auth-loading-text {
        font-size: 1rem;
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 1rem;
    }

    .welcome-text {
        font-size: 1.25rem;
    }

    .progress-ring {
        width: 140px;
        height: 140px;
    }

    .progress-ring svg {
        width: 140px;
        height: 140px;
    }

    .progress-percentage {
        font-size: 1.75rem;
    }

    .question-text {
        font-size: 1rem;
    }

    .option {
        font-size: 0.875rem;
        padding: 0.875rem 1rem;
    }

    .quiz-controls {
        gap: 0.5rem;
    }

    .quiz-controls .btn {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
    }

    .chart-card {
        min-height: 220px;
    }

    .notification {
        right: 1rem;
        left: 1rem;
        width: auto;
    }
}

.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-xl);
    z-index: 1001;
    font-size: 1.5rem;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

.hidden {
    display: none !important;
}


/* Footer Styles - Minimal & Clean */
.footer {
    margin-left: 280px;
    padding: 0;
    margin-top: 6rem;
}

.footer-divider {
    height: 1px;
    background: linear-gradient(to right,
            transparent 0%,
            var(--border) 20%,
            var(--border) 80%,
            transparent 100%);
    margin-bottom: 2rem;
}

.footer-content {
    padding: 0 2rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--primary);
}

.footer-separator {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.footer-copyright {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .footer {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .footer {
        margin-top: 4rem;
    }

    .footer-content {
        padding: 0 1rem 1.5rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-separator {
        display: none;
    }
}