/* Algemene body en container styling */
body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100vw;
    background-color: #e0f7fa;
    margin: 0;
    overflow: hidden;
}

/* Screen management */
.screen {
    background-color: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: absolute;
    transition: opacity 0.5s ease, transform 0.5s ease;
    opacity: 0;
    transform: scale(0.95);
    visibility: hidden;
    display: none;
}

.screen.active {
    opacity: 1;
    transform: scale(1);
    visibility: visible;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Knoppen algemeen */
button {
    background-color: #ff9800;
    color: white;
    border: none;
    margin: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.1s ease;
    flex-shrink: 0;
}

button:hover {
    background-color: #f57c00;
    transform: translateY(-2px);
}

button.secondary {
    background-color: #4CAF50;
}

button.secondary:hover {
    background-color: #45a049;
}

/* NIEUWE KNOP: Keuzemenu */
.keuzemenu-knop {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: #00008B; /* Donkerblauw */
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    z-index: 100;
}
.keuzemenu-knop:hover {
    background-color: #0000CD; /* Medium blauw */
}


/* Styling voor thema/tijd keuze scherm */
#themeSelectionScreen {
    width: 90%;
    max-width: 800px; /* Iets breder voor meer knoppen */
    min-height: 400px;
}

#themeSelectionScreen h1, #themeSelectionScreen h2 {
    color: #333;
}

.theme-buttons, .time-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px; /* Kleinere tussenruimte */
    margin: 20px 0;
}

.theme-buttons button {
    padding: 12px 25px;
    font-size: 1.2em;
    min-width: 180px;
}

/* AANGEPASTE styling voor de 60 tijd-knoppen */
.time-buttons button {
    padding: 8px;
    font-size: 1em;
    min-width: 50px;
    flex-grow: 1;
}


/* Styling voor het timer scherm */
#timerScreen {
    width: 100vw;
    height: 100vh;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

#timerScreen .timer-container {
    width: 100%;
    height: 100%;
    padding: 2vh 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.current-theme-display {
    font-size: clamp(2em, 4vw, 3em);
    color: #6200EE;
    font-weight: bold;
    margin-top: 40px;
}

