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

/* Force light mode for all elements */
:root {
    color-scheme: light only;
}

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

.seo-header {
    position: absolute;
    top: -9999px;
    left: -9999px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 30px 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    position: relative;
}

/* Menu Button */
.menu-button {
    position: absolute;
    top: 26px;
    /* 30px (container padding) + 22.5px (half of logo height 45px) - 26.5px (half of icon height 53px) */
    right: 15px;
    z-index: 1000;
    cursor: pointer;
    width: auto;
    height: auto;
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

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

.menu-icon {
    width: 53px;
    height: 53px;
    transition: all 0.3s ease;
}

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

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

/* Menu Popup */
.menu-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 90%;
    max-width: 320px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow: hidden;
}

.menu-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.menu-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.close-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    width: auto;
    height: auto;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.close-icon {
    width: 58px;
    height: 58px;
}

.menu-items {
    padding: 10px 0 20px;
}

.menu-item {
    width: 100%;
    padding: 15px 25px;
    background: none;
    border: none;
    text-align: left;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
}

.menu-item:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #007AFF;
}

.menu-item:active {
    background: rgba(0, 0, 0, 0.1);
}

/* Logo */
.logo-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.logo {
    height: 45px;
    width: auto;
}

/* Mode Selection */
.mode-container {
    display: flex;
    width: 100%;
    gap: 0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.mode-button {
    flex: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mode-image {
    width: 100%;
    height: auto;
    display: block;
    transition: all 0.3s ease;
}

.mode-button:hover .mode-image {
    transform: scale(1.02);
}

/* Whistle Button */
.whistle-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0 3px 0;
}

.whistle-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 280px;
    height: auto;
    transition: all 0.2s ease;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.whistle-image {
    width: 100%;
    height: auto;
    display: block;
    transition: all 0.2s ease;
}

.whistle-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.whistle-button:active {
    transform: translateY(0);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Frequency Display */
.frequency-display {
    position: relative;
    margin: 35px 0 0 0;
}

.frequency-value-container {
    position: relative;
    display: inline-block;
}

.frequency-bg {
    height: 60px;
    width: auto;
}

.frequency-text {
    position: absolute;
    top: calc(50% - 5px);
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #333;
    font-weight: bold;
}

.frequency-label {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
    color: #666;
}

.frequency-value {
    display: block;
    font-size: 20px;
    font-weight: 900;
    color: #333;
}

/* Frequency Slider */
.frequency-slider-container {
    width: 100%;
    padding: 0 20px;
    margin-top: -22px;
}

.frequency-bar {
    position: relative;
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    background: transparent;
}

.frequency-bar-bg {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
}

.frequency-bar-bg .bg-left,
.frequency-bar-bg .bg-right {
    height: 56px;
    width: auto;
    flex-shrink: 0;
}

.frequency-bar-bg .bg-middle {
    height: 56px;
    width: 100%;
    flex-grow: 1;
    object-fit: fill;
    /* Stretch to fill available space */
}

.frequency-bar-progress-container {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 8px;
    height: 56px;
    width: 33.56%;
    /* Initial position for 6712Hz - will be adjusted by JavaScript with 20px margins */
    overflow: hidden;
}

.frequency-bar-progress {
    display: flex;
    align-items: center;
    height: 56px;
    width: 298%;
    /* Stretch to cover full width when container is at 100% */
}

.frequency-bar-progress .progress-left,
.frequency-bar-progress .progress-right {
    height: 56px;
    width: auto;
    flex-shrink: 0;
}

.frequency-bar-progress .progress-middle {
    height: 56px;
    width: 100%;
    flex-grow: 1;
    object-fit: fill;
    /* Stretch to fill available space */
}

.frequency-slider-button {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 33.56%;
    /* Initial position for 6712Hz - will be adjusted by JavaScript with 20px margins */
    cursor: grab;
    transition: transform 0.1s ease;
    z-index: 10;
}

.frequency-slider-button:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.1);
}

.slider-button {
    width: 50px;
    height: 50px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        max-width: 350px;
        padding: 25px 15px;
        gap: 20px;
    }

    .logo {
        height: 38px;
    }

    .whistle-button {
        width: 250px;
    }

    .frequency-value {
        font-size: 18px;
    }

    .frequency-label {
        font-size: 12px;
    }

    .menu-button {
        top: 20px;
        /* 25px (container padding) + 19px (half of logo height 38px) - 24px (half of icon height 48px) */
        right: 12px;
    }

    .menu-icon {
        width: 48px;
        height: 48px;
    }

    .menu-popup {
        width: 95%;
        max-width: 280px;
    }

    .menu-header {
        padding: 18px 20px 12px;
    }

    .menu-header h2 {
        font-size: 18px;
    }

    .close-icon {
        width: 48px;
        height: 48px;
    }

    .menu-item {
        padding: 12px 20px;
        font-size: 15px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 450px;
        padding: 40px 30px;
        gap: 30px;
    }

    .logo {
        height: 53px;
    }

    .menu-button {
        top: 37.5px;
        /* 40px (container padding) + 26.5px (half of logo height 53px) - 29px (half of icon height 58px) */
        right: 20px;
    }

    .menu-icon {
        width: 58px;
        height: 58px;
    }

    .whistle-button {
        width: 320px;
    }

    .frequency-value {
        font-size: 24px;
    }
}

/* Animation for mode switching */
.mode-button.switching .mode-image {
    opacity: 0;
}

.mode-button.switching.switched .mode-image {
    opacity: 1;
}

/* Whistle button states */
.whistle-button.active .whistle-image {
    filter: brightness(1.1);
}

/* Touch-friendly improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .whistle-button:hover {
        transform: none;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }

    .frequency-slider-button {
        width: 60px;
        height: 60px;
    }

    .slider-button {
        width: 60px;
        height: 60px;
    }
}

/* Footer Styles */
.footer {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.footer-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #007AFF;
}

.footer-separator {
    color: #ccc;
    font-size: 14px;
}

@media (max-width: 768px) {
    .footer {
        padding: 15px;
        margin-top: 25px;
    }

    .footer-link {
        font-size: 13px;
    }

    .footer-links {
        gap: 12px;
    }
}

/* Override dark mode preferences - force light mode */
@media (prefers-color-scheme: dark) {
    html {
        color-scheme: light only !important;
    }
    
    body {
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important;
        color: #333 !important;
        color-scheme: light only !important;
        -webkit-color-scheme: light !important;
    }
    
    .container {
        background: rgba(255, 255, 255, 0.95) !important;
        color: #333 !important;
    }
    
    .menu-popup {
        background: white !important;
        color: #333 !important;
    }
    
    .menu-header h2 {
        color: #333 !important;
    }
    
    .menu-item {
        color: #333 !important;
    }
    
    .menu-item:hover {
        background: rgba(0, 0, 0, 0.05) !important;
        color: #007AFF !important;
    }
    
    .frequency-text {
        color: #333 !important;
    }
    
    .frequency-label {
        color: #666 !important;
    }
    
    .frequency-value {
        color: #333 !important;
    }
    
    .footer-link {
        color: #666 !important;
    }
    
    .footer-link:hover {
        color: #007AFF !important;
    }
    
    .footer-separator {
        color: #ccc !important;
    }
}