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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

body.dark-mode {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #fff;
}

.initially-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-20px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#mainApp {
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease;
}

/* Header Controls */
.header-controls {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

/* Hamburger Menu */
.hamburger-menu {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.hamburger-menu span {
    width: 20px;
    height: 2px;
    background: #333;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.dark-mode .hamburger-menu {
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.dark-mode .hamburger-menu span {
    background: #fff;
}

.hamburger-menu:hover {
    transform: scale(1.05);
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Show hamburger only on mobile */
@media (min-width: 769px) {
    .hamburger-menu {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .hamburger-menu {
        display: flex !important;
    }
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 20px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.dark-mode .mobile-menu-content {
    background: rgba(30, 30, 30, 0.95);
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.dark-mode .mobile-menu-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.mobile-menu-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.dark-mode .mobile-menu-header h3 {
    color: #fff;
}

.close-menu {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.dark-mode .close-menu {
    color: #ccc;
}

.close-menu:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.dark-mode .close-menu:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Mobile Voice Pack Selector */
.mobile-voice-pack-selector {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.dark-mode .mobile-voice-pack-selector {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.mobile-voice-pack-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 12px;
}

.dark-mode .mobile-voice-pack-selector label {
    color: #fff;
}

.mobile-voice-pack-selector select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dark-mode .mobile-voice-pack-selector select {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.mobile-voice-pack-selector select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Mobile Volume Controls */
.mobile-volume-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-volume-control {
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dark-mode .mobile-volume-control {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.mobile-volume-control label {
    font-weight: 500;
    color: #555;
    font-size: 12px;
}

.dark-mode .mobile-volume-control label {
    color: #fff;
}

.volume-toggle-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.volume-toggle-button[data-enabled="false"] {
    background: #6c757d;
}

/* Desktop Only Controls */
.desktop-only {
    display: flex;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    /* Hide all desktop header controls on mobile */
    .header-controls {
        display: none !important;
    }
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    top: 140px; /* Always positioned below the volume controls */
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 9999;
}

/* Mobile specific positioning */
@media (max-width: 768px) {
    .dark-mode-toggle {
        top: 20px; /* Same height as hamburger menu */
        right: 20px; /* Against the right wall when skip button is not visible */
        transition: right 0.3s ease; /* Smooth transition when skip button appears */
    }
    
    /* Move dark mode button left when skip button is visible */
    .skip-button.show ~ .dark-mode-toggle {
        right: 80px; /* Move left to make room for skip button */
    }
}

.dark-mode .dark-mode-toggle {
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
}

/* Skip Button */
.skip-button {
    position: fixed;
    top: 140px; /* Always positioned below the volume controls */
    right: 80px; /* Next to dark mode toggle */
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

/* Mobile specific positioning */
@media (max-width: 768px) {
    .skip-button {
        top: 20px; /* Same height as hamburger menu */
        left: 80px; /* Left side, next to hamburger menu */
    }
}

.skip-button.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.dark-mode .skip-button {
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.skip-button:hover {
    transform: scale(1.1);
}

.skip-button:active {
    transform: scale(0.95);
}

.voice-pack-selector {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.dark-mode .voice-pack-selector {
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.voice-pack-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    transition: all 0.3s ease;
}

.dark-mode .voice-pack-selector label {
    color: #fff;
}

.voice-pack-selector select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dark-mode .voice-pack-selector select {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.voice-pack-selector select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.volume-controls {
    display: flex;
    gap: 30px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.dark-mode .volume-controls {
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.volume-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.volume-control label {
    font-size: 12px;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.dark-mode .volume-control label {
    color: #fff;
}

.volume-control input[type="range"] {
    width: 100px;
    height: 20px; /* Increased height for better touch area */
    border-radius: 3px;
    background: transparent;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    z-index: 2; /* Ensure slider is above track */
}

/* WebKit browsers (Safari, Chrome) */
.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    border: none;
    position: relative;
    z-index: 10; /* Ensure thumb is on top */
}

.volume-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.volume-control input[type="range"]::-webkit-slider-track {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    border: none;
    position: relative;
    z-index: 1; /* Track below thumb */
}

.dark-mode .volume-control input[type="range"]::-webkit-slider-track {
    background: #555;
}

/* Firefox */
.volume-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
    border: none;
    -moz-appearance: none;
    appearance: none;
    position: relative;
    z-index: 10; /* Ensure thumb is on top */
}

.volume-control input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    border: none;
    position: relative;
    z-index: 1; /* Track below thumb */
}

.dark-mode .volume-control input[type="range"]::-moz-range-track {
    background: #555;
}

/* Microsoft Edge/IE */
.volume-control input[type="range"]::-ms-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
    border: none;
    position: relative;
    z-index: 10; /* Ensure thumb is on top */
}

.volume-control input[type="range"]::-ms-track {
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    border: none;
    color: transparent;
    position: relative;
    z-index: 1; /* Track below thumb */
}

.dark-mode .volume-control input[type="range"]::-ms-track {
    background: #555;
}

.volume-control input[type="range"]::-ms-fill-lower,
.volume-control input[type="range"]::-ms-fill-upper {
    background: #e0e0e0;
    border-radius: 3px;
    position: relative;
    z-index: 1; /* Track below thumb */
}

.dark-mode .volume-control input[type="range"]::-ms-fill-lower,
.dark-mode .volume-control input[type="range"]::-ms-fill-upper {
    background: #555;
}

.volume-control span {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    transition: all 0.3s ease;
}

.dark-mode .volume-control span {
    color: #ccc;
}

/* Circle Section */
.circle-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.circle-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zen-circle {
    filter: drop-shadow(0 8px 32px rgba(0, 0, 0, 0.1));
    width: 100%;
    height: auto;
    max-width: 500px;
    max-height: 500px;
}

.zen-circle-bg {
    fill: none;
    stroke: url(#zenGradient);
    stroke-width: 12;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
}

.circle-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.zen-emoji {
    font-size: 6rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Current Voice Display */
.current-voice {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    z-index: 1000;
    max-width: 80%;
    text-align: center;
}

.current-voice.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-controls {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .volume-controls {
        gap: 20px;
    }
    
    .zen-circle {
        max-width: 300px;
        max-height: 300px;
    }
    
    .zen-emoji {
        font-size: 3.5rem;
    }
    
    .current-voice {
        font-size: 8px;
        padding: 10px 16px;
        max-width: 90%;
    }
    
    .volume-control label {
        font-size: 11px;
    }
    
    .voice-pack-selector {
        padding: 12px 16px;
    }
    
    .voice-pack-selector label {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .zen-circle {
        max-width: 250px;
        max-height: 250px;
    }
    
    .zen-emoji {
        font-size: 2.8rem;
    }
    
    .volume-controls {
        flex-direction: column;
        gap: 15px;
        padding: 12px 16px;
    }
    
    .volume-control input[type="range"] {
        width: 120px;
    }
    
    .volume-control label {
        font-size: 10px;
    }
    
    .voice-pack-selector {
        padding: 10px 14px;
    }
    
    .voice-pack-selector label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .voice-pack-selector select {
        font-size: 13px;
        padding: 6px 10px;
    }
}

/* Animation for zen feeling */
@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.circle-container {
    animation: breathe 4s ease-in-out infinite;
    transition: all 0.3s ease;
}

/* Countdown pulse animation */
@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Slide down animation for zen emoji */
@keyframes slideDown {
    0% { 
        transform: translateY(0px);
        opacity: 1;
    }
    100% { 
        transform: translateY(150px);
        opacity: 0;
    }
}

.zen-emoji.slide-down {
    animation: slideDown 2s ease-in-out forwards;
}

/* Smooth transitions for all interactive elements */
* {
    transition: all 0.3s ease;
}

/* Mobile optimalisaties voor background audio */
@media (max-width: 768px) {
    /* Prevent zoom on input focus */
    input, select, textarea {
        font-size: 16px !important;
    }
    
    /* Better touch targets */
    .circle-container {
        min-height: 44px;
        min-width: 44px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Prevent text selection on touch */
    .zen-emoji, .circle-content {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
    
    /* Better slider touch area */
    .volume-control input[type="range"] {
        height: 44px; /* Larger touch area */
        padding: 12px 0;
    }
    
    /* Prevent bounce scrolling */
    body {
        overscroll-behavior: none;
        -webkit-overflow-scrolling: touch;
    }
}

/* PWA optimalisaties */
@media (display-mode: standalone) {
    /* App is running as PWA */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .dark-mode-toggle {
        top: calc(20px + env(safe-area-inset-top));
    }
    
    .current-voice {
        bottom: calc(30px + env(safe-area-inset-bottom));
    }
}

/* Background mode indicator */
.background-indicator {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 165, 0, 0.9);
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.background-indicator.show {
    opacity: 1;
    visibility: visible;
}

/* Audio loading indicator */
.audio-loading {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 10px;
    border-radius: 50%;
    font-size: 16px;
    z-index: 1500;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Keep screen active styles */
.keep-active {
    position: fixed;
    top: -1px;
    left: -1px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    background: transparent;
}

/* Service worker update notification */
.sw-update-notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(0, 123, 255, 0.95);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    z-index: 2000;
    transform: translateY(100px);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
}

.sw-update-notification.show {
    transform: translateY(0);
}

.sw-update-notification button {
    background: white;
    color: #007bff;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    font-weight: 500;
    margin-left: 10px;
    cursor: pointer;
}

/* Battery optimization styles */
.battery-saver {
    filter: brightness(0.8);
    transition: filter 0.3s ease;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .zen-emoji {
        animation: none;
    }
    
    .circle-container {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .voice-pack-selector,
    .volume-controls {
        border: 2px solid currentColor;
    }
    
    .zen-circle-bg {
        stroke-width: 16;
    }
}

/* Remove automatic dark mode - only use manual toggle */

/* Big Text Display */
.big-text-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: bold;
    text-align: center;
    z-index: 999;
    max-width: 90%;
    word-wrap: break-word;
    transition: opacity 1s ease;
    opacity: 0;
}

@media (max-width: 768px) {
    .big-text-display {
        font-size: 2.5rem;
    }
}

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