/* ============================================================
   Global Layout & Typography
   ============================================================ */

body {
    margin: 0;
    padding: 0;
    background: #000;
    color: #fff;
    font-family: "Segoe UI", Arial, sans-serif;
}

h1.title {
    text-align: center;
    font-size: 2.4rem;
    margin-top: 1rem;
}

h2 {
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

h3 {
    margin-top: 0.8rem;
}

/* ============================================================
   Builder Section
   ============================================================ */

#builder {
    padding: 1rem;
    background: #0c0c0c;
    border-bottom: 2px solid #222;
}

.builder-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.builder-panel {
    flex: 1;
    min-width: 260px;
    background: #111;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #333;
}

/* Ingredient Buttons */

.ingredient-buttons button {
    margin: 0.25rem;
    padding: 0.5rem 0.7rem;
    background: #222;
    color: #fff;
    border: 1px solid #555;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.15s;
}

.ingredient-buttons button:hover {
    background: #3a3a3a;
}

/* Component Readout */

.component-readout {
    background: #1b1b1b;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #333;
}

/* Finalize Button */

.finalize-btn {
    margin-top: 0.7rem;
    width: 100%;
    padding: 0.6rem;
    background: #0080ff;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
}

.finalize-btn:hover {
    background: #0a92ff;
}

/* ============================================================
   Created Fireworks List
   ============================================================ */

.firework-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.firework-list li {
    padding: 0.5rem;
    margin-bottom: 0.4rem;
    background: #222;
    border-left: 4px solid #0077ff;
    border-radius: 6px;
    cursor: grab;
    user-select: none;
}

.firework-list li:active {
    cursor: grabbing;
}

.fw-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px;
}

.fw-delete {
    background: #aa0000;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.fw-delete:hover {
    background: #dd0000;
}


/* Modern Select Box */
select.firework-type {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-color: #ffffff;
    border: 2px solid #0080ff;
    border-radius: 6px;
    padding: 8px 35px 8px 12px;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    color: #333;
    transition: 0.2s;
    background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 20px;
    width: 200px;
}

select.firework-type:hover {
    border-color: #0a92ff;
}

select.firework-type:focus {
    border-color: #005fcc;
    box-shadow: 0 0 4px rgba(0, 128, 255, 0.6);
}

/* ============================================================
   Scenes
   ============================================================ */

#scenes {
    padding: 1rem;
}

.scene-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.scene-slot {
    width: 30%;
    min-height: 130px;
    background: #111;
    border: 2px dashed #444;
    border-radius: 10px;
    padding: 0.5rem;
    text-align: center;
    transition: 0.2s;
}

.scene-slot:hover {
    border-color: #888;
}

.scene-slot .scene-firework {
    background: #222;
    padding: 0.4rem;
    margin: 0.3rem 0;
    border-radius: 6px;
    border-left: 4px solid #ffa200;
    cursor: grab;
}

.scene-note {
    text-align: center;
    opacity: 0.8;
    font-size: 0.9rem;
}

.show-controls {
    display: flex;
    justify-content: center;
    gap: 15px;        /* spacing between buttons */
    margin-top: 15px;
    margin-bottom: 15px;
}

/* Match button style */
.start-btn, .stop-btn {
    padding: 0.7rem 1.4rem;
    font-size: 1.05rem;
    border-radius: 6px;
    cursor: pointer;
    border: none;
}

/* Start Button Style */
.start-btn {
    background: #0080ff;
    color: white;
}
.start-btn:hover {
    background: #0a92ff;
}

/* Stop Button Style */
.stop-btn {
    background: #cc0000;
    color: white;
}
.stop-btn:hover {
    background: #e60000;
}

/* Disabled Style (used when running) */
.start-btn.disabled,
.stop-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.start-btn.disabled {
    background: #888888 !important;   /* grey background */
    color: #f0f0f0 !important;        /* lighter text */
    cursor: not-allowed;
    opacity: 0.6;
}

.start-btn.disabled:hover {
    background: #888888 !important;
}

/* Toggle Switch Wrapper */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    justify-content: center;
    margin-top: 6px;
}

/* Hide default checkbox */
.toggle-wrapper input[type="checkbox"] {
    height: 0;
    width: 0;
    visibility: hidden;
}

/* Toggle background track */
.toggle-wrapper label {
    cursor: pointer;
    width: 48px;
    height: 24px;
    background: #ccc;
    display: block;
    border-radius: 24px;
    position: relative;
    transition: 0.2s;
}

/* Toggle circle */
.toggle-wrapper label:after {
    content: "";
    width: 20px;
    height: 20px;
    background: #fff;
    position: absolute;
    top: 2px;
    left: 2px;
    border-radius: 50%;
    transition: 0.2s;
    box-shadow: 0 0 3px rgba(0,0,0,0.2);
}

/* Checked state: ON */
.toggle-wrapper input:checked + label {
    background: #0080ff;
}

.toggle-wrapper input:checked + label:after {
    left: calc(100% - 2px);
    transform: translateX(-100%);
}


/* ============================================================
   Sky / Stage Section
   ============================================================ */

#stage-section {
    margin-top: 1rem;
}

#sky {
    height: 580px; /* ★ higher sky for long-lasting fireworks */
    position: relative;
    background:
        url("../img/skyline.png") repeat-x bottom,
        linear-gradient(to top, #000 5%, #001020 60%, #002235 100%);
    background-size: auto 160px, 100% 100%;
    border-top: 2px solid #222;
    box-shadow: 0 -4px 12px #000 inset;
}

/* Transparent canvas on top of sky */

#stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ============================================================
   Responsive Design
   ============================================================ */

@media (max-width: 800px) {
    .scene-slot {
        width: 32%;
    }
}

@media (max-width: 600px) {
    .builder-container {
        flex-direction: column;
    }
    .scene-container {
        flex-direction: column;
        align-items: center;
    }
    .scene-slot {
        width: 90%;
    }
}