.side-controls {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.side-controls .control-button {
    padding: clamp(10px, 1.5vw, 18px) clamp(12px, 2.5vw, 30px);
    font-size: clamp(0.9em, 2vw, 1.3em);
    min-width: 150px;
}

.main-visual-area {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
    min-height: 400px;
}

.visual-container {
    display: none;
}

.visual-container.active {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    height: 100%;
}

.countdown {
    font-size: clamp(3em, 6vw, 5em);
    font-weight: bold;
    color: #4CAF50;
}

.timer-message {
    font-size: clamp(1.5em, 3vw, 2.5em);
    font-weight: bold;
    color: #e91e63;
    min-height: 1.5em;
}

/* --- Regenboog Specifiek --- */
.rainbow-svg-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 500px;
    margin: 0 auto;
}
.rainbow-svg { position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; overflow: visible; }
.rainbow-path { fill: none; stroke-width: 32; stroke-linecap: round; transition: stroke-dashoffset 0.5s linear; }
.rainbow-path.red    { stroke: #ff0000; }
.rainbow-path.orange { stroke: #ff7f00; }
.rainbow-path.yellow { stroke: #ffff00; }
.rainbow-path.green  { stroke: #00ff00; }
.rainbow-path.blue   { stroke: #0000ff; }
.rainbow-path.indigo { stroke: #4b0082; }
.rainbow-path.violet { stroke: #8b00ff; }
.pot-image, .cloud { position: absolute; z-index: 15; width: clamp(240px, 28vw, 320px); height: auto; }
.pot-image { bottom: -80px; right: 15%; transform: translateX(30%); }
.cloud { bottom: -80px; left: 13%; transform: translateX(-30%); }
.gold-image { position: absolute; bottom: 60px; right: 16%; transform: translateX(25%); width: clamp(120px, 22vw, 220px); z-index: 16; opacity: 0; transition: opacity 0.5s ease-in-out; }
.gold-image.visible { opacity: 1; }

/* --- Ster Specifiek --- */
.growing-star {
    position: absolute;
    width: 180px;
    height: auto;
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0.5;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.growing-star.animate {
    animation: groei-per-minuut 60s linear forwards;
}

@keyframes groei-per-minuut {
    from {
        transform: translate(-50%, -50%) scale(0.1);
        opacity: 0.5;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

#finalStar {
    position: absolute;
    width: 800px;
    height: 800px;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0);
    transition: opacity 0.5s ease, transform 0.5s ease, visibility 0s 0.5s;
    left: 50%;
    top: 50%;
    pointer-events: none; /* Voeg deze regel toe */
}

#finalStar.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#finalStar.animate {
    animation: rotateFinalStar 2s linear infinite 0.5s;
}

@keyframes rotateFinalStar {
    from { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
    to { transform: translate(-50%, -50%) scale(1) rotate(360deg); }
}

/* --- Aquarium Specifiek --- */
#aquariumContainer {
    position: relative;
    overflow: hidden;
}

.fish {
    position: absolute;
    width: 80px;
    height: auto;
    transition: opacity 0.5s ease;
}

#treasureChestClosed, #treasureChestOpen {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: auto;
    z-index: 10;
    transition: opacity 0.5s ease;
}

#treasureChestOpen {
    opacity: 0;
}

/* Specifieke achtergrond voor de aquarium-timer */
body.theme-aquarium #timerScreen {
    background-image: url('klok_afbeeldingen/aquarium.png');
    background-size: 150%;
    background-position: center;
    filter: brightness(120%);
}

/* Roterende gouden munt */
.big-gold-coin {
    position: absolute;
    width: 200px;
    height: 200px;
    top: 25%;
    left: 50%;
    z-index: 20;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.big-gold-coin.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.big-gold-coin.animate {
    animation: rotateCoin 2s linear infinite 0.5s;
}

@keyframes rotateCoin {
    from { transform: translate(-50%, -50%) scale(1) rotateY(0deg); }
    to { transform: translate(-50%, -50%) scale(1) rotateY(360deg); }
}

/* --- AANPASSINGEN VOOR VOLLEDIG SCHERM LAYOUT --- */

body.theme-aquarium #timerScreen .timer-container {
    position: relative;
}

body.theme-aquarium .current-theme-display,
body.theme-aquarium .side-controls,
body.theme-aquarium .countdown,
body.theme-aquarium .timer-message {
    position: absolute;
    left: 50%;
    width: auto;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    z-index: 10;
}

body.theme-aquarium .current-theme-display {
    top: 2%;
    transform: translateX(-50%);
    font-size: clamp(2em, 4vw, 3em);
}

body.theme-aquarium .side-controls {
    top: 15%;
    transform: translateX(-50%);
}

/* NIEUWE STIJL VOOR DIGITALE KLOK IN AQUARIUM THEMA */
body.theme-aquarium .countdown {
    top: 75%; /* Boven positie, pas aan indien nodig */
    left: 50%; /* Om te centreren */
    transform: translateX(-50%); /* Houdt de klok gecentreerd */

    background-color: rgba(255, 255, 255, 0.9); /* Witte box met lichte transparantie */
    color: #3498db; /* Blauwe cijfers */
    padding: 8px 18px; /* Ruimte binnen de box */
    border-radius: 15px; /* Afgeronde hoeken */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* Lichte schaduw voor diepte */
    
    font-size: clamp(2.5em, 5vw, 4em); /* Groter lettertype */
    font-weight: bold; /* Vetgedrukte cijfers */
    text-align: center; /* Zorgt ervoor dat de cijfers in het midden van de box staan */
    
    z-index: 11; /* Zorg ervoor dat het bovenaan andere elementen blijft */
    width: fit-content; /* De breedte past zich aan de inhoud aan */
    white-space: nowrap; /* Voorkomt dat de tijd op meerdere regels springt */
}

body.theme-aquarium .timer-message {
    bottom: 30px;
    font-size: clamp(1.5em, 2.5vw, 2em);
    z-index: 11;
    transform: translateX(10%);
}

body.theme-aquarium .main-visual-area {
    position: absolute;
    top: 25%;
    height: 75%;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 1;
}
/* Specifieke achtergrond voor de regenboog-timer */
body.theme-rainbow #timerScreen {
    background-color: #add8e6; /* Lichtblauwe achtergrond */
}
/* Specifieke achtergrond voor de sterren-timer */
body.theme-star #timerScreen {
    background-color: #1d025c; /* Of #4B0082, of een andere kleur */
}
/* Maak tekst wit op de donkere achtergrond van het sterren-thema */
body.theme-star .current-theme-display,
body.theme-star .countdown,
body.theme-star .timer-message {
    color: white;
}