/* ===== أعماق - Complete Styles ===== */

/* ===== Theme Variables ===== */
:root {
    --bg-primary: #0a0a2e;
    --bg-secondary: rgba(10, 10, 46, 0.92);
    --bg-header: rgba(10, 10, 46, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.07);
    --bg-input: rgba(255, 255, 255, 0.05);
    --bg-input-focus: rgba(255, 255, 255, 0.08);
    --bg-player: rgba(10, 10, 46, 0.95);
    --bg-modal: rgba(15, 15, 50, 0.95);
    --bg-install-hero: rgba(10, 10, 46, 0.92);
    --bg-toast: rgba(10, 10, 46, 0.92);
    --text-primary: #fff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.35);
    --text-dimmed: rgba(255, 255, 255, 0.3);
    --text-faint: rgba(255, 255, 255, 0.2);
    --text-ghost: rgba(255, 255, 255, 0.45);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.08);
    --border-lighter: rgba(255, 255, 255, 0.05);
    --accent: #00e5ff;
    --accent-hover: rgba(0, 229, 255, 0.08);
    --accent-bg: rgba(0, 229, 255, 0.1);
    --accent-border: rgba(0, 229, 255, 0.15);
    --accent-glow: rgba(0, 229, 255, 0.06);
    --scrollbar-thumb: rgba(0, 229, 255, 0.15);
    --selection-bg: rgba(0, 229, 255, 0.2);
    --particle-color: rgba(0, 229, 255, 0.12);
    --player-thumb-bg: rgba(255, 255, 255, 0.05);
    --card-playing-bg: rgba(0, 229, 255, 0.05);
    --card-playing-shadow: rgba(0, 229, 255, 0.08);
    --tag-bg: rgba(0, 229, 255, 0.1);
    --ticker-bg: rgba(10, 10, 46, 0.95);
    --play-btn-text: #0a0a2e;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* ===== Light Mode ===== */
body.light-mode {
    --bg-primary: #f0f2f5;
    --bg-secondary: rgba(255, 255, 255, 0.96);
    --bg-header: rgba(255, 255, 255, 0.88);
    --bg-glass: rgba(0, 0, 0, 0.025);
    --bg-glass-hover: rgba(0, 0, 0, 0.055);
    --bg-input: rgba(0, 0, 0, 0.04);
    --bg-input-focus: rgba(0, 0, 0, 0.07);
    --bg-player: rgba(255, 255, 255, 0.97);
    --bg-modal: rgba(255, 255, 255, 0.97);
    --bg-install-hero: rgba(255, 255, 255, 0.96);
    --bg-toast: rgba(255, 255, 255, 0.95);
    --text-primary: #1a1a2e;
    --text-secondary: rgba(0, 0, 0, 0.55);
    --text-muted: rgba(0, 0, 0, 0.38);
    --text-dimmed: rgba(0, 0, 0, 0.3);
    --text-faint: rgba(0, 0, 0, 0.18);
    --text-ghost: rgba(0, 0, 0, 0.5);
    --border-color: rgba(0, 0, 0, 0.07);
    --border-light: rgba(0, 0, 0, 0.09);
    --border-lighter: rgba(0, 0, 0, 0.05);
    --accent: #0097a7;
    --accent-hover: rgba(0, 151, 167, 0.1);
    --accent-bg: rgba(0, 151, 167, 0.1);
    --accent-border: rgba(0, 151, 167, 0.2);
    --accent-glow: rgba(0, 151, 167, 0.08);
    --scrollbar-thumb: rgba(0, 151, 167, 0.2);
    --selection-bg: rgba(0, 151, 167, 0.15);
    --particle-color: rgba(0, 151, 167, 0.08);
    --player-thumb-bg: rgba(0, 0, 0, 0.05);
    --card-playing-bg: rgba(0, 151, 167, 0.06);
    --card-playing-shadow: rgba(0, 151, 167, 0.1);
    --tag-bg: rgba(0, 151, 167, 0.1);
    --ticker-bg: rgba(255, 255, 255, 0.97);
    --play-btn-text: #fff;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease
}

.hidden {
    display: none !important
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px
}

