:root {
    --primary-red: #E50914;
    --dark-black: #111111;
    --white: #FFFFFF;
    --gray: #333333;
    --light-gray: #f4f4f4;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--dark-black);
    line-height: 1.6;
    margin: 0;
}

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

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-red);
    color: var(--white);
    border: none;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-red);
    border: 2px solid var(--primary-red);
}

.btn-lg { padding: 15px 30px; font-size: 1.1rem; }

/* Header */
.site-header {
    background-color: var(--dark-black);
    padding: 20px 0;
    color: var(--white);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: var(--primary-red);
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.main-navigation a {
    color: var(--white);
    text-decoration: none;
}

/* Hero Section */
.hero-section {
    background-color: var(--dark-black);
    color: var(--white);
    padding: 100px 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero-search {
    margin: 40px auto;
    max-width: 600px;
}

.hero-search input {
    width: 70%;
    padding: 15px;
    border-radius: 5px 0 0 5px;
    border: none;
}

.hero-search button {
    width: 25%;
    padding: 15px;
    border-radius: 0 5px 5px 0;
}

/* Grids */
.category-grid, .subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.category-card, .subject-card {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: 0.3s;
}

.category-card:hover, .subject-card:hover {
    transform: translateY(-5px);
}

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

main section {
    animation: fadeIn 0.5s ease forwards;
}

/* Typography & Spacing */
h1, h2, h3 { color: var(--dark-black); margin-bottom: 20px; }
p { color: #666; margin-bottom: 15px; }

/* Standardized Cards */
.card, .category-card, .subject-card, .stat-box, .repo-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #eee;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* MCQ Practice Styles */
.mcq-practice-container {
    background: #f9f9f9;
    min-height: 100vh;
}

.practice-header {
    background: var(--white);
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.practice-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.practice-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    padding: 40px 20px;
}

.question-box {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.question-text {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 30px;
}

.option-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 15px 20px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    transition: 0.2s;
}

.option-btn:hover { background: #fef4f4; border-color: var(--primary-red); }
.option-btn.selected { background: var(--primary-red); color: var(--white); border-color: var(--primary-red); }

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

.palette-dot {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.palette-dot.current { border: 2px solid var(--primary-red); font-weight: bold; }
.palette-dot.answered { background: #4CAF50; color: white; border-color: #4CAF50; }
.palette-dot.review { background: #FF9800; color: white; border-color: #FF9800; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .practice-layout, .dashboard-grid, .repo-layout { grid-template-columns: 1fr; }
    .hero-section h1 { font-size: 2rem; }
    .hero-search input { width: 60%; }
    .hero-search button { width: 35%; }
    .site-header .container { flex-direction: column; gap: 15px; }
    .main-navigation ul { flex-wrap: wrap; justify-content: center; }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* AI Tutor Styles */
.ai-chat-container {
    max-width: 800px;
    margin: 50px auto;
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    overflow: hidden;
}

.ai-chat-header {
    background: var(--dark-black);
    color: var(--white);
    padding: 20px;
    text-align: center;
}

.ai-chat-window {
    height: 400px;
    padding: 20px;
    overflow-y: auto;
    background: #f0f2f5;
}

.message {
    margin-bottom: 15px;
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 80%;
}

.ai-message {
    background: var(--white);
    color: var(--dark-black);
    border-bottom-left-radius: 2px;
}

.user-message {
    background: var(--primary-red);
    color: var(--white);
    margin-left: auto;
    border-bottom-right-radius: 2px;
}

.ai-chat-input {
    padding: 20px;
    display: flex;
    gap: 10px;
}

.ai-chat-input input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.floating-ai-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary-red);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 1000;
}

/* Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    padding: 50px 0;
}

.dashboard-sidebar {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-red);
}

.mistake-vault-preview {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 40px;
}

.badge {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 10px;
}

.badge-wrong { background: #fee2e2; color: #ef4444; }
.badge-correct { background: #dcfce7; color: #22c55e; }
