/* scale-game.css — Map Scale interactive game styles */

.scale-game-section {
    margin-top: 4rem;
    padding: 3rem;
    border-radius: 20px;
    background: linear-gradient(135deg, #0f172a 0%, #0c1a2e 100%);
    color: white;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6);
    border: 1px solid rgba(16,185,129,0.2);
}

.scale-game-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    min-height: 520px;
}

@media (max-width: 900px) {
    .scale-game-wrapper {
        grid-template-columns: 1fr;
    }
}

/* ── Left: Visual Illustration Panel ── */
.scale-visual-panel {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.scale-visual-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Scale Type Cards inside visual panel */
.scale-type-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.scale-type-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    transition: all 0.3s ease;
    cursor: default;
}

.scale-type-card.active {
    border-color: #10b981;
    background: rgba(16,185,129,0.1);
    box-shadow: 0 0 20px rgba(16,185,129,0.15);
}

.scale-type-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.scale-type-icon {
    font-size: 1.5rem;
}

.scale-type-name {
    font-size: 1rem;
    font-weight: 700;
    color: #f8fafc;
}

.scale-type-en {
    font-size: 0.8rem;
    color: #64748b;
    margin-left: auto;
}

.scale-type-display {
    font-size: 1.15rem;
    font-weight: 800;
    color: #10b981;
    letter-spacing: 1px;
    padding: 0.5rem 0.75rem;
    background: rgba(16,185,129,0.1);
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 0.5rem;
    font-family: 'Outfit', monospace;
}

.scale-type-desc {
    font-size: 0.88rem;
    color: #94a3b8;
    line-height: 1.5;
}

/* Linear Scale SVG Visual */
.linear-scale-visual {
    margin-top: 0.5rem;
}

.linear-scale-svg {
    width: 100%;
    height: 50px;
}

/* Conversion Diagram */
.conversion-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    border: 1px dashed rgba(255,255,255,0.1);
}

.conv-box {
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid;
    min-width: 90px;
}

