/* Learn Page Styles */
.main-content {
    padding-top: 1.5rem;
}

.learn-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 3rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Placement Banner */
.placement-banner {
    background: linear-gradient(135deg, hsl(262, 80%, 60%), hsl(290, 80%, 60%));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.placement-banner.hidden {
    display: none;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.banner-icon {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.banner-text h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.banner-text p {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.banner-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-banner {
    background: white;
    color: hsl(262, 80%, 60%);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-banner:hover {
    transform: translateY(-2px);
}

.btn-banner-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 0.25rem;
}

.btn-banner-close:hover {
    opacity: 1;
}

/* Category Sections */
.category-section {
    width: 100%;
    margin-bottom: 0.5rem;
}

.category-header {
    width: 100%;
    /* Gradient defined inline or via utility classes per section */
    border-radius: 8px;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.category-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 1;
}

.category-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-details h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.category-details p {
    margin: 0.4rem 0 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.category-meta {
    display: flex;
    align-items: center;
    gap: 2rem;
    z-index: 1;
}

.lesson-count {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.category-section.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

/* Category Content */
.category-content {
    max-height: 2000px; /* Arbitrary large height for transition */
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, opacity 0.3s ease-in-out, margin-top 0.3s ease;
    opacity: 1;
    margin-top: 1.5rem;
}

/* Temporarily disable transitions during page load */
body.transitions-disabled .category-content {
    transition: none;
}

.category-section.collapsed .category-content {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

/* Lessons Grid */
.lessons-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

/* Responsive Grid */
@media (max-width: 1400px) {
    .lessons-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    .lessons-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 800px) {
    .lessons-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .category-header {
        padding: 1rem;
    }
    
    .category-icon {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }
    
    .category-details h2 {
        font-size: 1.2rem;
    }
    
    .category-details p {
        font-size: 0.85rem;
    }
    
    .lesson-count {
        display: none; /* Hide count on small mobile if needed */
    }
}

@media (max-width: 500px) {
    .lessons-grid {
        grid-template-columns: 1fr;
    }
    
    .category-info {
        gap: 1rem;
    }
}

/* Lesson Card */
.lesson-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid var(--bg-card-border);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.lesson-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.lesson-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--color-text-primary, #fff);
    line-height: 1.3;
}

.xp-badge {
    font-size: 0.75rem;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
}

.lesson-desc {
    font-size: 0.9rem;
    color: var(--color-text-secondary, #aaa);
    margin: 0;
    flex-grow: 1;
    line-height: 1.5;
}

.lesson-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
}

.progress-container {
    width: 100%;
    height: 8px;
    background: var(--bg-card-header);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-primary, hsl(262, 60%, 55%));
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease, background-color 0.5s ease;
}

.progress-fill.completed {
    background: hsl(140, 60%, 45%); /* Green for completed */
}

.progress-fill.xp-claimed {
    background: hsl(140, 70%, 50%); /* Bright green for XP claimed */
}

.progress-fill.ready-to-claim {
    background: hsl(140, 70%, 45%); /* Green for ready to claim */
}

.btn-start-lesson {
    width: 100%;
    padding: 0.6rem;
    border: none;
    border-radius: 6px;
    background: var(--color-primary, hsl(262, 60%, 55%));
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-start-lesson:hover {
    background: var(--color-primary-hover, hsl(262, 60%, 45%));
}

.btn-start-lesson.completed {
    background: var(--bg-secondary);
    color: var(--color-text-secondary);
}

.btn-start-lesson.completed:hover {
    background: var(--bg-hover);
}

.btn-start-lesson.claim-xp {
    background: hsl(140, 70%, 45%);
    color: white;
    font-weight: 600;
}

.btn-start-lesson.claim-xp:hover {
    background: hsl(140, 70%, 40%);
}

/* Lesson Completed Badge (Green Checkmark) */
.lesson-completed-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    background: hsl(140, 70%, 50%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.lesson-completed-badge i {
    color: white;
}

.lesson-card {
    position: relative;
}

/* Coming Soon Card */
.coming-soon-card {
    background: transparent;
    border: 2px dashed var(--color-surface-light, hsl(214, 15%, 25%));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    color: var(--color-text-secondary);
    min-height: 220px; /* Match lesson card height */
}

.coming-soon-card .coming-soon-icon {
    font-size: 2rem;
    color: var(--color-text-secondary);
}

.coming-soon-card .coming-soon-text {
    font-weight: 500;
    margin: 0;
}

.completion-checkmark {
    display: none; /* Hidden by default */
    font-size: 1.2rem;
    color: hsl(140, 80%, 70%);
    margin-right: -1rem; /* Adjust positioning */
}

.category-section.all-complete .completion-checkmark {
    display: inline-block; /* Show when category is complete */
}

/* Gradients for specific categories */
.bg-beginner { background: linear-gradient(135deg, hsl(280, 60%, 35%), hsl(240, 60%, 35%)); }
.bg-strategy { background: linear-gradient(135deg, hsl(160, 60%, 30%), hsl(140, 60%, 30%)); }
.bg-openings { background: linear-gradient(135deg, hsl(210, 70%, 35%), hsl(190, 70%, 35%)); }
.bg-tactics { background: linear-gradient(135deg, hsl(330, 60%, 35%), hsl(300, 60%, 35%)); }
.bg-mastery { background: linear-gradient(135deg, hsl(30, 80%, 35%), hsl(10, 80%, 35%)); }

/* Reset Progress Section */
.reset-section {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    margin-top: 2rem;
}

.btn-reset-progress {
    background: linear-gradient(135deg, hsl(0, 70%, 50%), hsl(0, 70%, 40%));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-reset-progress:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, hsl(0, 70%, 55%), hsl(0, 70%, 45%));
}

.btn-reset-progress:active {
    transform: translateY(0);
}

.btn-reset-progress:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

