@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --bg-color: #0f0f13;
    --panel-bg: rgba(25, 25, 30, 0.65);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #00e5ff;
    --glass-border: rgba(255, 255, 255, 0.08);
}

body.light-mode {
    --bg-color: #f0f2f5;
    --panel-bg: rgba(255, 255, 255, 0.8);
    --text-primary: #1a1a1a;
    --text-secondary: #5a5a5a;
    --glass-border: rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background 0.8s ease, color 0.8s ease;
}

.ambient-bg {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    z-index: 1;
    background-size: cover;
    background-position: center;
    filter: blur(120px);
    opacity: 0;
    transition: opacity 0.8s ease, background-image 1.5s ease;
    pointer-events: none;
}

body.ambient-active .ambient-bg {
    opacity: 0.45;
}

body.ambient-active.light-mode .ambient-bg {
    opacity: 0.35;
}

.top-nav,
.app-container {
    position: relative;
    z-index: 10;
}

.brand-desktop {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-mobile {
    display: none !important;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 30;
    transition: background-color 0.8s ease, border-color 0.8s ease;
}

.logo {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 2px;
}

.logo span {
    color: var(--accent-color);
    transition: color 0.8s ease;
}

.header-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

.nav-controls {
    display: flex;
    gap: 20px;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    transition: color 0.4s, transform 0.2s;
}

.icon-btn:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

#btn-theme-cycle {
    width: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auto-icon {
    font-weight: 800;
    font-size: 24px;
    font-family: 'Poppins', sans-serif;
    line-height: 1;
    margin-bottom: 0px;
}

.lang-btn {
    font-size: 16px;
    font-weight: 700;
    width: 40px;
    padding: 4px 0;
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.4s ease;
}

.lang-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.app-container {
    display: flex;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.sidebar-left {
    width: 250px;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--glass-border);
    padding: 25px 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    transition: background-color 0.8s ease, border-color 0.8s ease;
}

.sidebar-left-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sidebar-left-header h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0;
}

#station-list {
    list-style: none;
    margin-top: 5px;
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
}

#station-list li {
    padding: 14px 18px;
    margin-bottom: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.4s ease;
    font-weight: 600;
    font-size: 15px;
}

#station-list li:hover {
    background: rgba(255, 255, 255, 0.05);
}

#station-list li.active {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.webamp-btn {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: all 0.4s ease;
    text-transform: uppercase;
}

body.light-mode .webamp-btn {
    background: rgba(255, 255, 255, 0.5);
}

.webamp-btn:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.webamp-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.webamp-btn i {
    font-size: 20px;
    color: var(--accent-color);
    width: 24px;
    text-align: center;
}

.webamp-btn:hover i {
    color: #fff;
}

.player-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
}

.artwork-container {
    width: 320px;
    height: 320px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    margin-bottom: 35px;
}

.artwork-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-info {
    text-align: center;
    margin-bottom: 45px;
}

#station-title {
    font-size: 13px;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 12px;
    font-weight: 700;
    transition: color 0.8s ease;
}

#track-title {
    font-size: 32px;
    font-weight: 700;
    max-width: 700px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
}

#track-artist {
    font-size: 18px;
    font-weight: 300;
    color: var(--text-secondary);
    max-width: 700px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.controls-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    width: 100%;
    max-width: 500px;
}

.playback-controls {
    display: flex;
    align-items: center;
    gap: 35px;
}

.playback-controls button {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 26px;
    cursor: pointer;
    transition: transform 0.2s, color 0.4s;
}

.playback-controls button:hover {
    color: var(--accent-color);
}

.playback-controls button:active {
    transform: scale(0.9);
}

.play-btn {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 26px !important;
    transition: all 0.4s ease;
    background: var(--text-primary) !important;
    color: var(--bg-color) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.play-btn.is-paused {
    background: var(--accent-color) !important;
    color: #fff !important;
    box-shadow: 0 0 25px var(--accent-color);
}

.play-btn:hover {
    transform: scale(1.05);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    background: var(--panel-bg);
    padding: 12px 25px;
    border-radius: 25px;
    border: 1px solid var(--glass-border);
    transition: background-color 0.8s ease, border-color 0.8s ease;
}

#volume-slider {
    flex: 1;
    appearance: none;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 3px;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: 2px solid var(--bg-color);
    transition: background-color 0.8s ease;
}

.m3u-btn {
    position: absolute;
    bottom: 25px;
    right: 25px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.4s ease;
    z-index: 10;
}

body.light-mode .m3u-btn {
    background: rgba(255, 255, 255, 0.6);
}

.m3u-btn:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.sidebar-right {
    position: relative;
    width: 340px;
    min-width: 340px;
    background: var(--panel-bg);
    backdrop-filter: blur(15px);
    border-left: 1px solid var(--glass-border);
    transition: margin-right 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease, background-color 0.8s ease, border-color 0.8s ease;
    z-index: 20;
    display: flex;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    margin-right: 0;
}

.sidebar-right:not(.open) {
    margin-right: -340px;
    box-shadow: none;
}

.schedule-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.toggle-schedule-btn {
    position: absolute;
    left: -45px;
    top: 30px;
    width: 45px;
    height: 50px;
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    border-right: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    border-radius: 12px 0 0 12px;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.4s, background-color 0.8s ease;
}

.toggle-schedule-btn:hover {
    color: var(--accent-color);
}

