/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1400px;  /* Increased for two-column layout */
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* === HEADER === */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* === SCREENS === */
.screen {
    padding: 40px;
}

.screen.hidden {
    display: none;
}

/* === START SCREEN === */
.intro {
    text-align: center;
    margin-bottom: 40px;
}

.intro h2 {
    color: #333;
    margin-bottom: 20px;
}

.intro p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.intro ul {
    list-style: none;
    text-align: left;
    display: inline-block;
    margin: 20px 0;
}

.intro li {
    padding: 10px 0;
    color: #555;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* === STATISTICS BAR === */
.stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.stat-value.success {
    color: #28a745;
}

.stat-value.error {
    color: #dc3545;
}

/* === PROBLEM CONTAINER - TWO COLUMN LAYOUT === */
.problem-container {
    padding: 30px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.left-column {
    flex: 1;
    min-width: 0; /* Allow flex item to shrink below content size */
}

.right-column {
    flex: 0 0 400px; /* Fixed width for choices */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.problem-statement {
    background: #f0f4ff;
    border-left: 4px solid #667eea;
    padding: 20px;
    margin-bottom: 20px;  /* Reduced from 30px */
    border-radius: 8px;
}

.problem-statement .function {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

/* === STEPS DISPLAY === */
.steps-display {
    /* No margin needed - in left column now */
}

.step-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    transition: all 0.3s;
}

.step-item.completed {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.step-item.active {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.step-item.locked {
    background: #f8f9fa;
    border-left: 4px solid #dee2e6;
    opacity: 0.6;
}

.step-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
}

.step-item.completed .step-icon {
    background: #28a745;
    color: white;
}

.step-item.active .step-icon {
    background: #ffc107;
    color: white;
}

.step-item.locked .step-icon {
    background: #dee2e6;
    color: #6c757d;
}

.step-label {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.step-answer {
    background: rgba(255, 255, 255, 0.8);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    border: 2px solid rgba(40, 167, 69, 0.3);
    margin-left: 10px;
}

/* === CURRENT QUESTION === */
.current-question {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    border-radius: 8px;
}

.current-question h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* === CHOICES === */
.choices-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.choice-btn {
    padding: 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.choice-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateX(5px);
}

.choice-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.choice-btn.disabled:hover {
    transform: none;
    border-color: #e9ecef;
    background: white;
}

.choice-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    margin-right: 15px;
    font-weight: bold;
}

.choice-text {
    flex: 1;
}

.choice-btn.correct {
    background: #d4edda;
    border-color: #28a745;
}

.choice-btn.wrong {
    background: #f8d7da;
    border-color: #dc3545;
}

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

.step-item {
    animation: fadeIn 0.3s ease-out;
}

/* === MASTERY EFFECTS === */
.mastery-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.mastery-star {
    position: absolute;
    font-size: 2rem;
    animation: starBurst 2s ease-out forwards;
}

@keyframes starBurst {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(1);
        opacity: 0;
    }
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    /* Stack columns on tablets and below */
    .problem-container {
        flex-direction: column;
    }
    
    .right-column {
        flex: 1;
        width: 100%;
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }
    
    .container {
        border-radius: 0;
    }
    
    .screen {
        padding: 20px;
    }
    
    .problem-container {
        padding: 20px;
    }
}