::-webkit-scrollbar-track {
    background: var(--bg-glass)
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px
}

::selection {
    background: var(--selection-bg);
    color: var(--text-primary)
}

/* ============================= */
/* News Ticker                   */
/* ============================= */
.news-ticker-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 36px;
    background: var(--ticker-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--accent-bg);
    transition: background-color 0.4s ease
}

.ticker-inner {
    display: flex;
    align-items: center;
    height: 100%
}

.ticker-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 100%;
    background: var(--accent-hover);
    border-left: 1px solid var(--accent-border);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0
}

.ticker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s infinite
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.3
    }
}

.ticker-track {
    flex: 1;
    overflow: hidden
}

.ticker-scroll {
    display: inline-block;
    white-space: nowrap;
    font-size: 12px;
    color: var(--text-secondary);
    animation: tickerScroll 120s linear infinite;
    padding-right: 100%
}

@keyframes tickerScroll {
    0% {
        transform: translateX(0)
    }

    100% {
        transform: translateX(100%)
    }
}

.ticker-track:hover .ticker-scroll {
    animation-play-state: paused
}

/* ============================= */
/* Sidebar                       */
/* ============================= */
.sidebar {
    position: fixed;
    top: 36px;
    right: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-secondary);
    backdrop-filter: blur(24px);
    border-left: 1px solid var(--border-lighter);
    z-index: 50;
    overflow-y: auto;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease
}

.sidebar-header {
    padding: 16px 20px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-lighter)
}

.sidebar-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 5px;
    filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.3));
    animation: logoFloat 6s ease-in-out infinite
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-6px)
    }
}

.sidebar-title {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(to left, #00e5ff, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.sidebar-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px
}

.app-version {
    font-size: 11px;
    color: var(--text-dimmed);
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.support-note {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.6;
}

.support-note a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.support-note a:hover {
    text-decoration: underline;
}

.sidebar-nav {
    padding: 16px
}

/* Sidebar Quick Links */
.sidebar-quick-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-lighter)
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-ghost);
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    text-align: right;
    position: relative
}

.quick-link:hover {
    background: var(--accent-glow);
    color: var(--text-secondary)
}

.quick-link.active {
    background: var(--accent-hover);
    color: var(--accent)
}

.quick-link svg {
    flex-shrink: 0
}

.badge {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #ff4081;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px
}

.modal-content {
    background: var(--bg-modal);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 28px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    transition: background-color 0.4s ease
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px
}

.modal-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px
}

.timer-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px
}

.timer-btn {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s
}

.timer-btn:hover {
    background: var(--accent-hover);
    border-color: var(--accent-border);
    color: var(--accent)
}

.sleep-active {
    padding: 16px;
    background: var(--accent-glow);
    border-radius: 12px;
    border: 1px solid var(--accent-bg);
    margin-bottom: 12px
}

.sleep-active p {
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 8px
}

.timer-cancel {
    background: rgba(255, 64, 129, 0.1);
    color: #ff4081;
    border: 1px solid rgba(255, 64, 129, 0.15);
    padding: 6px 16px;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 12px;
    cursor: pointer
}

.modal-close {
    background: none;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    padding: 8px 24px;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s
}

.modal-close:hover {
    color: var(--text-primary);
    border-color: var(--accent-border)
}


/* Fav player button */
#btn-fav-player {
    color: var(--text-dimmed);
    transition: color 0.3s
}

#btn-fav-player.active {
    color: #ff4081
}


.sidebar-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-faint);
    margin-bottom: 12px;
    padding: 0 12px;
    letter-spacing: 1px
}

.country-list {
    list-style: none
}

.country-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.25s, color 0.25s;
    border: 1px solid transparent
}

.country-item:hover {
    color: var(--text-primary);
    background: var(--accent-glow)
}

.country-item.active {
    color: var(--accent);
    background: var(--accent-hover);
    border-color: var(--accent-border)
}

.country-flag {
    font-size: 20px;
    flex-shrink: 0
}

.country-name {
    flex: 1
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    top: 36px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto
}

