/* === MATHDRILL STYLES - GRAF TIL TYPE === */

:root {
    --primary-color: #2563eb;
    --success-color: #22c55e;
    --error-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* === HEADER === */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* === SCREENS === */
.screen {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.hidden {
    display: none;
}

/* === START SCREEN === */
.info-box {
    margin-bottom: 2rem;
}

.info-box h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.info-box p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.type-info {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.type-info h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.type-info ul {
    list-style: none;
    padding-left: 1rem;
}

.type-info li {
    padding: 0.5rem 0;
    font-size: 1.05rem;
}

.tip {
    background: #fef3c7;
    padding: 1rem;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
    margin-top: 1.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #1d4ed8;
}

/* === STATS BAR === */
.stats-bar {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

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

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.stat-value.success {
    color: var(--success-color);
}

.stat-value.error {
    color: var(--error-color);
}

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

.left-column {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.right-column {
    flex: 0 0 450px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.graph-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: var(--bg-color);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    aspect-ratio: 1 / 1;  /* Kvadratisk */
    width: 100%;
}

#graphImage {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* === QUESTION CONTAINER === */
.question-container {
    text-align: center;
    margin: 2rem 0 1rem 0;
}

.question-container p {
    font-size: 1.3rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* === CHOICES CONTAINER === */
.choices-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.choice-btn {
    padding: 1.25rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    text-align: center;
    transition: all 0.2s;
}

.choice-btn:hover {
    border-color: var(--primary-color);
    background: white;
    transform: translateX(4px);
}

/* === FEEDBACK ANIMATIONS === */
.choice-btn.correct {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
    font-weight: bold;
}

.choice-btn.wrong {
    background: var(--error-color);
    border-color: var(--error-color);
    color: white;
}

.choice-btn.disabled {
    pointer-events: none;
    opacity: 0.6;
}

/* === MASTERY ANIMATIONS === */
.mastery-star {
    position: absolute;
    font-size: 2rem;
    animation: starBurst 2s ease-out forwards;
    pointer-events: none;
    z-index: 1000;
}

@keyframes starBurst {
    0% {
        transform: translateY(0) scale(0);
        opacity: 1;
    }
    40% {
        transform: translateY(-50px) scale(1.5);
        opacity: 1;
    }
    100% {
        transform: translateY(-120px) scale(1);
        opacity: 0;
    }
}

.stats-bar.mastery-highlight {
    background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
}

/* === MILESTONE OVERLAY === */
.milestone-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-in;
}

.milestone-overlay.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

.milestone-content {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    animation: scaleIn 0.5s ease-out;
}

.milestone-stars {
    font-size: 3rem;
    margin: 1rem 0;
}

.milestone-message {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin: 1rem 0;
    font-weight: bold;
}

.milestone-details {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 1rem 0;
}

.milestone-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-continue {
    flex: 1;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-continue:hover {
    background: #1d4ed8;
}

.btn-skip {
    flex: 1;
    background: var(--error-color);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-skip:hover {
    background: #dc2626;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes scaleIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
    .container {
        padding: 1rem 0.5rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .problem-container {
        flex-direction: column;
        padding: 1rem;
    }
    
    .right-column {
        flex: 1;
        width: 100%;
    }
    
    .graph-container {
        padding: 0.5rem;
    }
    
    .question-container p {
        font-size: 1.1rem;
    }
    
    .choice-btn {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .milestone-content {
        padding: 2rem;
        margin: 1rem;
    }
    
    .milestone-message {
        font-size: 1.4rem;
    }
    
    .milestone-buttons {
        flex-direction: column;
    }
}


/* === MATRIX UI (Pool 5) === */
.matrix-container {
    margin: 20px 0;
}

.matrix-row {
    display: flex;
    align-items: center;
    margin: 15px 0;
    font-size: 1.1em;
}

.param-label {
    font-weight: bold;
    width: 50px;
    margin-right: 20px;
}

.matrix-row label {
    margin: 0 15px;
    cursor: pointer;
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.2s;
}

.matrix-row label:hover {
    background: #f0f0f0;
}

.matrix-row input[type="radio"] {
    margin-right: 8px;
}

.matrix-row label.correct-answer {
    background: #d4edda;
    border-color: #28a745;
}

.matrix-row label.wrong-answer {
    background: #f8d7da;
    border-color: #dc3545;
}

#submitMatrixBtn {
    margin-top: 20px;
    width: 100%;
}

#submitMatrixBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
