:root {
    --primary-color: #4CAF50;
    --secondary-color: #333;
    --accent-color: #e41e26;
    --text-color: #333;
    --light-text: #fff;
    --dark-bg: rgba(0, 0, 0, 0.7);
    --clock-bg: #222;
    --clock-highlight: #393939;
    --joke-bg: #fff;
    --border-radius: 10px;
    --box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}
.dino-test-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
}

/* Station selector styles */
.station-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.station-select {
    flex-grow: 1;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: white;
}

.station-button {
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.station-button:hover {
    background-color: #2980b9;
}

/* Update radio link style */
.radio-link {
    margin-top: 10px;
    text-align: center;
}

.dino-test-btn:hover {
    transform: scale(1.1);
}

.dino-test-btn:active {
    transform: scale(0.95);
}

/* Als je een speciaal icoon wil voor de knop */
.dino-test-btn img {
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
}

.dinosaur-popup {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, 100%);
    z-index: 99999;
    transition: transform 0.5s ease-out;
}

.dinosaur-popup.active {
    transform: translate(-50%, -50%);
}
  
.dinosaur-image {
    width: 400px; /* Groter maken */
    height: auto;
    transform: scaleX(-1); /* Flip horizontaal */
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.7));
}
  
  /* Animation for the dinosaur */
  @keyframes dinosaurEntry {
    0% { transform: translateY(100%); }
    70% { transform: translateY(-10%); }
    100% { transform: translateY(0); }
  }
  
  @keyframes dinosaurExit {
    0% { transform: translateY(0); }
    30% { transform: translateY(-10%); }
    100% { transform: translateY(100%); }
  }
/* Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    font-size: 16px;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-areas:
    "header header header"
    "world clock alarm"
    "world joke alarm"
    "world main alarm";
    grid-template-columns: 1fr 3fr 1fr;
    grid-template-rows: 50px min-content min-content auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--light-text);
    line-height: 1.6;
    transition: background-image 2s ease-in-out;
    
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Header */
.header {
    grid-area: header;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--dark-bg);
    z-index: 1000;
}

.fullscreen-btn, .home-link {
    background: none;
    border: none;
    color: var(--light-text);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.fullscreen-btn:hover, .home-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.home-link {
    text-decoration: none;
    font-size: 1rem;
    display: inline-block;
    padding: 0.5rem 1rem;
}

/* Sidebars */
.sidebar {
    padding: 1rem;
    background-color: var(--dark-bg);
    border-radius: var(--border-radius);
    margin: 1rem;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--box-shadow);
}

.left-sidebar {
    grid-area: world;
}

.right-sidebar {
    grid-area: alarm;
}

/* Main Content */
.main-content {
    grid-area: main;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    margin-top: 50px; 
    justify-content: flex-start;
}

.clock-container {
    grid-area: clock;
    position: relative;
    top: -50px; /* Adjust this value as needed */
    z-index: 10;
    margin-top: 0; /* Remove negative margin */
}
/* Flip Clock Styles */
.flip-clock {
    text-align: center;
    perspective: 400px;
    margin: 1rem auto;
    will-change: transform;
}

.flip-clock__piece {
    display: inline-block;
    margin: 0 0.5rem;
    will-change: transform;
}

.flip-clock__slot {
    font-size: 1rem;
    color: var(--light-text);
    margin-top: 0.5rem;
    display: block;
}

.card {
    display: block;
    position: relative;
    padding-bottom: 0.72em;
    font-size: 3.75rem;
    line-height: 0.95;
    will-change: transform;
}

.card__top,
.card__bottom,
.card__back::before,
.card__back::after {
    display: block;
    height: 0.72em;
    color: #ccc;
    background: var(--clock-bg);
    padding: 0.25em;
    border-radius: 0.15em 0.15em 0 0;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    width: 1.8em;
    transform: translateZ(0);
    will-change: transform, opacity;
}

.card__bottom {
    color: var(--light-text);
    position: absolute;
    top: 50%;
    left: 0;
    border-top: solid 1px #000;
    background: var(--clock-highlight);
    border-radius: 0 0 0.15em 0.15em;
    pointer-events: none;
    overflow: hidden;
}

.card__bottom::after {
    display: block;
    margin-top: -0.72em;
}

.card__back::before,
.card__bottom::after {
    content: attr(data-value);
}

.card__back {
    position: absolute;
    top: 0;
    height: 100%;
    left: 0%;
    pointer-events: none;
}

.card__back::before {
    position: relative;
    z-index: -1;
    overflow: hidden;
}

.flip .card__back::before {
    animation: flipTop 0.3s cubic-bezier(.37,.01,.94,.35);
    animation-fill-mode: both;
    transform-origin: center bottom;
}

.flip .card__back .card__bottom {
    transform-origin: center top;
    animation-fill-mode: both;
    animation: flipBottom 0.6s cubic-bezier(.15,.45,.28,1);
}

@keyframes flipTop {
    0% {
        transform: rotateX(0deg);
        z-index: 2;
    }
    0%, 99% {
        opacity: 0.99;
    }
    100% {
        transform: rotateX(-90deg);
        opacity: 0;
    }
}

@keyframes flipBottom {
    0%, 50% {
        z-index: -1;
        transform: rotateX(90deg);
        opacity: 0;
    }
    51% {
        opacity: 0.99;
    }
    100% {
        opacity: 0.99;
        transform: rotateX(0deg);
        z-index: 5;
    }
}