/* ============================= */
/* Main Content                  */
/* ============================= */
.main-content {
    margin-top: 36px;
    margin-right: 280px;
    min-height: calc(100vh - 36px);
    padding-bottom: 120px;
    position: relative;
    transition: background-color 0.4s ease
}

.menu-btn {
    display: none;
    position: fixed;
    top: 44px;
    right: 8px;
    z-index: 35;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center
}

.main-header {
    position: sticky;
    top: 36px;
    z-index: 20;
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-lighter);
    padding: 16px 24px;
    transition: background-color 0.4s ease
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap
}

.header-title-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.weather-widget {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 6px 14px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.weather-widget:hover {
    background: rgba(43, 255, 179, 0.06);
    border-color: rgba(43, 255, 179, 0.2);
}

.weather-widget.hidden {
    display: none;
}

.w-icon {
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.w-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.w-temp {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.w-desc {
    font-size: 10px;
    color: var(--text-ghost);
    margin-top: 3px;
    white-space: nowrap;
}

.page-title {
    font-size: 22px;
    font-weight: 700
}

.station-count {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px
}

.search-box {
    position: relative;
    width: 300px;
    flex-shrink: 0
}

.search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 10px 16px 10px 40px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    outline: none;
    transition: border-color 0.3s, background 0.3s
}

.search-input::placeholder {
    color: var(--text-dimmed)
}

.search-input:focus {
    border-color: var(--accent-border);
    background: var(--bg-input-focus)
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dimmed)
}

/* Stations */
.stations-wrapper {
    padding: 20px 24px
}

.stations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    color: var(--text-muted);
    font-size: 14px
}

.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    color: var(--text-dimmed);
    font-size: 18px
}

.no-results .sub {
    font-size: 13px;
    color: var(--text-faint);
    margin-top: 4px
}

/* Station Card */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    position: relative;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1)
}

.glass-card:hover {
    background: var(--bg-glass-hover);
    border-color: var(--accent-border);
    box-shadow: 0 12px 40px var(--accent-glow)
}

.stations-grid .glass-card:hover {
    transform: translateY(-3px)
}

.glass-card.playing {
    border-color: var(--accent-border);
    background: var(--card-playing-bg);
    box-shadow: 0 0 30px var(--card-playing-shadow)
}

.station-card .card-content {
    display: flex;
    align-items: flex-start;
    gap: 12px
}

.station-favicon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--player-thumb-bg);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center
}

.station-favicon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px
}

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

.station-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.station-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap
}

.station-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0
}

.station-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px
}

.play-overlay {
    position: absolute;
    inset: 0;
    background: var(--accent-hover);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s
}

.glass-card:hover .play-overlay {
    opacity: 1
}

.glass-card.playing .equalizer-bars {
    display: flex
}

/* Tag */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    background: var(--tag-bg);
    color: var(--accent);
    border: 1px solid var(--tag-bg)
}

/* Favorite */
.fav-btn {
    background: none;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    transition: color 0.3s;
    padding: 4px
}

.fav-btn:hover {
    color: var(--text-ghost)
}

.fav-btn.active {
    color: #ff4081
}

/* Equalizer */
.equalizer-bars {
    display: none;
    align-items: flex-end;
    gap: 2px;
    height: 16px
}

.equalizer-bars span {
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    animation: equalize 0.8s ease-in-out infinite alternate
}

.equalizer-bars span:nth-child(1) {
    height: 30%;
    animation-delay: 0s
}

.equalizer-bars span:nth-child(2) {
    height: 60%;
    animation-delay: 0.15s
}

.equalizer-bars span:nth-child(3) {
    height: 40%;
    animation-delay: 0.3s
}

.equalizer-bars span:nth-child(4) {
    height: 80%;
    animation-delay: 0.45s
}

@keyframes equalize {
    0% {
        height: 20%
    }

    100% {
        height: 100%
    }
}

/* Loading Wave */
.loading-wave {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 40px;
    margin-bottom: 12px
}

