.exercises-header {
    text-align: center;
    padding: 7rem 2rem 3rem;
    margin-bottom: 2rem;
}

.exercises-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInDown 0.8s ease-out;
}

.exercises-header p {
    font-size: 1.25rem;
    color: #94a3b8;
    margin-bottom: 2rem;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 1rem;
    backdrop-filter: blur(10px);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-badges,
.topic-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    color: var(--light);
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.badge.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
}

/* Difficulty specific colors */
.badge.easy { color: var(--success); }
.badge.medium { color: var(--warning); }
.badge.hard { color: var(--danger); }

.badge.easy.active { 
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.2);
}
.badge.medium.active { 
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.2);
}
.badge.hard.active { 
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.2);
}

/* Search Bar */
.search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(30, 41, 59, 0.5);
    color: var(--light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

/* Exercise Stats */
.exercise-stats {
    text-align: center;
    margin-bottom: 2rem;
    color: #94a3b8;
}

.stat {
    display: inline-block;
    margin: 0 1rem;
}

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

/* Exercise Grid */
.exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

/* Exercise Card */
.exercise-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
    position: relative;
    overflow: hidden;
}

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

.exercise-card:hover::before {
    transform: translateX(0);
}

.exercise-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

/* Exercise Header */
.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.exercise-title {
    font-size: 1.25rem;
    color: var(--primary);
    margin: 0;
}

.exercise-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.difficulty-indicator,
.topic-indicator {
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-indicator.easy {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.difficulty-indicator.medium {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.difficulty-indicator.hard {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.topic-indicator {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

/* Exercise Content */
.exercise-description {
    color: #cbd5e1;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.exercise-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Code Preview */
.code-preview {
    background: var(--code-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
}

.code-preview:hover {
    border-color: var(--primary);
}

/* Completed Badge */
.completed-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--success);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: bold;
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Loading Spinner */
.loading {
    display: flex;
    justify-content: center;
    padding: 4rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .exercises-header h1 {
        font-size: 2rem;
    }
    
    .filter-controls {
        padding: 1rem;
    }
    
    .exercises-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .exercise-stats {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .stat {
        margin: 0;
    }
}
/* Add this to your exercises.css or in a <style> tag in exercises.html */

/* Fix grid layout to stack vertically */
.exercises-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column layout */
    gap: 2rem;
    margin-bottom: 4rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

/* Ensure exercise cards have proper spacing */
.exercise-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* Fix code sections */
.code-section {
    margin: 1.5rem 0;
}

.code-section pre {
    background: var(--code-bg, #1e293b);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
}

/* Fix example boxes */
.example-io {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

@media (max-width: 768px) {
    .example-io {
        grid-template-columns: 1fr;
    }
}

.io-box {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1rem;
}

.io-box pre {
    margin: 0;
    background: transparent;
    border: none;
    padding: 0.5rem 0;
}

/* Fix exercise header */
.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.exercise-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Fix buttons */
.exercise-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.exercise-actions .btn {
    padding: 0.75rem 1.5rem;
}

/* Fix solution box */
.solution-box pre {
    max-height: 400px;
    overflow-y: auto;
}

/* Ensure proper text color */
.exercise-description {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
progress-section {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    height: 20px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 1rem;
}

.progress-text {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary);
}

/* Completed Exercise Styling */
.exercise-card.completed {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.completed-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--success);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: bold;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mark Complete Button */
.mark-complete-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.mark-complete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.mark-complete-btn.completed {
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid var(--success);
    color: var(--success);
}

/* Search Highlighting */
mark {
    background: rgba(255, 212, 59, 0.3);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: bold;
}

/* Enhanced Stats Section */
.exercise-stats {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Clear Progress Button */
.clear-progress-btn {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.clear-progress-btn:hover {
    background: var(--danger);
    color: white;
}

/* Exercise position relative for badge */
.exercise-card {
    position: relative;
}

/* Success button style */
.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}

