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

body {
    font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 300;
    background: #1a1a1a;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

/* Ambient Visualizer Background */
.visualizer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #1a1a1a;
    opacity: 0;
    transition: opacity 2s ease;
}

.visualizer::before,
.visualizer::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 2s ease;
}

.visualizer::before {
    background:
        radial-gradient(ellipse at 20% 30%, rgba(66, 135, 245, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(147, 51, 234, 0.3) 0%, transparent 50%);
}

.visualizer::after {
    background:
        radial-gradient(ellipse at 60% 80%, rgba(20, 184, 166, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 20%, rgba(99, 102, 241, 0.25) 0%, transparent 50%);
}

/* Playing State - Activate visualizer */
.visualizer.playing {
    opacity: 1;
}

.visualizer.playing::before {
    opacity: 1;
    animation: visualizerShift 35s ease-in-out infinite;
}

.visualizer.playing::after {
    opacity: 1;
    animation: visualizerShiftAlt 40s ease-in-out infinite;
}

/* Pulse Effect - Slow, gentle intensity increase */
.visualizer.pulse::before,
.visualizer.pulse::after {
    animation-name: visualizerPulse;
    animation-duration: 3s;
    animation-timing-function: ease-in-out;
}

.container {
    max-width: 600px;
    width: 100%;
    background: linear-gradient(135deg, #2d2d2d 0%, #252525 50%, #1f1f1f 100%);
    border-radius: 12px;
    padding: 40px 40px 32px 40px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    border: 1px solid #7d1935;
    position: relative;
}

/* Info Button */
.info-button {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #757575 0%, #666 50%, #5a5a5a 100%);
    color: white;
    border: none;
    font-family: 'Jost', sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    box-shadow:
        0 2px 8px rgba(102, 102, 102, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.info-button:hover {
    background: linear-gradient(135deg, #858585 0%, #777 50%, #6a6a6a 100%);
    transform: scale(1.05);
    box-shadow:
        0 4px 12px rgba(119, 119, 119, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

/* Info Modal */
.info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.info-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-modal-content {
    background: #2a2a2a;
    border-radius: 12px;
    border: 1px solid #7d1935;
    padding: 40px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.info-close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #666;
    color: white;
    border: none;
    font-size: 1.8rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.info-close-button:hover {
    background: #777;
    transform: scale(1.05);
}

.info-title {
    font-family: 'Jost', sans-serif;
    font-size: 2rem;
    font-weight: 400;
    color: #ffffff;
    margin: 0 0 8px 0;
}

.pronunciation {
    font-size: 1.2rem;
    font-weight: 300;
    color: #999;
}

.info-tagline {
    font-family: 'Jost', sans-serif;
    font-size: 1.1rem;
    font-weight: 300;
    color: #ccc;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.info-description {
    font-family: 'Jost', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    color: #e0e0e0;
    line-height: 1.6;
    margin: 0 0 32px 0;
}

.info-section-title {
    font-family: 'Jost', sans-serif;
    font-size: 1.4rem;
    font-weight: 400;
    color: #ffffff;
    margin: 32px 0 16px 0;
}

.info-subtitle {
    font-family: 'Jost', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: #e0e0e0;
    margin: 20px 0 12px 0;
}

.info-text {
    font-family: 'Jost', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    color: #ccc;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.info-list {
    font-family: 'Jost', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    color: #ccc;
    line-height: 1.8;
    margin: 0 0 16px 0;
    padding-left: 24px;
}

.info-list li {
    margin-bottom: 8px;
}

.info-tip {
    font-family: 'Jost', sans-serif;
    font-size: 0.95rem;
    font-weight: 300;
    color: #999;
    font-style: italic;
    margin: 16px 0 0 0;
}

.info-cta {
    margin: 16px 0 0 0;
}

.info-link {
    font-family: 'Jost', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: #80BBFF;
    text-decoration: none;
    transition: color 0.2s;
}

.info-link:hover {
    color: #a0d0ff;
    text-decoration: underline;
}

.logo-container {
    text-align: center;
    margin-top: 50px;
    margin-bottom: 8px;
}

.logo {
    max-width: 300px;
    width: 100%;
    height: auto;
}

.subtitle {
    text-align: center;
    color: #999;
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 40px;
    line-height: 1.5;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Palette Selector */
.palette-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: -20px;
    margin-bottom: 10px;
}

.palette-label {
    color: #ccc;
    font-size: 1rem;
    margin: 0;
    text-align: center;
}

.palette-buttons {
    display: flex;
    gap: 12px;
}

.palette-btn {
    padding: 10px 24px;
    font-size: 1rem;
    background: #333;
    border: 1px solid #555;
    border-radius: 6px;
    color: #e0e0e0;
    outline: none;
    font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.palette-btn:focus-visible {
    outline: 2px solid #4ade80;
    outline-offset: 2px;
}

.palette-btn:hover {
    border-color: #777;
    background: #3a3a3a;
}

.palette-btn.active {
    background: linear-gradient(135deg, #8f1e3f 0%, #7d1935 50%, #6b1530 100%);
    border-color: #7d1935;
    color: #ffffff;
    font-weight: 400;
    box-shadow:
        0 4px 12px rgba(125, 25, 53, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.palette-btn.active:hover {
    background: linear-gradient(135deg, #9f2249 0%, #8f1e3f 50%, #7d1935 100%);
    border-color: #8f1e3f;
    box-shadow:
        0 6px 16px rgba(143, 30, 63, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.weather-input {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.weather-input label {
    color: #ccc;
    font-size: 1rem;
    display: none;
}

.autocomplete-wrapper {
    width: 100%;
    position: relative;
}

.weather-input input[type="text"] {
    width: 100%;
    padding: 10px 16px;
    font-size: 1rem;
    background: #333;
    border: 1px solid #555;
    border-radius: 6px;
    color: #e0e0e0;
    outline: none;
    font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 400;
}

.weather-input input[type="text"]:focus {
    border-color: #7d1935;
}

.weather-input-help {
    color: #999;
    font-size: 0.85rem;
    font-weight: 300;
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2a2a2a;
    border: 1px solid #555;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-results.active {
    display: block;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    color: #ccc;
    border-bottom: 1px solid #333;
    transition: background 0.2s;
    font-weight: 400;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: #3a3a3a;
    color: #fff;
}

.autocomplete-item-name {
    font-weight: 400;
    color: #e0e0e0;
}

.autocomplete-item-region {
    font-size: 0.85rem;
    color: #999;
    margin-top: 2px;
}

.binaural-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 20px 12px 20px;
    background: #333;
    border-radius: 8px;
    margin-bottom: 10px;
}

.binaural-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-label {
    color: #e0e0e0;
    font-size: 1rem;
    font-weight: 500;
}

/* Toggle switch styling */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #e0e0e0;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #4ade80;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
}

.binaural-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    max-height: 50px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
    margin-top: 16px;
}

.binaural-selector.hidden {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.binaural-selector label {
    color: #ccc;
    font-size: 1rem;
    white-space: nowrap;
}

.binaural-selector select {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.95rem;
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 6px;
    color: #e0e0e0;
    cursor: pointer;
    outline: none;
    font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
}

.binaural-selector select:focus {
    border-color: #7d1935;
}

.binaural-selector select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn {
    padding: 12px 32px;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 400;
}

.btn:focus-visible {
    outline: 2px solid #4ade80;
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, #4a4db0 0%, #3e4095 50%, #363a85 100%);
    color: white;
    box-shadow:
        0 4px 12px rgba(62, 64, 149, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #525ac0 0%, #4651a5 50%, #3e4095 100%);
    box-shadow:
        0 6px 16px rgba(62, 64, 149, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.btn-primary:disabled {
    background: #444;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #757575 0%, #666 50%, #5a5a5a 100%);
    color: white;
    box-shadow:
        0 4px 12px rgba(102, 102, 102, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #858585 0%, #777 50%, #6a6a6a 100%);
    box-shadow:
        0 6px 16px rgba(119, 119, 119, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.btn-secondary:disabled {
    background: #444;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.slider-group label {
    font-size: 1rem;
    color: #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-group label span {
    font-weight: 600;
    color: #4a9eff;
    min-width: 50px;
    text-align: right;
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #444;
    outline: none;
    transition: background 0.2s;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4a9eff;
    cursor: pointer;
    transition: background 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    background: #3a8eef;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4a9eff;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.slider::-moz-range-thumb:hover {
    background: #3a8eef;
}

.weather-status {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 6px;
    padding-bottom: 6px;
    text-align: center;
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
}

.weather-status.active {
    display: flex;
}

.weather-status p {
    color: #999;
    font-size: 0.85rem;
    font-weight: 300;
    margin: 0;
    line-height: 1.4;
}

.weather-status-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

#statusCondition {
    width: 100%;
}

.status-indicator {
    width: 8px;
    height: 8px;
    min-width: 8px;
    min-height: 8px;
    border-radius: 50%;
    background-color: #4ade80;
    opacity: 0;
    transition: opacity 0.5s ease, background-color 0.3s ease;
    flex-shrink: 0;
}

.status-indicator.active {
    opacity: 1;
    animation: ambientPulse 3s ease-in-out infinite;
}

.status-indicator.warning {
    background-color: #fbbf24;
    opacity: 1;
}

@keyframes ambientPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Visualizer Animations */
@keyframes visualizerShift {
    0%, 100% {
        filter: hue-rotate(0deg) brightness(1);
    }
    33% {
        filter: hue-rotate(15deg) brightness(1.1);
    }
    66% {
        filter: hue-rotate(-10deg) brightness(0.95);
    }
}

@keyframes visualizerShiftAlt {
    0%, 100% {
        filter: hue-rotate(0deg) brightness(1);
    }
    33% {
        filter: hue-rotate(-15deg) brightness(0.95);
    }
    66% {
        filter: hue-rotate(20deg) brightness(1.1);
    }
}

@keyframes visualizerPulse {
    0% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.15);
    }
    100% {
        filter: brightness(1);
    }
}

/* Accessibility - Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .visualizer.playing::before,
    .visualizer.playing::after {
        animation: none !important;
        filter: none !important;
    }

    .visualizer.pulse::before,
    .visualizer.pulse::after {
        animation: none !important;
    }

    .status-indicator.active {
        animation: none !important;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 24px 24px 20px 24px;
    }

    .logo {
        max-width: 200px;
    }

    .subtitle {
        font-size: 1rem;
    }

    .btn {
        padding: 10px 24px;
        font-size: 0.9rem;
    }

    .weather-input-help {
        max-width: 90%;
        margin-left: auto;
        margin-right: auto;
    }

    .weather-status {
        flex-direction: column;
    }

    .weather-status-header {
        width: 100%;
        justify-content: center;
    }

    #statusTimestamp {
        width: 100%;
    }

    .binaural-selector select {
        font-size: 0.85rem;
        min-width: 0;
    }

    .binaural-selector {
        gap: 8px;
    }

    .binaural-selector label {
        flex-shrink: 0;
    }
}