.loading-wave span {
    width: 5px;
    background: linear-gradient(to top, var(--accent), #7c4dff);
    border-radius: 3px;
    animation: waveLoad 1s ease-in-out infinite alternate
}

.loading-wave span:nth-child(1) {
    animation-delay: 0s
}

.loading-wave span:nth-child(2) {
    animation-delay: 0.1s
}

.loading-wave span:nth-child(3) {
    animation-delay: 0.2s
}

.loading-wave span:nth-child(4) {
    animation-delay: 0.3s
}

.loading-wave span:nth-child(5) {
    animation-delay: 0.4s
}

@keyframes waveLoad {
    0% {
        height: 10px
    }

    100% {
        height: 40px
    }
}

/* ============================= */
/* Player Bar                    */
/* ============================= */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: var(--bg-player);
    backdrop-filter: blur(30px);
    border-top: 1px solid var(--border-color);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease
}

.player-bar.visible {
    transform: translateY(0)
}

.player-progress-track {
    height: 2px;
    background: rgba(255, 255, 255, 0.05)
}

.player-progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--accent), #60a5fa);
    width: 0;
    transition: width 1s
}

.player-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 24px;
    max-width: 1400px;
    margin: 0 auto
}

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

.player-thumb {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--player-thumb-bg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.player-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px
}

.player-text {
    min-width: 0
}

.player-text h3 {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.player-text p {
    font-size: 11px;
    color: var(--text-muted)
}

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

.ctrl-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: color 0.2s
}

.ctrl-btn:hover {
    color: #fff
}

.play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00e5ff, #3b82f6);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--play-btn-text);
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.25);
    transition: transform 0.2s, box-shadow 0.2s
}

.play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 30px rgba(0, 229, 255, 0.35)
}

.play-btn:active {
    transform: scale(0.95)
}

.spinner {
    animation: spin 1s linear infinite
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: flex-end
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    cursor: pointer
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #00e5ff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.4)
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #00e5ff;
    border-radius: 50%;
    border: none;
    cursor: pointer
}

/* ============================= */
/* Particles                     */
/* ============================= */
#particles-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--particle-color);
    border-radius: 50%;
    animation: particleFloat linear infinite
}

.particle:nth-child(1) {
    left: 10%;
    top: 20%;
    animation-duration: 20s;
    width: 3px;
    height: 3px
}

.particle:nth-child(2) {
    left: 30%;
    top: 80%;
    animation-duration: 25s;
    animation-delay: -5s;
    width: 5px;
    height: 5px
}

.particle:nth-child(3) {
    left: 50%;
    top: 40%;
    animation-duration: 18s;
    animation-delay: -3s
}

.particle:nth-child(4) {
    left: 70%;
    top: 60%;
    animation-duration: 22s;
    animation-delay: -8s;
    width: 6px;
    height: 6px
}

.particle:nth-child(5) {
    left: 85%;
    top: 15%;
    animation-duration: 30s;
    animation-delay: -2s;
    width: 3px;
    height: 3px
}

.particle:nth-child(6) {
    left: 20%;
    top: 50%;
    animation-duration: 28s;
    animation-delay: -10s
}

.particle:nth-child(7) {
    left: 60%;
    top: 90%;
    animation-duration: 24s;
    animation-delay: -7s;
    width: 5px;
    height: 5px
}

.particle:nth-child(8) {
    left: 90%;
    top: 30%;
    animation-duration: 26s;
    animation-delay: -4s
}

@keyframes particleFloat {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0
    }

    10% {
        opacity: 1
    }

    50% {
        transform: translate(-100px, -200px) scale(1.5);
        opacity: 0.5
    }

    90% {
        opacity: 0
    }

    100% {
        transform: translate(100px, -400px) scale(0.5);
        opacity: 0
    }
}

/* ============================= */
/* MOBILE < 768px                */
/* ============================= */
@media (max-width:1023px) {
    .sidebar {
        transform: translateX(320px);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
        padding-bottom: 140px;
    }

    .menu-btn {
        display: flex;
        z-index: 1001;
    }

    .main-header {
        padding: 12px 16px;
        padding-right: 64px;
        backdrop-filter: blur(20px);
    }

    .header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .header-title-wrapper {
        justify-content: space-between;
        align-items: center;
    }

    .search-box {
        width: 100%;
        max-width: none;
    }

    .stations-wrapper {
        padding: 12px;
    }

    .stations-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .page-title {
        font-size: 1.2rem;
    }
}