/* Analog Clock */
.analog-clock {
    width: 20vw;
    height: 20vw;
    min-width: 200px;
    min-height: 200px;
    max-width: 400px;
    max-height: 400px;
    border: 0.5rem solid var(--secondary-color);
    border-radius: 50%;
    margin: 1rem auto;
    position: relative;
    background-color: rgba(0, 0, 0, 0.5);
}

.clock-face {
    position: relative;
    width: 100%;
    height: 100%;
}

.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom;
    background-color: var(--light-text);
    border-radius: 5px;
}

.hour-hand {
    width: 8px;
    height: 30%;
    margin-left: -4px;
}

.minute-hand {
    width: 6px;
    height: 40%;
    margin-left: -3px;
}

.second-hand {
    width: 3px;
    height: 45%;
    margin-left: -1.5px;
    background-color: var(--accent-color);
}

.center-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    background-color: var(--light-text);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.number {
    position: absolute;
    width: 100%;
    height: 100%;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--light-text);
}

.number span {
    position: absolute;
    display: inline-block;
}

/* Position numbers */
.number-12 { top: 5%; left: 50%; transform: translateX(-50%); }
.number-1 { top: 10%; right: 25%; }
.number-2 { top: 25%; right: 10%; }
.number-3 { top: 50%; right: 5%; transform: translateY(-50%); }
.number-4 { bottom: 25%; right: 10%; }
.number-5 { bottom: 10%; right: 25%; }
.number-6 { bottom: 5%; left: 50%; transform: translateX(-50%); }
.number-7 { bottom: 10%; left: 25%; }
.number-8 { bottom: 25%; left: 10%; }
.number-9 { top: 50%; left: 5%; transform: translateY(-50%); }
.number-10 { top: 25%; left: 10%; }
.number-11 { top: 10%; left: 25%; }

/* Joke Container */
.joke-container {
    grid-area: joke;
    min-height: 150px; /* Set a fixed minimum height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    margin-top: 0;
}
.joke {
    width: 100%;
    min-height: 80px; /* Reserve space for 2 lines of text */
    margin-bottom: 10px;
    color: #ffffff;
    font-size: 1.2rem; /* Slightly smaller than x-large */
    font-weight: bold;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.jokebtn {
    display: flex;
    justify-content: center; /* Centreert de knop */
    width: 100%;
    border-radius: 100px;
    background-color: rgba(105, 105, 105, 0.521);
}

.joke-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Alarm Container */
.alarm-container {
    padding: 1rem;
    background-color: var(--dark-bg);
    border-radius: var(--border-radius);
    width: 100%;
    text-align: center;
}

.alarm-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.alarm-input {
    padding: 0.5rem;
    border-radius: 0.3rem;
    border: 1px solid #ccc;
    font-size: 1rem;
    width: 100%;
}

.alarm-button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.3rem;
    background-color: var(--primary-color);
    color: var(--light-text);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

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

#stop-alarm {
    background-color: var(--accent-color);
}

#stop-alarm:hover {
    background-color: #d32f2f;
}

#stop-alarm:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.standard-alarms {
    margin: 1rem 0;
    text-align: center;
}

.alarm-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.standard-alarm-btn {
    padding: 0.5rem 1rem;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 0.3rem;
    cursor: pointer;
    transition: var(--transition);
}

.standard-alarm-btn:hover {
    background-color: #e0e0e0;
}

.standard-alarm-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* World Times */
.world-times-container {
    margin-top: 1rem;
}

.world-time-item {
    margin: 0.2rem 0;
    padding: 0.2rem;
    border-bottom: 1px solid #444;
}

.world-time-city {
    font-weight: bold;
    color: var(--primary-color);
}

.world-time-time {
    font-family: monospace;
    display: block;
}

/* Radio Player */
.radio-player {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 9999;
    max-width: 300px;
    width: 90%;
}

.radio-toggle {
    width: 100%;
    background-color: #2e2e2e;
    color: rgb(255, 255, 255);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none;
}

.radio-content {
    background: rgba(88, 88, 88, 0.247);
    padding: 1rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.radio-link {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #555;
}

.radio-link a {
    color: rgba(255, 255, 255, 0.479);
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    body {
        grid-template-areas:
            "header header"
            "world alarm"
            "main main"
            "footer footer";
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto 1fr auto;
    }

    .sidebar {
        max-height: none;
        margin: 0.5rem;
    }
}

@media (max-width: 768px) {
    body {
        grid-template-areas:
            "header"
            "main"
            "world"
            "alarm"
            "footer";
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto auto auto;
    }

    .analog-clock {
        width: 60vw;
        height: 60vw;
    }

    .card {
        font-size: 2.5rem;
    }

    .alarm-controls {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .alarm-input {
        flex: 1 1 100%;
    }

    .alarm-button {
        flex: 1 1 45%;
    }

    .radio-player {
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .card {
        font-size: 2rem;
    }

    .number {
        font-size: 1rem;
    }

    .hand {
        border-radius: 3px;
    }

    .hour-hand {
        width: 6px;
        margin-left: -3px;
    }

    .minute-hand {
        width: 4px;
        margin-left: -2px;
    }

    .second-hand {
        width: 2px;
        margin-left: -1px;
    }

    .center-dot {
        width: 12px;
        height: 12px;
    }

    .radio-player {
        width: calc(100% - 2rem);
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}