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

:root {
    --glass-tint: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --accent: #ff6b35;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    background: #0a0a0a;
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

/* ============================================
   LIQUID GLASS EFFECT
   ============================================ */

.liquidGlass-wrapper {
    position: relative;
    display: flex;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.5);
}

.liquidGlass-effect {
    position: absolute;
    z-index: 0;
    inset: 0;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    filter: url(#glass-distortion);
    overflow: hidden;
    isolation: isolate;
}

.liquidGlass-tint {
    z-index: 1;
    position: absolute;
    inset: 0;
    background: var(--glass-tint);
}

.liquidGlass-shine {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    border-radius: inherit;
    box-shadow: 
        inset 0 1px 0 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 0 rgba(255, 255, 255, 0.05);
}

.liquidGlass-content {
    z-index: 3;
    position: relative;
    width: 100%;
}

/* ============================================
   SEARCH BAR
   ============================================ */

.search-wrapper {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 100%;
    max-width: 520px;
    padding: 0 20px;
}

.search-container {
    border-radius: 18px;
}

.search-container:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    transform: scale(1.01);
}

.search-container .liquidGlass-content {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    gap: 10px;
}

.search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

#searchInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 400;
    outline: none;
    min-width: 0;
}

#searchInput::placeholder {
    color: var(--text-secondary);
}

.btn-random,
.search-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-random:hover,
.search-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.btn-random svg,
.search-btn svg {
    width: 16px;
    height: 16px;
    color: var(--text-primary);
}

/* ============================================
   SEARCH RESULTS
   ============================================ */

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 20px;
    right: 20px;
    border-radius: 14px;
    max-height: 360px;
    overflow: hidden;
    display: none;
}

.search-results.active {
    display: flex;
}

.search-results-content {
    width: 100%;
    max-height: 360px;
    overflow-y: auto;
}

.search-results-content::-webkit-scrollbar {
    width: 5px;
}

.search-results-content::-webkit-scrollbar-track {
    background: transparent;
}

.search-results-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.search-result-item.no-results {
    justify-content: center;
    color: var(--text-secondary);
    cursor: default;
    padding: 20px;
}

.search-result-item.no-results:hover {
    background: transparent;
}