@media (max-width:480px) {
    .stations-grid {
        grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
        gap: 12px;
    }

    .glass-card {
        padding: 10px;
        border-radius: 12px;
    }

    .station-card .card-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }

    .station-favicon {
        width: 56px;
        height: 56px;
        border-radius: 12px;
        margin: 0 auto;
    }

    .station-info {
        width: 100%;
    }

    .station-name {
        font-size: 13px;
        line-height: 1.3;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        height: 34px;
        margin-bottom: 4px;
    }

    .station-actions {
        position: absolute;
        top: 8px;
        right: 8px;
    }

    .station-tags {
        display: none;
        /* Hide tags on very small screens to keep grid clean */
    }

    .tag {
        font-size: 8px;
        padding: 1px 4px;
    }

    .player-inner {
        padding: 8px 12px;
        gap: 8px;
    }

    .player-thumb {
        width: 40px;
        height: 40px;
    }

    .player-text h3 {
        font-size: 13px;
        max-width: 45vw;
    }

    .player-text p {
        font-size: 10px;
    }

    .player-controls {
        gap: 6px;
    }

    .play-btn {
        width: 44px;
        height: 44px;
    }

    /* Disable hover-only effects on touch */
    .play-overlay {
        display: none !important;
    }
}

/* Region Toggle */
.region-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-ghost);
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    margin-bottom: 6px;
    transition: all 0.25s;
    user-select: none
}

.region-toggle:hover {
    background: var(--accent-glow);
    color: var(--text-secondary)
}

.region-toggle.open {
    color: var(--accent);
    background: var(--accent-glow);
    border-color: var(--accent-bg)
}

.region-toggle .region-icon {
    font-size: 16px;
    flex-shrink: 0
}

.region-toggle .region-name {
    flex: 1
}

.region-toggle .region-arrow {
    transition: transform 0.25s;
    font-size: 10px;
    color: var(--text-faint)
}

.region-toggle.open .region-arrow {
    transform: rotate(90deg)
}

.region-countries {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    padding-right: 4px
}

.region-countries.open {
    max-height: 2000px
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 0;
    flex-wrap: wrap
}

.page-btn {
    min-width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: var(--bg-glass);
    color: var(--text-ghost);
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px
}

.page-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent-border);
    color: var(--text-primary)
}

.page-btn.active {
    background: var(--accent-bg);
    border-color: var(--accent-border);
    color: var(--accent);
    font-weight: 700
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none
}

.page-info {
    font-size: 12px;
    color: var(--text-dimmed);
    padding: 0 8px
}

/* Homepage Sections */
.home-section {
    padding: 20px 24px
}

.section-header {
    margin-bottom: 16px
}

.section-title {
    font-size: 20px;
    font-weight: 700
}

.section-sub {
    font-size: 12px;
    color: var(--text-dimmed);
    margin-top: 2px
}

.horizontal-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 6px 0 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch
}

.horizontal-scroll::-webkit-scrollbar {
    height: 4px
}

.horizontal-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.1);
    border-radius: 2px
}

.horizontal-scroll .h-card {
    min-width: 220px;
    max-width: 260px;
    scroll-snap-align: start;
    flex-shrink: 0
}

.mini-loading {
    display: flex;
    justify-content: center;
    padding: 30px 0
}

.mini-loading .loading-wave {
    height: 24px
}

.mini-loading .loading-wave span {
    width: 3px
}

/* Back Button */
.back-btn {
    background: none;
    border: 1px solid var(--border-light);
    color: var(--text-ghost);
    font-family: 'Cairo', sans-serif;
    font-size: 12px;
    padding: 4px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px
}

.back-btn:hover {
    color: var(--accent);
    border-color: var(--accent-border)
}

/* Volume Indicator */
.volume-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border: 1px solid var(--accent-border);
    border-radius: 16px;
    padding: 16px 24px;
    color: #fff;
    font-size: 14px;
    font-family: 'Cairo', sans-serif;
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s
}

.volume-indicator.show {
    opacity: 1
}

