/* ════════════════════════════════════════
   modules.css — stili aggiuntivi per le
   pagine dei singoli moduli del corso
   (da affiancare a Style.css)
   ════════════════════════════════════════ */

/* ─── Step badge ─── */
.step-badge {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--orange-dim);
    border: 1.5px solid rgba(234,118,0,0.4);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Space Mono', monospace;
    font-size: 13px; color: var(--orange); font-weight: 700;
    flex-shrink: 0;
}

/* ─── Info box ─── */
.info-box {
    background: rgba(234,118,0,0.07);
    border: 1px solid rgba(234,118,0,0.2);
    border-radius: 12px; padding: 16px 20px;
    font-size: 14px; color: #bbb; line-height: 1.6;
}
.info-box strong { color: var(--orange); }

/* ─── Warning box ─── */
.warn-box {
    background: rgba(231,76,60,0.07);
    border: 1px solid rgba(231,76,60,0.3);
    border-radius: 12px; padding: 14px 18px;
    font-size: 14px; color: #e0a0a0; line-height: 1.6;
}
.warn-box strong { color: #e74c3c; }

/* ─── Kbd ─── */
.kbd {
    display: inline-flex; align-items: center; justify-content: center;
    background: #333;
    border: 1.5px solid #555;
    border-bottom: 3px solid #444;
    border-radius: 6px;
    padding: 3px 8px;
    font-family: 'Space Mono', monospace;
    font-size: 11px; font-weight: 700;
    color: #ddd;
    min-width: 28px;
}
.kbd.highlight {
    background: var(--orange-dim);
    border-color: rgba(234,118,0,0.5);
    color: var(--orange);
    border-bottom-color: rgba(234,118,0,0.3);
}

/* ─── Axis buttons ─── */
.axis-btn {
    padding: 8px 16px; border-radius: 8px; border: 1.5px solid;
    font-family: 'Space Mono', monospace;
    font-size: 13px; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
}
.axis-x { border-color: #e74c3c; color: #e74c3c; background: rgba(231,76,60,0.1); }
.axis-x:hover, .axis-x.active { background: rgba(231,76,60,0.25); box-shadow: 0 0 12px rgba(231,76,60,0.3); }
.axis-y { border-color: #2ecc71; color: #2ecc71; background: rgba(46,204,113,0.1); }
.axis-y:hover, .axis-y.active { background: rgba(46,204,113,0.25); box-shadow: 0 0 12px rgba(46,204,113,0.3); }
.axis-z { border-color: #3498db; color: #3498db; background: rgba(52,152,219,0.1); }
.axis-z:hover, .axis-z.active { background: rgba(52,152,219,0.25); box-shadow: 0 0 12px rgba(52,152,219,0.3); }
.axis-free { border-color: var(--orange); color: var(--orange); background: var(--orange-dim); }
.axis-free:hover, .axis-free.active { background: rgba(234,118,0,0.25); box-shadow: 0 0 12px rgba(234,118,0,0.3); }

/* ─── Transform op buttons ─── */
.transform-op-btn {
    padding: 10px 20px; border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--bg-panel);
    color: #ccc;
    font-family: 'Space Mono', monospace;
    font-size: 14px; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
}
.transform-op-btn:hover, .transform-op-btn.active {
    border-color: var(--orange); color: var(--orange);
    background: var(--orange-dim);
}

/* ─── Mode / sub tabs ─── */
.mode-tab {
    padding: 10px 24px; border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--bg-panel);
    color: #888; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.mode-tab.active { border-color: var(--orange); color: white; background: var(--orange-dim); }

.sub-tab {
    padding: 7px 16px; border-radius: 6px;
    border: 1.5px solid var(--border);
    background: transparent; color: #666;
    font-size: 12px; font-weight: 700;
    font-family: 'Space Mono', monospace;
    cursor: pointer; transition: all 0.2s;
}
.sub-tab.active { border-color: var(--orange); color: var(--orange); background: var(--orange-dim); }

/* ─── Shortcut table ─── */
.shortcut-cat {
    font-family: 'Space Mono', monospace; font-size: 10px;
    color: var(--orange); letter-spacing: 1.5px; text-transform: uppercase;
    margin-top: 20px; margin-bottom: 4px; padding-left: 8px;
}
.shortcut-row {
    display: flex; align-items: center;
    padding: 10px 8px; gap: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer; transition: background 0.2s; border-radius: 6px;
}
.shortcut-row:hover { background: rgba(255,255,255,0.03); }
.shortcut-row .keys { display: flex; align-items: center; gap: 4px; flex-shrink: 0; min-width: 120px; }
.shortcut-plus { font-size: 12px; color: #555; }
.shortcut-desc { font-size: 13px; color: #aaa; flex: 1; }
.shortcut-detail {
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s;
    font-size: 12px; color: #888; line-height: 1.6;
    padding-left: 16px;
    border-left: 2px solid var(--orange-dim);
    margin-left: 8px;
}
.shortcut-detail.open { max-height: 120px; padding: 6px 8px 6px 16px; margin-bottom: 8px; }

/* ─── Quiz ─── */
.quiz-option {
    padding: 12px 16px; border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--bg-panel);
    cursor: pointer; transition: all 0.2s;
    font-size: 14px; color: #ccc;
}
.quiz-option:hover:not(.disabled) { border-color: rgba(234,118,0,0.5); background: var(--orange-dim); color: white; }
.quiz-option.correct { border-color: #2ecc71 !important; background: rgba(46,204,113,0.1) !important; color: #2ecc71; }
.quiz-option.wrong { border-color: #e74c3c !important; background: rgba(231,76,60,0.1) !important; color: #e74c3c; }
.quiz-option.disabled { cursor: default; }
.quiz-feedback {
    font-size: 13px; padding: 10px 14px;
    border-radius: 8px; margin-top: 8px; display: none; line-height: 1.5;
}
.quiz-feedback.correct { background: rgba(46,204,113,0.1); border: 1px solid rgba(46,204,113,0.3); color: #2ecc71; display: block; }
.quiz-feedback.wrong { background: rgba(231,76,60,0.1); border: 1px solid rgba(231,76,60,0.3); color: #e74c3c; display: block; }

/* ─── Numpad ─── */
.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 64px);
    gap: 8px;
}
.numpad-key {
    width: 64px;
    background: var(--bg-panel);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 10px 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.numpad-key:hover { border-color: var(--orange); background: var(--orange-dim); }
.numpad-key.active { border-color: var(--orange); background: var(--orange-dim); box-shadow: 0 0 14px rgba(234,118,0,0.3); }
.numpad-key .key-num { font-family: 'Space Mono', monospace; font-size: 18px; font-weight: 700; color: var(--orange); }
.numpad-key .key-label { font-size: 9px; color: #888; margin-top: 2px; line-height: 1.2; }

/* ─── 3D canvas wrappers ─── */
.canvas-3d {
    width: 100%; height: 280px;
    background: #111;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}
.canvas-3d canvas { width: 100%; height: 100%; display: block; }
.canvas-label {
    position: absolute; top: 12px; left: 12px;
    background: rgba(0,0,0,0.7);
    border: 1px solid var(--border);
    border-radius: 6px; padding: 4px 10px;
    font-family: 'Space Mono', monospace;
    font-size: 11px; color: #aaa;
    pointer-events: none;
}
.canvas-label-right {
    position: absolute; top: 12px; right: 12px;
    background: rgba(234,118,0,0.15);
    border: 1px solid rgba(234,118,0,0.3);
    border-radius: 6px; padding: 4px 10px;
    font-family: 'Space Mono', monospace;
    font-size: 11px; color: var(--orange);
    pointer-events: none;
}

/* ─── Numpad action desc — fixed height so layout doesn't jump ─── */
.numpad-action-box {
    height: 48px;
    display: flex; align-items: center;
    margin-top: 10px; padding: 0 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px; color: #666;
    font-family: 'Space Mono', monospace;
    line-height: 1.4;
}

/* ─── Platform / requirement cards ─── */
.req-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.2s;
}
.req-card:hover { border-color: rgba(234,118,0,0.3); }
.req-card ul { list-style: none; padding: 0; margin: 0; }
.req-card li { font-size: 13px; color: #aaa; padding: 3px 0; display: flex; align-items: baseline; gap: 8px; }
.req-card li .bullet { color: var(--orange); flex-shrink: 0; }

/* ─── TOC Sidebar ─── */
.toc-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 8px;
    color: #888; font-size: 13px;
    cursor: pointer; transition: all 0.2s;
    border-left: 2px solid transparent;
}
.toc-item:hover, .toc-item.active {
    color: var(--orange); border-left-color: var(--orange);
    background: var(--orange-dim);
}
.toc-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ─── Download buttons ─── */
.btn-green {
    display: inline-flex; align-items: center; gap: 8px;
    background: #27ae60; color: #fff; font-weight: 700;
    border-radius: 10px; padding: 11px 22px; font-size: 14px;
    text-decoration: none; border: none; cursor: pointer;
    transition: all 0.2s;
}
.btn-green:hover { background: #2ecc71; transform: translateY(-2px); }

.btn-ghost-sm {
    display: inline-flex; align-items: center; gap: 8px;
    background: transparent; color: #aaa; font-weight: 600;
    border-radius: 10px; padding: 10px 20px; font-size: 13px;
    text-decoration: none; border: 1.5px solid var(--border); cursor: pointer;
    transition: all 0.2s;
}
.btn-ghost-sm:hover { border-color: #aaa; color: #fff; transform: translateY(-2px); }

/* ─── Axis gizmo overlay ─── */
.axis-gizmo {
    position: absolute; bottom: 12px; right: 12px;
    display: flex; gap: 6px; flex-direction: column; align-items: flex-end;
}
.axis-gizmo-item { display: flex; align-items: center; gap: 6px; }
.axis-gizmo-label { font-size: 10px; font-family: 'Space Mono', monospace; }
.axis-gizmo-line { width: 28px; height: 2px; border-radius: 1px; }

/* ─── Section scroll offset ─── */
section[id] { scroll-margin-top: 80px; }

/* ─── Sidebar sticky ─── */
@media (min-width: 1024px) {
    .module-sidebar { position: sticky; top: 88px; }
}
@media (max-width: 1023px) {
    .sidebar-col { display: none; }
}
