/* Exercise-specific styles */

/* Overview Content */
.overview-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
}

.overview-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.overview-card h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.overview-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.exercise-tips h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.exercise-tips ul {
    margin: 0;
    padding-left: 1.5rem;
}

.exercise-tips li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.exercise-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-item {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    border: 1px solid var(--border-light);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Exercise Cards */
.exercise-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
}

.exercise-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.exercise-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.exercise-number {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.exercise-header h3 {
    color: white;
    margin: 0;
}

.exercise-content {
    padding: 2rem;
}

.exercise-content > p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

/* Exercise Sections */
.requirements,
.expected-output,
.hints {
    margin-bottom: 2rem;
}

.requirements h4,
.expected-output h4,
.hints h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
}

.requirements ul {
    margin: 0;
    padding-left: 1.5rem;
}

.requirements li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.requirements code {
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: var(--text-primary);
}

.expected-output pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    overflow-x: auto;
    margin: 0;
}

.expected-output code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.hints ul {
    margin: 0;
    padding-left: 1.5rem;
}

.hints li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.hints code {
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: var(--text-primary);
}

/* Code with Errors */
.code-with-errors {
    background: var(--bg-secondary);
    border: 2px solid var(--error-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.code-with-errors h4 {
    color: var(--error-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-with-errors pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    overflow-x: auto;
    margin: 0;
}

.code-with-errors code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Guidelines Content */
.guidelines-content {
    max-width: 1000px;
    margin: 0 auto;
}

.guidelines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.guideline-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.guideline-card h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guideline-card ol,
.guideline-card ul {
    margin: 0;
    padding-left: 1.5rem;
}

.guideline-card li {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.guideline-card strong {
    color: var(--text-primary);
}

/* Bonus Challenges */
.bonus-challenges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.challenge-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-light);
    transition: var(--transition);
    text-align: center;
}

.challenge-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-color);
}

.challenge-header {
    margin-bottom: 1rem;
}

.challenge-header i {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.challenge-header h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.challenge-card p {
    color: var(--text-secondary);
    margin: 0;
}

/* Responsive Design for Exercises */
@media (max-width: 768px) {
    .overview-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .exercise-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .exercise-content {
        padding: 1.5rem;
    }
    
    .guidelines-grid,
    .bonus-challenges {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .overview-card,
    .exercise-content,
    .guideline-card,
    .challenge-card {
        padding: 1.5rem;
    }
    
    .exercise-header {
        padding: 1rem 1.5rem;
    }
    
    .expected-output pre,
    .code-with-errors pre {
        padding: 1rem;
        font-size: 0.75rem;
    }
}

/* Print Styles for Exercises */
@media print {
    .exercise-header {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 2px solid var(--border-color);
    }
    
    .exercise-number {
        background: var(--text-primary) !important;
        color: white !important;
    }
    
    .exercise-header h3 {
        color: var(--text-primary) !important;
    }
    
    .code-with-errors {
        border-color: var(--border-color);
    }
    
    .challenge-card {
        border-color: var(--border-color);
    }
    
    .banner-actions {
        display: none;
    }
}

/* Exercise Progress Tracking */
.exercise-progress {
    position: sticky;
    top: 100px;
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.progress-header h3 {
    color: var(--text-primary);
    margin: 0;
}

.progress-bar-container {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    height: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

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

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Exercise Navigation */
.exercise-navigation {
    position: sticky;
    bottom: 2rem;
    background: var(--bg-primary);
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    z-index: 100;
}

.nav-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.nav-button:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.nav-button.prev {
    background: var(--secondary-color);
}

.nav-button.prev:hover {
    background: #6d28d9;
}

/* Exercise Timer */
.exercise-timer {
    position: fixed;
    top: 2rem;
    left: 2rem;
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timer-icon {
    color: var(--primary-color);
}

.timer-display {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 600;
    color: var(--text-primary);
}

/* Exercise Notes */
.exercise-notes {
    background: var(--bg-secondary);
    border-left: 4px solid var(--warning-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
}

.exercise-notes h4 {
    color: var(--warning-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exercise-notes p {
    color: var(--text-secondary);
    margin: 0;
}

/* Exercise Difficulty Indicators */
.difficulty-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.difficulty-beginner {
    background: var(--success-color);
    color: white;
}

.difficulty-intermediate {
    background: var(--warning-color);
    color: white;
}

.difficulty-advanced {
    background: var(--error-color);
    color: white;
}

/* Exercise Tags */
.exercise-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.exercise-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    border: 1px solid var(--border-light);
}

/* Exercise Solutions Toggle */
.solution-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 1.5rem 0;
    cursor: pointer;
    transition: var(--transition);
}

.solution-toggle:hover {
    background: var(--bg-tertiary);
}

.solution-toggle h4 {
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.solution-toggle .toggle-icon {
    transition: transform 0.3s ease;
}

.solution-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

.solution-content {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.solution-toggle.expanded .solution-content {
    display: block;
}