.volume-indicator .vol-bar {
    width: 120px;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden
}

.volume-indicator .vol-fill {
    height: 100%;
    background: linear-gradient(to right, var(--accent), #3b82f6);
    border-radius: 3px;
    transition: width 0.15s
}

.hide-mobile {
    display: flex
}

@media(max-width:768px) {
    .hide-mobile {
        display: none
    }
}

@media(max-width:1023px) {
    .home-section {
        padding: 16px
    }

    .horizontal-scroll .h-card {
        min-width: 200px
    }
}

/* Install Banner */
.install-banner {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    z-index: 90;
    padding: 0 16px;
    transition: transform 0.3s, opacity 0.3s
}

.install-inner {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border: 1px solid var(--accent-border);
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px
}

.install-info {
    display: flex;
    align-items: center;
    gap: 12px
}

.install-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px
}

.install-info strong {
    font-size: 14px;
    color: #fff;
    display: block
}

.install-info p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin: 0
}

.install-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0
}

.install-btn {
    background: linear-gradient(135deg, #00e5ff, #3b82f6);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s
}

.install-btn:hover {
    transform: scale(1.05)
}

.install-dismiss {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 18px;
    cursor: pointer;
    padding: 4px
}

/* Notification button states */
#btn-notif {
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.3s
}

#btn-notif.active {
    color: #00e5ff
}

@media(max-width:480px) {
    .player-inner {
        flex-wrap: nowrap;
        padding: 8px 12px;
        gap: 8px
    }

    .player-info {
        flex: 1 1 auto;
        min-width: 0;
        margin-right: 0;
    }

    .player-thumb {
        width: 38px;
        height: 38px
    }

    .player-text h3 {
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 45vw
    }

    .player-text p {
        font-size: 10px;
        margin-top: 2px;
    }

    .player-controls {
        flex-shrink: 0;
        width: auto;
        justify-content: flex-end;
        gap: 4px
    }

    .ctrl-btn {
        padding: 6px
    }

    .ctrl-btn svg {
        width: 20px;
        height: 20px
    }

    .play-btn {
        width: 40px;
        height: 40px
    }

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

    /* Hide non-essential buttons on very small screens to fit single row */
    .ctrl-btn:not(#btn-play-pause):not([onclick="playNext()"]):not([onclick="toggleFavCurrent()"]) {
        display: none !important;
    }

    .install-banner {
        bottom: 80px;
        padding: 0 8px
    }

    .install-inner {
        padding: 10px 12px
    }

    .install-icon {
        width: 32px;
        height: 32px
    }

    .install-info strong {
        font-size: 12px
    }
}

/* ============================= */
/* Homepage Install Section      */
/* ============================= */
.install-section {
    padding: 12px 24px 30px;
}

.install-card-hero {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.08), rgba(59, 130, 246, 0.08));
    border: 1px solid rgba(0, 229, 255, 0.15);
    padding: 2px;
}

.install-hero-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg,
            transparent,
            rgba(0, 229, 255, 0.1),
            transparent,
            rgba(59, 130, 246, 0.1),
            transparent);
    animation: installGlow 6s linear infinite;
    z-index: 0;
}

@keyframes installGlow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.install-hero-content {
    position: relative;
    z-index: 1;
    background: var(--bg-install-hero);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 18px;
    padding: 32px 24px;
    text-align: center;
}

.install-hero-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(59, 130, 246, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(0, 229, 255, 0.2);
    overflow: hidden;
}

.install-hero-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.install-hero-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(to left, #00e5ff, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.install-hero-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.install-hero-features {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.install-feature {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 30px;
    background: rgba(0, 229, 255, 0.06);
    border: 1px solid rgba(0, 229, 255, 0.1);
    font-size: 13px;
    color: var(--text-secondary);
}

.install-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #00e5ff, #3b82f6);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0, 229, 255, 0.3);
    animation: installPulse 3s ease-in-out infinite;
}

.install-hero-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 229, 255, 0.4);
}

@keyframes installPulse {

    0%,
    100% {
        box-shadow: 0 8px 25px rgba(0, 229, 255, 0.3);
    }

    50% {
        box-shadow: 0 8px 35px rgba(0, 229, 255, 0.5);
    }
}