.panel-tabs {
    display: flex;
    padding: 25px 25px 15px;
    border-bottom: 1px solid var(--glass-border);
    gap: 20px;
}

.tab-btn {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: color 0.4s ease;
    position: relative;
    padding-bottom: 5px;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
    border-radius: 2px;
    transition: background-color 0.8s ease;
}

.view-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.3s;
}

.view-content.hidden {
    display: none;
    opacity: 0;
}

.day-picker {
    display: flex;
    justify-content: space-between;
    padding: 15px 25px 15px;
    margin-top: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.day-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.4s ease;
}

.day-btn:hover {
    color: var(--text-primary);
}

.day-btn.active {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.schedule-content {
    padding: 10px 25px;
    overflow-y: auto;
    flex: 1;
}

.schedule-item {
    display: flex;
    flex-direction: column;
    padding: 15px 0;
    border-bottom: 1px solid var(--glass-border);
}

.schedule-item:last-child {
    border-bottom: none;
}

.schedule-time {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    transition: color 0.8s ease;
}

.schedule-title {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.4;
}

.history-content {
    padding: 10px 25px;
    overflow-y: auto;
    flex: 1;
}

.history-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    margin: 15px 0 10px 0;
}

.history-item {
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 10px;
    border: 1px solid var(--glass-border);
    transition: transform 0.4s ease, background-color 0.8s ease;
}

.history-item:hover {
    transform: translateX(5px);
    background: rgba(0, 0, 0, 0.4);
}

body.light-mode .history-item {
    background: rgba(255, 255, 255, 0.4);
}

body.light-mode .history-item:hover {
    background: rgba(255, 255, 255, 0.7);
}

.history-item.next-track {
    border-left: 4px solid var(--accent-color);
    background: radial-gradient(circle at right, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    transition: border-color 0.8s ease;
}

.history-track {
    display: flex;
    align-items: center;
    gap: 15px;
}

.history-track img {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.history-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.history-artist {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-color);
    width: 420px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transform: translateY(0);
    transition: transform 0.4s ease, background-color 0.8s ease;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal.hidden .modal-content {
    transform: translateY(20px);
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-body p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: -5px;
}

.modal-body input[type="password"],
.modal-body input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--panel-bg);
    color: var(--text-primary);
    outline: none;
    font-size: 14px;
    transition: border-color 0.4s ease, background-color 0.8s ease;
}

.modal-body input:focus {
    border-color: var(--accent-color);
}

.modal-divider {
    border: 0;
    border-top: 1px solid var(--glass-border);
    margin: 5px 0;
}

.action-btn {
    width: 100%;
    padding: 16px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: filter 0.4s ease, background-color 0.8s ease;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn:hover {
    filter: brightness(1.1);
}

input[type="range"] {
    appearance: none;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: 2px solid var(--bg-color);
    transition: background-color 0.8s ease;
}

.color-picker-container {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.color-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.4s ease;
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-container span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-secondary);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

body.ambient-active .top-nav,
body.ambient-active .sidebar-left,
body.ambient-active .sidebar-right,
body.ambient-active .sidebar-right .toggle-schedule-btn {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.05);
}

.mobile-show {
    display: none !important;
}

.mobile-show-inline {
    display: none !important;
}

@media (max-width: 900px) {
    body {
        flex-direction: column-reverse;
    }

    .brand-desktop {
        display: none !important;
    }

    .mobile-show {
        display: block !important;
        margin-right: 0;
    }

    .mobile-show-inline {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .toggle-schedule-btn {
        display: none !important;
    }

    .top-nav {
        border-bottom: none;
        border-top: 1px solid var(--glass-border);
        padding: 12px 20px calc(12px + env(safe-area-inset-bottom)) 20px;
        z-index: 100;
    }

    .nav-controls {
        gap: 12px;
    }

    .sidebar-left {
        position: absolute;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100%;
        z-index: 95;
        transition: left 0.4s ease, background-color 0.8s ease;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
        padding: 25px 20px 25px 20px;
    }

    .sidebar-left.open {
        left: 0;
    }

    .brand-mobile {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 20px;
        padding-bottom: 20px;
        border-bottom: 1px solid var(--glass-border);
    }

    .brand-mobile .logo {
        font-size: 24px;
    }

    .brand-mobile .header-logo {
        width: 40px;
        height: 40px;
        margin-left: 10px;
    }

    .sidebar-right {
        position: absolute;
        top: 0;
        right: -360px;
        width: 320px;
        height: 100%;
        margin-right: 0 !important;
        z-index: 95;
        transition: right 0.4s ease, background-color 0.8s ease;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
    }

    .sidebar-right.open {
        right: 0;
        margin-right: 0 !important;
    }

    .sidebar-right:not(.open) {
        right: -360px;
        margin-right: 0 !important;
    }

    .player-center {
        padding: 20px 15px 40px 15px;
        justify-content: center;
        margin-top: 0;
    }

    .artwork-container {
        width: 240px;
        height: 240px;
        margin-bottom: 20px;
    }

    #track-title {
        font-size: 22px;
        white-space: normal;
        line-height: 1.3;
        margin-bottom: 10px;
    }

    #track-artist {
        font-size: 16px;
        white-space: normal;
    }

    .playback-controls {
        gap: 20px;
    }

    .play-btn {
        width: 55px;
        height: 55px;
        font-size: 22px !important;
    }

    .m3u-btn {
        bottom: 15px;
        right: 15px;
        font-size: 11px;
        padding: 6px 12px;
    }
}