.conv-box.frac { border-color: #3b82f6; background: rgba(59,130,246,0.1); color: #93c5fd; }
.conv-box.stmt { border-color: #f59e0b; background: rgba(245,158,11,0.1); color: #fcd34d; }
.conv-box.line { border-color: #10b981; background: rgba(16,185,129,0.1); color: #6ee7b7; }

.conv-box-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
    opacity: 0.7;
}

.conv-box-val {
    font-size: 0.9rem;
    font-weight: 800;
}

.conv-arrow {
    color: #334155;
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* ── Right: Teaching / Quiz Panel ── */
.scale-panel {
    background: #1e293b;
    border-radius: 16px;
    border: 1px solid #334155;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.scale-panel-header {
    background: #0f172a;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scale-panel-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #f8fafc;
    font-weight: 800;
}

.scale-progress-bar {
    display: flex;
    gap: 0.4rem;
}

.scale-prog-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #334155;
    transition: background 0.3s;
}

.scale-prog-dot.done { background: #10b981; }
.scale-prog-dot.active { background: #f59e0b; }

.scale-panel-body {
    padding: 1.75rem;
    flex: 1;
    overflow-y: auto;
    color: #e2e8f0;
    line-height: 1.7;
}

.scale-panel-actions {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid #334155;
    background: #0f172a;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* Teaching content styles */
.scale-lesson-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 1rem;
}

.scale-lesson-body p {
    color: #cbd5e1;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.scale-highlight-box {
    background: rgba(16,185,129,0.1);
    border-left: 4px solid #10b981;
    border-radius: 0 10px 10px 0;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    color: #a7f3d0;
    font-size: 0.95rem;
}

.scale-formula-box {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    font-family: 'Outfit', monospace;
    font-size: 1.1rem;
    color: #f8fafc;
    text-align: center;
    letter-spacing: 1px;
}

.scale-formula-box .hl { color: #10b981; font-weight: 800; }
.scale-formula-box .hl-b { color: #60a5fa; font-weight: 800; }
.scale-formula-box .hl-y { color: #fcd34d; font-weight: 800; }

.scale-example-box {
    background: rgba(59,130,246,0.08);
    border: 1px solid rgba(59,130,246,0.25);
    border-radius: 10px;
    padding: 1.25rem;
    margin: 1rem 0;
}

.scale-example-box .ex-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #60a5fa;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.scale-example-box p {
    color: #cbd5e1;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.scale-example-box .ex-result {
    font-size: 1.05rem;
    font-weight: 700;
    color: #a7f3d0;
    margin-top: 0.5rem;
}

/* Step-by-step conversion */
.scale-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.scale-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.scale-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #10b981;
    color: #0f172a;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.scale-step-text {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.5;
    padding-top: 3px;
}

.scale-step-text code {
    background: rgba(16,185,129,0.15);
    color: #6ee7b7;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Quiz Styles */
.scale-quiz-question {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.scale-quiz-sub {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 400;
    margin-top: 0.25rem;
    display: block;
}

.scale-quiz-display {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: #10b981;
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.3);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
    font-family: 'Outfit', monospace;
}

.scale-quiz-opts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.scale-quiz-opt {
    background: rgba(15,23,42,0.5);
    border: 2px solid #334155;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    color: #cbd5e1;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-family: 'Outfit', monospace;
}

.scale-quiz-opt:hover:not(:disabled) {
    border-color: #475569;
    background: rgba(71,85,105,0.3);
}

.scale-quiz-opt.correct {
    background: rgba(16,185,129,0.2) !important;
    border-color: #10b981 !important;
    color: #6ee7b7 !important;
}

.scale-quiz-opt.wrong {
    background: rgba(239,68,68,0.2) !important;
    border-color: #ef4444 !important;
    color: #fca5a5 !important;
}

.scale-quiz-feedback {
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    display: none;
    margin-top: 0.5rem;
}

.scale-quiz-feedback.success {
    background: rgba(16,185,129,0.15);
    border: 1px solid #10b981;
    color: #6ee7b7;
    display: block;
}

.scale-quiz-feedback.error {
    background: rgba(239,68,68,0.15);
    border: 1px solid #ef4444;
    color: #fca5a5;
    display: block;
}

.scale-quiz-next-btn {
    width: 100%;
    margin-top: 0.75rem;
    display: none;
    padding: 0.85rem;
    border-radius: 10px;
    border: 1px solid #8b5cf6;
    background: rgba(139,92,246,0.1);
    color: #a78bfa;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.scale-quiz-next-btn:hover {
    background: rgba(139,92,246,0.2);
}

/* Score board */
.scale-score-board {
    text-align: center;
    padding: 2rem 1rem;
}

.scale-score-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.scale-score-val {
    font-size: 3rem;
    font-weight: 900;
    color: #10b981;
    margin-bottom: 0.5rem;
}

.scale-score-label {
    color: #94a3b8;
    font-size: 1rem;
    margin-bottom: 2rem;
}

.scale-restart-btn {
    background: #10b981;
    color: #0f172a;
    border: none;
    border-radius: 50px;
    padding: 0.85rem 2.5rem;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.scale-restart-btn:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* Score badge in header */
.scale-score-badge {
    background: #10b981;
    color: #0f172a;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

/* ══════════════════════════════════════════
   Interactive Element Styles (v2)
══════════════════════════════════════════ */

/* Interactive box container */
.sg-interactive-box {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(16,185,129,0.3);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1rem 0;
}

.sg-ibox-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #10b981;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

/* Slider calculator (stage 0) */
.sg-calc-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.6rem 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.sg-calc-label {
    font-size: 0.88rem;
    color: #94a3b8;
    white-space: nowrap;
    font-weight: 600;
}

.sg-calc-slider-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sg-calc-slider-wrap input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: #334155;
    outline: none;
    cursor: pointer;
}

.sg-calc-slider-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(16,185,129,0.5);
    transition: transform 0.15s;
}

.sg-calc-slider-wrap input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.sg-calc-val {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f8fafc;
    min-width: 90px;
    text-align: right;
    font-family: 'Outfit', monospace;
}

.sg-calc-result {
    text-align: center;
    padding: 1rem;
    background: #0f172a;
    border-radius: 10px;
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Number input + convert button (stage 1) */
.sg-number-input {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: #f8fafc;
    font-size: 1rem;
    font-family: 'Outfit', monospace;
    font-weight: 700;
    width: 120px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.sg-number-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}

.sg-convert-btn {
    background: #10b981;
    color: #0f172a;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.sg-convert-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.sg-result-display {
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.3);
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #a7f3d0;
    font-family: 'Outfit', monospace;
    animation: sgPop 0.3s ease;
}

@keyframes sgPop {
    0%   { transform: scale(0.95); opacity: 0.5; }
    100% { transform: scale(1);    opacity: 1;   }
}

/* Mini MCQ buttons (in-lesson quick check) */
.sg-mc-check {
    background: rgba(255,255,255,0.03);
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.sg-mini-opt {
    background: rgba(15,23,42,0.5);
    border: 1.5px solid #334155;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Outfit', monospace;
}

.sg-mini-opt:hover:not(:disabled) {
    border-color: #475569;
    background: rgba(71,85,105,0.3);
}

.sg-mini-opt.sg-mini-correct {
    background: rgba(16,185,129,0.2) !important;
    border-color: #10b981 !important;
    color: #6ee7b7 !important;
}

.sg-mini-opt.sg-mini-wrong {
    background: rgba(239,68,68,0.2) !important;
    border-color: #ef4444 !important;
    color: #fca5a5 !important;
}

/* Dropdown select (stage 2) */
.sg-select {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: #f8fafc;
    font-size: 0.9rem;
    font-family: 'Outfit', monospace;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.sg-select:focus {
    border-color: #10b981;
}

/* Conversion flow diagram (stage 3) */
.sg-conv-flow {
    flex-wrap: wrap;
}

.sg-conv-node {
    text-align: center;
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    font-size: 0.82rem;
    border: 1px solid;
    line-height: 1.6;
    min-width: 90px;
    transition: transform 0.2s;
}

.sg-conv-node:hover { transform: translateY(-3px); }

.sg-node-blue   { border-color: #3b82f6; background: rgba(59,130,246,0.1); color: #93c5fd; }
.sg-node-yellow { border-color: #f59e0b; background: rgba(245,158,11,0.1); color: #fcd34d; }
.sg-node-green  { border-color: #10b981; background: rgba(16,185,129,0.1); color: #6ee7b7; }

.sg-conv-arrows {
    color: #475569;
    font-size: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

/* Fill-in exercise (stage 3) */
.sg-fill-step {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.sg-step-label {
    color: #cbd5e1;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.sg-fill-input {
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    color: #f8fafc;
    font-size: 1rem;
    font-family: 'Outfit', monospace;
    font-weight: 700;
    width: 80px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.sg-fill-input:focus { border-color: #10b981; }

.sg-check-btn {
    background: rgba(16,185,129,0.15);
    border: 1px solid #10b981;
    border-radius: 8px;
    padding: 0.35rem 1rem;
    color: #6ee7b7;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.sg-check-btn:hover:not(:disabled) {
    background: rgba(16,185,129,0.3);
}

.sg-check-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.sg-fill-fb {
    width: 100%;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    margin-top: 0.3rem;
}

.sg-fill-fb.success {
    background: rgba(16,185,129,0.15);
    border: 1px solid #10b981;
    color: #6ee7b7;
}

.sg-fill-fb.error {
    background: rgba(239,68,68,0.12);
    border: 1px solid #ef4444;
    color: #fca5a5;
}

/* Mobile responsive adjustments */
@media (max-width: 600px) {
    .sg-calc-grid {
        grid-template-columns: 1fr;
    }
    .sg-calc-label { text-align: left; }
    .scale-quiz-opts { grid-template-columns: 1fr; }
    .sg-conv-flow { justify-content: center; }
    .scale-game-section { padding: 1.5rem 1rem; }
}