.search-result-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-info h4 {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.search-result-info p {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   MAP
   ============================================ */

.main-content {
    flex: 1;
    position: relative;
}

.map-container {
    width: 100%;
    height: 100%;
}

.leaflet-container {
    background: #0a0a0a;
}

/* Station dots */
.station-dot {
    background: rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

.station-dot.playing {
    background: var(--accent);
    animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(255, 107, 53, 0); }
}

/* Marker Clusters */
.marker-cluster {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
}

.marker-cluster div {
    background: rgba(255, 255, 255, 0.8);
    color: #0a0a0a;
    border-radius: 50%;
    font-weight: 600;
    font-size: 11px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.marker-cluster-small {
    background: rgba(255, 255, 255, 0.12);
}
.marker-cluster-small div {
    width: 26px;
    height: 26px;
    line-height: 26px;
}

.marker-cluster-medium {
    background: rgba(255, 255, 255, 0.15);
}
.marker-cluster-medium div {
    width: 32px;
    height: 32px;
    line-height: 32px;
}

.marker-cluster-large {
    background: rgba(255, 255, 255, 0.18);
}
.marker-cluster-large div {
    width: 40px;
    height: 40px;
    line-height: 40px;
}

/* Map Popup */
.leaflet-popup-content-wrapper {
    background: rgba(25, 25, 25, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.leaflet-popup-content {
    margin: 0;
    min-width: 160px;
    color: var(--text-primary);
}

.leaflet-popup-tip {
    background: rgba(25, 25, 25, 0.95);
}

.popup-content {
    padding: 12px;
}

.popup-content h3 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 3px;
}

.popup-content p {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.popup-play-btn {
    width: 100%;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.popup-play-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   PLAYER
   ============================================ */

.player {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 20px;
    z-index: 1000;
}

.player-content {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    gap: 18px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
}

.station-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.station-details {
    min-width: 0;
}

.station-details h3 {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.station-details p {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-primary);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.control-btn svg {
    width: 18px;
    height: 18px;
}

.play-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    color: #0a0a0a;
}

.play-btn:hover {
    background: #fff;
}

.play-btn svg {
    width: 22px;
    height: 22px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.volume-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

#volumeSlider {
    width: 70px;
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    cursor: pointer;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease;
}

#volumeSlider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* ============================================
   LOADING OVERLAY
   ============================================ */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .search-wrapper {
        max-width: 100%;
        padding: 0 16px;
        top: 16px;
    }
    
    .player {
        left: 16px;
        right: 16px;
        bottom: 16px;
        transform: none;
        border-radius: 16px;
    }
    
    .player-content {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 14px;
    }
    
    .player-info {
        flex: 1;
        min-width: 140px;
    }
    
    .station-details h3,
    .station-details p {
        max-width: 100px;
    }
    
    .volume-control {
        display: none;
    }
}

/* ============================================
   LEAFLET ZOOM CONTROLS
   ============================================ */

.leaflet-control-zoom {
    border: none !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}

.leaflet-control-zoom a {
    background: rgba(30, 30, 30, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-primary) !important;
    border: none !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important;
    font-weight: 300 !important;
    transition: background 0.15s ease !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(50, 50, 50, 0.9) !important;
    color: #fff !important;
}

.leaflet-control-zoom-in {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px 12px 0 0 !important;
}

.leaflet-control-zoom-out {
    border-radius: 0 0 12px 12px !important;
}

.leaflet-control-attribution {
    background: rgba(0, 0, 0, 0.5) !important;
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 10px !important;
    padding: 2px 6px !important;
}

.leaflet-control-attribution a {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* ============================================
   STATION LOGO PLACEHOLDER
   ============================================ */

.station-logo-wrapper {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.station-logo {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

.station-logo[src=""],
.station-logo:not([src]) {
    opacity: 0;
}

.station-logo-placeholder {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 0;
}

.station-logo-placeholder svg {
    width: 22px;
    height: 22px;
    color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   ZOOM SLIDER
   ============================================ */

.zoom-slider-wrapper {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

.zoom-slider-container {
    border-radius: 20px;
    width: 32px;
    height: 120px;
}

.zoom-slider-container .liquidGlass-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

#zoomSlider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    transform: rotate(-90deg);
    outline: none;
    margin: 0;
    padding: 0;
}

#zoomSlider::-webkit-slider-container {
    background: transparent;
}

#zoomSlider::-webkit-slider-runnable-track {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
}

#zoomSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -4.5px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#zoomSlider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

#zoomSlider::-moz-range-track {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
}

#zoomSlider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

#zoomSlider::-moz-range-progress {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    height: 3px;
}

/* Hide default leaflet zoom controls */
.leaflet-control-zoom {
    display: none !important;
}

/* ============================================
   POPUP WITH THUMBNAIL
   ============================================ */

.popup-content {
    padding: 14px;
}

.popup-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.popup-logo-wrapper {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    position: relative;
}

.popup-logo {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.popup-logo-placeholder {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-logo-placeholder svg {
    width: 22px;
    height: 22px;
    color: rgba(255, 255, 255, 0.4);
}

.popup-info {
    flex: 1;
    min-width: 0;
}

.popup-info h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
    line-height: 1.3;
}

.popup-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.popup-bitrate {
    margin-top: 2px !important;
    font-size: 11px !important;
    opacity: 0.6;
}

.popup-play-btn {
    width: 100%;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.popup-play-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.popup-play-btn.now-playing {
    background: rgba(255, 107, 53, 0.3);
    color: #ff6b35;
    cursor: default;
}

.popup-play-btn.now-playing:hover {
    background: rgba(255, 107, 53, 0.3);
}

/* Close button styling */
.leaflet-popup-close-button {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 18px !important;
    padding: 6px 8px !important;
    width: auto !important;
    height: auto !important;
}

.leaflet-popup-close-button:hover {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* ============================================
   CHAT PANEL
   ============================================ */

.chat-toggle-btn {
    position: fixed;
    right: 20px;
    bottom: 120px;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    cursor: pointer;
    border: none;
    padding: 0;
    z-index: 1000;
    transition: transform 0.2s ease;
}

.chat-toggle-btn:hover {
    transform: scale(1.05);
}

.chat-toggle-btn .liquidGlass-content {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff6b35;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.chat-panel {
    position: fixed;
    right: -380px;
    top: 20px;
    bottom: 20px;
    width: 360px;
    border-radius: 20px;
    z-index: 999;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-panel.active {
    right: 20px;
}

.chat-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    flex: 1;
    min-width: 0;
}

.chat-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.listener-count {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.close-chat-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-secondary);
    transition: color 0.15s ease;
    margin-left: 8px;
}

.close-chat-btn:hover {
    color: var(--text-primary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-message {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    animation: slideIn 0.2s ease;
}

.chat-message.self {
    background: rgba(255, 107, 53, 0.15);
    border-left: 3px solid #ff6b35;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.message-nickname {
    font-weight: 600;
    font-size: 13px;
    color: #ff6b35;
}

.chat-message.self .message-nickname {
    color: #ffa07a;
}

.message-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.message-text {
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-input-wrapper {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-input-wrapper input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.chat-input-wrapper input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.chat-input-wrapper input::placeholder {
    color: var(--text-secondary);
}

#chatInput {
    flex: 1;
}

.send-btn {
    align-self: flex-end;
    background: rgba(255, 107, 53, 0.2);
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ff6b35;
    transition: background 0.15s ease;
}

.send-btn:hover {
    background: rgba(255, 107, 53, 0.35);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chat-panel {
        right: -100%;
        left: 0;
        width: 100%;
        top: 0;
        bottom: 0;
        border-radius: 0;
    }
    
    .chat-panel.active {
        right: 0;
    }
    
    .chat-toggle-btn {
        right: 16px;
        bottom: 100px;
    }
}
