/* US States Completion Map MicroSim Stylesheet */

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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: aliceblue;
}

/* The whole MicroSim is a fixed-height column so it always fits its iframe.
   Keep this height equal to CANVAS_HEIGHT in remaining-states.js. */
main {
    height: 640px;
    display: flex;
    flex-direction: column;
    background: aliceblue;
    overflow: hidden;
}

h2 {
    text-align: center;
    margin: 8px 0 2px 0;
    font-size: 18px;
    color: darkslategray;
}

.subtitle {
    text-align: center;
    font-size: 13px;
    color: dimgray;
    margin-bottom: 6px;
}

#map {
    flex: 1;
    min-height: 0;
    width: 100%;
    background: lightcyan;   /* water color: the map has no tile basemap */
}

/* ---------- Explore mode: state facts ---------- */
.info-strip {
    background: white;
    border-top: 1px solid silver;
    padding: 6px 12px;
    height: 84px;            /* same height as the quiz panel so the map never jumps */
    overflow: hidden;
    font-size: 13px;
    line-height: 1.4;
    color: darkslategray;
}

.info-strip.hidden { display: none; }

.info-strip .placeholder {
    color: dimgray;
    font-style: italic;
    text-align: center;
    padding-top: 24px;
}

.info-strip h4 {
    display: inline;
    font-size: 16px;
    color: black;
}

.region-chip {
    display: inline-block;
    font-size: 11px;
    font-weight: bold;
    padding: 1px 8px;
    border-radius: 8px;
    margin-left: 6px;
    color: black;
    vertical-align: middle;
}

.chapter-chip {
    display: inline-block;
    font-size: 11px;
    font-weight: bold;
    padding: 1px 8px;
    border-radius: 8px;
    margin-left: 6px;
    color: black;
    background: gold;
    vertical-align: middle;
}

.stat { font-weight: bold; color: black; }

/* ---------- Quiz mode ---------- */
.quiz-panel {
    background: lightyellow;
    border-top: 1px solid silver;
    padding: 6px 12px;
    height: 84px;
    overflow: hidden;
    text-align: center;
}

.quiz-panel.hidden { display: none; }

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 20px;
}

.quiz-progress { font-size: 12px; font-weight: bold; color: darkgreen; }

.stars-display { display: flex; gap: 2px; }

.gold-star {
    font-size: 16px;
    color: goldenrod;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s;
}

.gold-star.animated { opacity: 1; transform: scale(1); }

.quiz-question { font-size: 15px; font-weight: bold; color: black; }

.quiz-feedback { font-size: 13px; font-weight: bold; min-height: 18px; }
.quiz-feedback.correct { color: darkgreen; }
.quiz-feedback.incorrect { color: firebrick; }

.quiz-option {
    padding: 4px 12px;
    margin: 2px 4px 0 4px;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid darkgreen;
    background: white;
    color: darkgreen;
    border-radius: 4px;
    cursor: pointer;
}

.quiz-option:hover { background: honeydew; }

/* ---------- Progress tracker ---------- */
.progress-row {
    background: white;
    padding: 4px 12px 6px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-label {
    font-size: 12px;
    font-weight: bold;
    color: darkslategray;
    white-space: nowrap;
}

.progress-track {
    flex: 1;
    height: 12px;
    background: gainsboro;
    border: 1px solid silver;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: mediumseagreen;
    transition: width 0.3s;
}

/* ---------- Controls ---------- */
.controls-container {
    background: white;
    padding: 6px 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 1px solid silver;
}

.control-label {
    font-size: 12px;
    font-weight: bold;
    color: darkslategray;
}

.control-divider {
    width: 1px;
    height: 22px;
    background: silver;
}

.control-btn {
    padding: 5px 10px;
    font-size: 12px;
    border: 2px solid darkgreen;
    background: white;
    color: darkgreen;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.control-btn:hover { background: honeydew; }

.control-btn.active {
    background: darkgreen;
    color: white;
}

.control-btn.view-btn {
    border-color: steelblue;
    color: steelblue;
}

.control-btn.view-btn:hover { background: aliceblue; }

/* ---------- Legend ---------- */
.legend-container {
    background: white;
    padding: 5px 10px;
    border-top: 1px solid gainsboro;
}

.legend-items {
    display: flex;
    justify-content: center;
    gap: 4px 12px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: darkslategray;
}

.legend-item i {
    width: 14px;
    height: 14px;
    margin-right: 4px;
    border-radius: 2px;
    border: 1px solid dimgray;
}

.legend-item .star { color: crimson; margin-right: 3px; font-size: 14px; }

.hover-instruction {
    text-align: center;
    font-size: 12px;
    color: dimgray;
    padding: 4px;
    font-style: italic;
    background: white;
}

/* State-name tooltips are hidden during the quiz so they do not give away answers */
main.quiz-mode .leaflet-tooltip.state-tip { display: none; }

/* ---------- Map markers ---------- */
.capital-marker {
    background: none;
    border: none;
}

.capital-marker div {
    font-size: 20px;
    line-height: 20px;
    color: crimson;
    text-align: center;
    text-shadow: 0 0 2px white, 0 0 2px white, 0 0 2px white;
}

.load-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 14px 18px;
    border: 1px solid silver;
    border-radius: 8px;
    font-size: 13px;
    z-index: 1000;
}

/* ---------- Celebration ---------- */
.celebration-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.exploding-star {
    position: absolute;
    animation: explode 1.5s ease-out forwards;
}

@keyframes explode {
    0% { transform: scale(0); opacity: 1; }
    60% { opacity: 1; }
    100% { transform: scale(1.4) translateY(-80px); opacity: 0; }
}

@media (max-width: 560px) {
    .control-divider { display: none; }
}