@media (max-width: 480px) {
    .install-section {
        padding: 12px 16px 24px;
    }

    .install-hero-content {
        padding: 24px 16px;
    }

    .install-hero-title {
        font-size: 17px;
    }

    .install-hero-desc {
        font-size: 13px;
    }

    .install-hero-features {
        gap: 8px;
    }

    .install-feature {
        padding: 6px 12px;
        font-size: 12px;
    }

    .install-hero-btn {
        padding: 12px 28px;
        font-size: 14px;
    }
}

/* Toast (Final Override) */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px var(--shadow-color);
    pointer-events: none;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--accent-border);
    min-width: 250px;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============================= */
/* Pull-to-Refresh               */
/* ============================= */
.ptr-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-modal);
    border: 1px solid var(--accent-border);
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
}

.ptr-indicator.pulling {
    opacity: 1;
}

.ptr-indicator.refreshing {
    transform: translateX(-50%) translateY(60px);
    opacity: 1;
}

.ptr-spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--border-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.ptr-indicator.refreshing .ptr-spinner {
    animation: ptrSpin 0.7s linear infinite;
}

@keyframes ptrSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Logo switching for light/dark mode */
.sidebar-logo-light {
    display: none;
}

body.light-mode .sidebar-logo-dark {
    display: none;
}

body.light-mode .sidebar-logo-light {
    display: block;
}

/* ============================= */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-ghost);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn:hover {
    background: var(--accent-hover);
    border-color: var(--accent-border);
    color: var(--accent);
    transform: scale(1.08);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

.theme-toggle-btn svg {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.theme-toggle-btn .theme-icon-active {
    animation: themeIconSpin 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes themeIconSpin {
    0% {
        transform: rotate(-90deg) scale(0.5);
        opacity: 0;
    }

    100% {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

/* Light mode specific overrides for elements with special styling */
body.light-mode .sidebar-title {
    background: linear-gradient(to left, #0097a7, #1565c0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-mode .sidebar-logo {
    filter: drop-shadow(0 0 15px rgba(0, 151, 167, 0.25));
}

body.light-mode .install-hero-title {
    background: linear-gradient(to left, #0097a7, #1565c0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-mode .play-btn {
    background: linear-gradient(135deg, #0097a7, #1565c0);
    box-shadow: 0 4px 20px rgba(0, 151, 167, 0.3);
}

body.light-mode .play-btn:hover {
    box-shadow: 0 6px 30px rgba(0, 151, 167, 0.4);
}

body.light-mode .install-hero-btn {
    background: linear-gradient(135deg, #0097a7, #1565c0);
    box-shadow: 0 8px 25px rgba(0, 151, 167, 0.3);
}

body.light-mode .install-btn {
    background: linear-gradient(135deg, #0097a7, #1565c0);
}

body.light-mode .install-card-hero {
    background: linear-gradient(135deg, rgba(0, 151, 167, 0.08), rgba(21, 101, 192, 0.08));
    border-color: rgba(0, 151, 167, 0.2);
}

body.light-mode .install-feature {
    background: rgba(0, 151, 167, 0.06);
    border-color: rgba(0, 151, 167, 0.12);
}

body.light-mode .volume-slider {
    background: rgba(0, 0, 0, 0.08);
}

body.light-mode .volume-slider::-webkit-slider-thumb {
    background: #0097a7;
    box-shadow: 0 0 10px rgba(0, 151, 167, 0.4);
}

body.light-mode .volume-slider::-moz-range-thumb {
    background: #0097a7;
}

body.light-mode #particles-bg {
    opacity: 0.5;
}

body.light-mode .weather-widget:hover {
    background: rgba(0, 151, 167, 0.06);
    border-color: rgba(0, 151, 167, 0.2);
}

body.light-mode .install-hero-glow {
    background: conic-gradient(from 0deg,
            transparent,
            rgba(0, 151, 167, 0.08),
            transparent,
            rgba(21, 101, 192, 0.08),
            transparent);
}

/* Fix toast in light-mode for better contrast */
body.light-mode .toast {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}