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

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #98FB98 100%);
    min-height: calc(100vh + 600px); /* Just enough space for main container + controls */
    padding: 0;
    display: flex;
    flex-direction: column;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 1400px;
    width: calc(100% - 40px);
    margin: 0 auto;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

h1 { display: none; }

.main-content {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: space-between;
}

.traffic-light-section, .hourglass-section, .silence-section, .chalkboard-section {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

h2 { display: none; }

/* Stoplicht styling */
.traffic-light {
    background: #333;
    width: 160px;
    height: 400px;
    border-radius: 80px;
    margin: 0 auto 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.light {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin: 0 auto;
    opacity: 0.3;
    transition: all 0.3s ease;
    border: 4px solid #555;
}

.light.active {
    opacity: 1;
    box-shadow: 0 0 20px currentColor;
}

.light.red {
    background: #ff4444;
}

.light.yellow {
    background: #ffaa00;
}

.light.green {
    background: #44ff44;
}

.status-text {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 10px;
    margin-top: 10px;
}

/* Stilte styling */
.silence-image {
    width: 300px;
    height: 300px;
    object-fit: contain;
}

/* Zandloper styling */
.container-glass {
    position: relative;
    height: 400px;
    width: 200px;
    margin: 0 auto;
    overflow: hidden;
}

.glass {
    height: 100%;
    background-image: url('zandloper.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    transform: translateY(-4.5px);
}

.get-hourglass {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.hourglass-container {
    margin-bottom: 30px;
}

.hourglass {
    width: 180px;
    height: 300px;
    margin: 0 auto;
    position: relative;
    background: #8B4513;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.top-half, .bottom-half {
    position: absolute;
    width: 100%;
    height: 50%;
    overflow: hidden;
}

.top-half {
    top: 0;
    border-radius: 10px 10px 0 0;
}

.bottom-half {
    bottom: 0;
    border-radius: 0 0 10px 10px;
}

.middle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: #8B4513;
    border-radius: 50%;
    z-index: 2;
}

.sand {
    position: absolute;
    width: 100%;
    background: #D2B48C;
    transition: height 1s linear;
}

#top-sand {
    top: 0;
    height: 100%;
}

#bottom-sand {
    bottom: 0;
    height: 0%;
}

/* Controls styling */
.controls-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 1400px;
    width: calc(100% - 40px);
    margin: calc(100vh + 20px) auto 20px auto; /* Start controls after viewport height + some spacing */
    position: relative;
    z-index: 5;
}

.controls-content h3 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: bold;
}

.controls {
    margin-bottom: 20px;
}

.task-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 10px;
    margin-top: 15px;
}

.task-control-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.task-control-item label {
    font-size: 0.9em;
    font-weight: bold;
    color: #333;
}

.task-control-item select {
    padding: 6px 10px;
    font-size: 0.9em;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    background: white;
    cursor: pointer;
    min-width: 180px;
    text-transform: capitalize;
}

.task-control-item select:focus {
    outline: none;
    border-color: #4CAF50;
}

.notes {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.notes label {
    font-size: 0.85em;
    font-weight: normal;
    color: #666;
}

.notes textarea {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.9em;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    resize: vertical;
}

.notes textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.time-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.time-controls input[type="number"] {
    width: 50px;
    padding: 4px 6px;
    font-size: 0.9em;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
}

.time-controls span {
    font-size: 0.9em;
    color: #333;
    font-weight: bold;
}

button {
    padding: 6px 12px;
    font-size: 0.9em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.3s ease;
}

#global-start {
    background: #4CAF50;
    color: white;
}

#global-start:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
}

#global-stop {
    background: #f44336;
    color: white;
}

#global-stop:hover:not(:disabled) {
    background: #da190b;
    transform: translateY(-2px);
}

#global-reset {
    background: #888;
    color: #fff;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.timer-display {
    font-size: 2.5em;
    font-weight: bold;
    color: #333;
    background: #f0f0f0;
    padding: 15px;
    border-radius: 15px;
    border: 3px solid #ddd;
    margin-top: 10px;
    font-family: 'Courier New', monospace;
}

