/* ===========================
   FONT & BASE
=========================== */
body {
    font-family: 'Lexend', sans-serif;
    margin: 0;
    padding: 0;
    background: #e8edf4;
    color: #1b1b1b;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
}

/* ===========================
   NAVBAR
=========================== */
.navbar {
    background: #ffffff;
    padding: 18px 0;
    border-bottom: 1px solid #e2e2e2;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Fix mappa mentale su mobile */
@media (max-width: 768px) {
    #mindmap-container {
        width: 100% !important;
        height: 600px !important;
        display: block !important;
        overflow: visible !important;
        position: relative !important;
    }

    canvas {
        width: 100% !important;
        height: 600px !important;
    }

    .node {
        transform: scale(1) !important;
        opacity: 1 !important;
        position: absolute !important;
    }
}


.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 50px;
    height: 50px;
}

.logo-text {
    font-size: 26px;
    font-weight: 700;
}

/* NAV LINKS */
.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    font-size: 18px;
    color: #222;
    font-weight: 500;
    transition: 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #1f49ff;
}

/* ===========================
   TITOLI / INPUT
=========================== */
.lab-title {
    font-size: 44px;
    font-weight: 800;
    margin-top: 40px;
}

.lab-subtitle {
    font-size: 18px;
    color: #444;
    margin-bottom: 25px;
}

.input-area {
    width: 100%;
    height: 200px;
    padding: 12px;
    border-radius: 12px;
    border: 2px solid #d9d9d9;
    font-size: 16px;
    resize: vertical;
    margin-bottom: 16px;
}

/* BOTTONI */
.btn-primary {
    background: #1f49ff;
    color: white;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary:hover {
    background: #1638cc;
}

.btn-secondary {
    background: #ffffff;
    color: #1f49ff;
    padding: 10px 24px;
    border-radius: 12px;
    border: 2px solid #1f49ff;
    font-size: 15px;
    cursor: pointer;
}

/* ===========================
   LAVAGNA MAPPA
=========================== */
#mapWrapper {
    position: relative;
    margin: 35px auto;
    max-width: 1300px;
    min-height: 420px;
    padding: 40px 30px;
    border-radius: 35px;
    background: radial-gradient(circle at top left, #f4f7fb, #dde5f1);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    overflow: visible;
}

#mapContainer {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ROWS DELLA MAPPA
   row1: titolo centrale
   row2: 3–4 colonne concetti principali
*/
.map-row {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.map-row:nth-child(2) {
    gap: 80px;
    align-items: flex-start;
}

/* colonna concetto principale + secondari */
.map-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* SVG LINEE */
#mapLines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* LINEE (tipo “connettore”) */
.map-line {
    stroke: #cfd2da;
    stroke-width: 4;
    stroke-linecap: round;
    fill: none;
}

/* ===========================
   NODI (stile “cartellino”)
=========================== */
.map-node {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 26px;
    border-radius: 18px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    min-width: 230px;
    max-width: 320px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    border: none;
    user-select: none;
}

/* Titolo centrale – bianco */
.node-blue {
    background: #ffffff;
    color: #1f2933;
}

/* Concetti principali */
.node-green {
    background: #b8e4b4;
    color: #1f2933;
}

/* Concetti secondari */
.node-yellow {
    background: #ffe3a4;
    color: #1f2933;
}

/* eventuale azzurro (se serve altrove) */
.node-azzurro {
    background: #b8daf7;
    color: #1f2933;
}

/* Icona audio */
.node-audio-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #1f49ff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ===========================
   BOX SPIEGAZIONE / SCHEDA / QUIZ
=========================== */
.map-area {
    margin-top: 18px;
    background: #ffffff;
    border-radius: 18px;
    padding: 18px 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    font-size: 15px;
}

.quiz-question strong {
    display: block;
    margin-bottom: 4px;
}

.quiz-result {
    margin-top: 12px;
    font-weight: 600;
}

/* FOOTER */
.footer {
    margin-top: 40px;
    background: #ffffff;
    padding: 30px 0;
    text-align: center;
    font-size: 15px;
    border-top: 1px solid #e3e3e3;
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 900px) {

    #mapWrapper {
        padding: 24px 14px;
        margin: 24px auto;
    }

    .map-row {
        margin: 30px 0;
    }

    .map-row:nth-child(2) {
        flex-direction: column;
        gap: 26px;
    }

    .map-node {
        min-width: 220px;
        max-width: 280px;
        padding: 12px 20px;
        font-size: 16px;
    }

    .lab-title {
        font-size: 32px;
    }
}
