:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --background-color: #f0f2f5;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --border-radius: 16px;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--dark-color);
    line-height: 1.6;
    padding-bottom: 70px; /* Space for bottom nav */
}

/* Header */
.main-header {
    background-color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.star-counter {
    background-color: #fff9db;
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.star-counter.animate {
    animation: starPulse 0.5s ease;
}

@keyframes starPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

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

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

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.bottom-nav ul {
    display: flex;
    justify-content: space-around;
    list-style: none;
    padding: 10px 0;
    max-width: 600px;
    margin: 0 auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--secondary-color);
    font-size: 0.8rem;
    gap: 4px;
}

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

.nav-item i {
    font-size: 1.2rem;
}

/* Onboarding */
.onboarding {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, #f0f2f5 0%, #ffffff 100%);
}

.onboarding-logo i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.onboarding-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.onboarding-slogan {
    color: var(--secondary-color);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.onboarding-image {
    width: 80%;
    max-width: 300px;
    margin-bottom: 40px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 40px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transition: transform 0.2s;
}

.btn-primary:active {
    transform: scale(0.95);
}

.btn-secondary {
    margin-top: 20px;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

/* Home Feed */
.feed-container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.search-bar {
    position: relative;
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border-radius: 25px;
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 1rem;
}

.search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    background-color: white;
    color: var(--secondary-color);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.lesson-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

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

.card-image {
    position: relative;
    height: 180px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: crop;
}

.card-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.card-content {
    padding: 15px;
}

.card-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.badge.sciences { background-color: var(--success-color); }
.badge.mathématiques { background-color: var(--primary-color); }
.badge.français { background-color: var(--danger-color); }

.card-cycle {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

/* Lesson Page */
.lesson-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background-color: white;
}

.back-btn {
    font-size: 1.2rem;
    color: var(--dark-color);
    text-decoration: none;
    margin-right: 15px;
}

.video-container {
    width: 100%;
    background-color: black;
    aspect-ratio: 9 / 16;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lesson-actions {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.action-buttons {
    display: flex;
    gap: 15px;
}

.btn-action {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border-radius: var(--border-radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-mindmap {
    background-color: #e3f2fd;
    color: #1976d2;
}

.btn-quiz {
    background-color: #e8f5e9;
    color: #388e3c;
}

.btn-action i {
    font-size: 1.5rem;
}

/* Profile Page */
.profile-container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.profile-header {
    margin-bottom: 30px;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: white;
    margin: 0 auto 15px;
    border: 4px solid var(--primary-color);
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.progress-section {
    background-color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
}

.progress-bar-bg {
    height: 12px;
    background-color: #eee;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 6px;
    transition: width 0.5s;
}

.badges-section {
    text-align: left;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.badge-icon {
    font-size: 2rem;
    background-color: white;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: var(--card-shadow);
}

.badge-name {
    font-size: 0.7rem;
    text-align: center;
    color: var(--secondary-color);
}

/* Modal for Mindmap and Quiz */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background-color: white;
    width: 100%;
    max-width: 500px;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

.mindmap-img {
    width: 100%;
    display: block;
}

.quiz-container {
    padding: 30px;
}

.quiz-question {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-option:hover {
    border-color: var(--primary-color);
}

.quiz-option.correct {
    background-color: #e8f5e9;
    border-color: var(--success-color);
}

.quiz-option.wrong {
    background-color: #ffebee;
    border-color: var(--danger-color);
}