/* Krijtbord styling */
.chalkboard {
    position: relative;
    background-color: #3d6b1f;
    background-image: 
        /* Houten border effect */
        linear-gradient(90deg, 
            #8B4513 0%, 
            #A0522D 5%, 
            #8B4513 10%, 
            transparent 10%, 
            transparent 90%,
            #8B4513 90%,
            #A0522D 95%,
            #8B4513 100%),
        linear-gradient(0deg, 
            #8B4513 0%, 
            #A0522D 5%, 
            #8B4513 10%, 
            transparent 10%, 
            transparent 90%,
            #8B4513 90%,
            #A0522D 95%,
            #8B4513 100%);
    padding: 20px;
    border-radius: 5px;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chalkboard::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    background: 
        /* Groene krijtbord achtergrond met textuur */
        linear-gradient(135deg, #2d5016 0%, #3d6b1f 50%, #2d5016 100%),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.02) 2px,
            rgba(255, 255, 255, 0.02) 4px
        );
    border-radius: 3px;
    box-shadow: 
        inset 0 0 30px rgba(0, 0, 0, 0.3),
        inset 0 0 100px rgba(0, 0, 0, 0.2);
}

.chalkboard::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    background: 
        radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
    pointer-events: none;
}

.chalkboard-content {
    position: relative;
    z-index: 1;
    color: #f0f0e8;
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Marker Felt', cursive, sans-serif;
    text-align: center;
    padding: 30px;
    min-width: 280px;
    min-height: 200px;
    text-shadow: 
        1px 1px 2px rgba(255, 255, 255, 0.1),
        0 0 10px rgba(255, 255, 255, 0.05);
}

.task-item {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.task-item:last-child {
    margin-bottom: 0;
}

.task-number {
    font-size: 1.8em;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 
        2px 2px 3px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(255, 255, 255, 0.2);
    min-width: 30px;
    padding-top: 5px;
}

.task-display {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    padding: 10px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    flex: 1;
}

.task-display img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    border-radius: 3px;
}


.task-display-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.task-notes {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.05em;
    white-space: pre-wrap;
    text-shadow: 
        1px 1px 2px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(255, 215, 0, 0.3);
    margin-top: 5px;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        width: calc(100% - 20px);
        padding: 20px;
        margin: 0 auto;
        max-height: calc(100vh - 20px);
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .main-content {
        flex-direction: column;
        gap: 30px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .traffic-light {
        width: 140px;
        height: 340px;
    }
    
    .light {
        width: 90px;
        height: 90px;
    }
    
    .container-glass {
        height: 300px;
        width: 150px;
    }
    
    .hourglass {
        width: 100px;
        height: 160px;
    }
    
    .timer-display {
        font-size: 2em;
    }
    
    .silence-image {
        width: 225px;
        height: 225px;
    }
    
    .chalkboard-content {
        padding: 20px;
        min-width: 200px;
    }
    
    .task-number {
        font-size: 1.4em;
        min-width: 25px;
    }
    
    .task-display {
        min-height: 60px;
    }
    
    .task-display img {
        max-height: 80px;
    }
    
    .task-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .task-control-item {
        width: 100%;
        align-items: stretch;
    }
    
    .task-control-item select {
        min-width: 100%;
    }
    
    .controls-container {
        width: calc(100% - 20px);
        padding: 20px;
        margin: calc(100vh + 10px) auto 10px auto;
    }
    
    .controls-content h3 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
}

/* Scroll indicator styling */
.scroll-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: 3px solid #4CAF50;
    padding: 0 20px;
}

.scroll-indicator.visible {
    opacity: 1;
    visibility: visible;
    animation: bounce 2s infinite;
}

.scroll-indicator:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.scroll-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scroll-text {
    font-size: 14px;
    color: #4CAF50;
    font-weight: bold;
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

.scroll-arrow {
    font-size: 20px;
    color: #4CAF50;
    font-weight: bold;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Responsive scroll indicator */
@media (max-width: 768px) {
    .scroll-indicator {
        width: 160px;
        height: 50px;
        bottom: 20px;
    }
    
    .scroll-text {
        font-size: 12px;
    }
    
    .scroll-arrow {
        font-size: 18px;
    }
}
