:root {
    --primary: #4F46E5; /* Indigo */
    --primary-hover: #4338CA;
    --secondary: #EC4899; /* Pink */
    --tertiary: #14B8A6; /* Teal */
    --warning: #F59E0B; /* Amber */
    --success: #10B981; /* Emerald */
    --error: #EF4444; /* Red */
    --bg-body: #F3F4F6; /* Lighter cool gray */
    --bg-card: rgba(255, 255, 255, 0.95);
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --font: 'Plus Jakarta Sans', 'Outfit', system-ui, sans-serif;
    --radius: 20px;
}

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

body {
    font-family: var(--font);
    background: linear-gradient(135deg, #F9FAFB 0%, #E0E7FF 50%, #FDF2F8 100%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea {
    -webkit-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-bottom: 3rem;
}

.logo {
    font-size: 1.75rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.5px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo i {
    color: var(--primary);
    -webkit-text-fill-color: initial;
    font-size: 2rem;
}

/* Buttons */
.btn {
    padding: 0.85rem 1.75rem;
    border-radius: 9999px; /* Pill shape for elegance */
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #8B5CF6 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.btn-outline {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
    background-color: #F9FAFB;
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.menu-card {
    cursor: pointer;
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.menu-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.menu-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.menu-card:hover::before {
    transform: scaleX(1);
}

/* Quiz Interface */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.timer {
    background: linear-gradient(135deg, #FEF2F2 0%, #FEFCE8 100%);
    color: var(--error);
    padding: 0.6rem 1.25rem;
    border-radius: 99px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #FECACA;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.1);
}

.progress-bar {
    height: 10px;
    background: #E5E7EB;
    border-radius: 5px;
    margin-bottom: 3rem;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 5px;
}

.question-text {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    line-height: 1.5;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
}

.choice-item {
    padding: 1.5rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: 16px;
    margin-bottom: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.choice-item:hover {
    border-color: var(--primary);
    background-color: #EEF2FF;
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.choice-item.selected {
    border-color: var(--primary);
    background-color: #EEF2FF;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.15);
}

.choice-letter {
    width: 36px;
    height: 36px;
    background: #F3F4F6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.selected .choice-letter {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

/* Palette Buttons */
.palette-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.palette-btn:hover {
    border-color: var(--primary);
    background: #EEF2FF;
    color: var(--primary);
}

.palette-btn.active {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-color: transparent;
    color: var(--primary);
}

.palette-btn.answered {
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.palette-btn.bookmarked {
    background: linear-gradient(135deg, var(--warning), #F59E0B);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 3rem;
    border-radius: 28px;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255,255,255,0.2);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.hidden { display: none !important; }

/* Utilities */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Responsive Layout Classes */
.quiz-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; }
.results-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; text-align: left; margin-bottom: 2.5rem; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }

@media (max-width: 768px) {
    .container { padding: 1.25rem; }
    header { flex-direction: column; gap: 1rem; text-align: center; }
    header nav { flex-wrap: wrap; justify-content: center; }
    
    /* Hero Section */
    #landing-page > div:first-child { padding: 4rem 1.25rem !important; border-radius: 0 0 25px 25px !important; }
    #landing-page h1 { font-size: 2.75rem !important; }
    #landing-page p { font-size: 1.05rem !important; margin-bottom: 2rem !important; }
    #landing-page .btn { width: 100%; justify-content: center; }
    
    /* App layouts */
    .quiz-layout { grid-template-columns: 1fr; gap: 1.5rem; }
    .results-layout { grid-template-columns: 1fr; text-align: center; }
    .stats-grid { grid-template-columns: 1fr !important; }
    
    /* Elements */
    .question-text { font-size: 1.25rem; margin-bottom: 1.5rem; }
    .quiz-header { flex-direction: column; gap: 1rem; padding: 1rem; }
    .timer { width: 100%; justify-content: center; font-size: 1.1rem; }
    
    /* Quiz buttons */
    #quiz-container .btn { padding: 0.75rem 1rem; font-size: 0.9rem; }
    #quiz-container > div > div:first-child > div:last-child { flex-wrap: wrap; gap: 1rem; justify-content: center; }
    #question-nav { width: 100%; order: -1; margin-bottom: 0.5rem; }
    
    /* Results */
    #final-score { font-size: 4.5rem !important; }
    .no-print { flex-direction: column; gap: 0.75rem !important; }
    .no-print .btn { width: 100%; margin: 0; }
    
    /* Modals */
    .modal-content { padding: 1.5rem; width: 95%; border-radius: 20px; }
    
    /* Learning Center */
    .menu-card { padding: 1.5rem; }
    .menu-card h2 { font-size: 1.35rem !important; }
    .menu-card .icon-container { width: 50px; height: 50px; font-size: 1.25rem; }
    
    /* Footer */
    footer { padding: 1.5rem 1rem !important; font-size: 0.85rem !important; }
    
    /* Main Stats */
    #main-stats { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    #landing-page h1 { font-size: 2.25rem !important; }
    .palette-btn { width: 40px; height: 40px; font-size: 0.85rem; }
    .choice-item { padding: 1rem; gap: 0.75rem; font-size: 1rem; }
    .choice-letter { width: 32px; height: 32px; font-size: 0.9rem; }
    .card { padding: 1.5rem; }
}

/* Fancy Icons Container */
.icon-container {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.icon-blue { background: linear-gradient(135deg, #EFF6FF, #DBEAFE); color: #2563EB; }
.icon-emerald { background: linear-gradient(135deg, #ECFDF5, #D1FAE5); color: #059669; }
.icon-orange { background: linear-gradient(135deg, #FFF7ED, #FFEDD5); color: #EA580C; }
.icon-pink { background: linear-gradient(135deg, #FDF2F8, #FCE7F3); color: #DB2777; }
.icon-indigo { background: linear-gradient(135deg, #EEF2FF, #E0E7FF); color: #4F46E5; }
