/* CSS Design System for Aquila Radio */
:root {
    --bg-gradient: linear-gradient(135deg, #0f0c1b 0%, #15102a 50%, #06040a 100%);
    --primary: #4facfe;
    --primary-glow: rgba(79, 172, 254, 0.4);
    --secondary: #00f2fe;
    --accent: #6157ff;
    --text-main: #ffffff;
    --text-muted: #a0aec0;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.12);
    --danger: #ff4757;
    --success: #2ed573;
    --warning: #ffa502;
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --font-outfit: 'Outfit', sans-serif;
    --font-inter: 'Inter', sans-serif;
}

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

body {
    background: var(--bg-gradient);
    font-family: var(--font-inter);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Glassmorphism Card (Common) */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* --- CLIENT PLAYER INTERFACE --- */
.player-wrapper {
    width: 100%;
    max-width: 460px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.player-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.player-logo-container {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.player-logo-container::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    animation: rotate-slow 20s linear infinite;
    pointer-events: none;
}

.player-logo {
    width: 80%;
    height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.player-logo.playing {
    animation: pulse-logo 4s ease-in-out infinite;
}

/* Visualizer Bars */
.visualizer-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    height: 40px;
    margin-bottom: 1.5rem;
}

.vis-bar {
    width: 4px;
    height: 8px;
    background: linear-gradient(to top, var(--primary), var(--secondary));
    border-radius: 2px;
    transition: height 0.1s ease;
}

/* Simulated visualizer animation */
.playing .vis-bar:nth-child(2n) { animation: bounce-bar-1 1.2s ease-in-out infinite alternate; }
.playing .vis-bar:nth-child(3n) { animation: bounce-bar-2 0.8s ease-in-out infinite alternate; }
.playing .vis-bar:nth-child(5n) { animation: bounce-bar-3 1.5s ease-in-out infinite alternate; }
.playing .vis-bar:nth-child(7n) { animation: bounce-bar-4 1.0s ease-in-out infinite alternate; }

/* Song details & marquee */
.song-info {
    margin-bottom: 2.5rem;
    overflow: hidden;
    position: relative;
    height: 60px;
}

.song-label-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.song-title-wrapper {
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.song-title {
    font-family: var(--font-outfit);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    display: inline-block;
    padding-left: 100%;
    animation: marquee 15s linear infinite;
}

/* Controls */
.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.btn-play-pause {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #0f0c1b;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px var(--primary-glow);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
}

.btn-play-pause:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 28px rgba(0, 242, 254, 0.6);
}

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

.btn-play-pause.playing {
    background: #ffffff;
    color: #0f0c1b;
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.3);
}

/* Volume Slider */
.volume-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 280px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem 1.25rem;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
}

.volume-icon {
    color: var(--text-muted);
    font-size: 1rem;
    width: 20px;
}

.volume-slider {
    flex: 1;
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: background 0.3s;
}

.volume-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--secondary);
    cursor: pointer;
    margin-top: -5px;
    box-shadow: 0 0 10px var(--secondary);
    transition: transform 0.1s, background-color 0.3s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* --- ADMIN LOGIN INTERFACE --- */
.login-wrapper {
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    font-family: var(--font-outfit);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-input {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    color: #fff;
    font-family: var(--font-inter);
    outline: none;
    transition: all 0.3s;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(79, 172, 254, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.btn-primary {
    background: linear-gradient(90deg, var(--accent) 0%, var(--primary) 100%);
    border: none;
    color: #fff;
    font-weight: 700;
    font-family: var(--font-inter);
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    margin-top: 1rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(97, 87, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(97, 87, 255, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.alert-error {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid var(--danger);
    color: #ff6b81;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- ADMIN DASHBOARD --- */
.admin-container {
    width: 100%;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    align-items: flex-start;
}

@media (max-width: 900px) {
    .admin-container {
        grid-template-columns: 1fr;
    }
}

.admin-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.admin-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.admin-header-inline h1 {
    font-family: var(--font-outfit);
    font-size: 1.5rem;
    font-weight: 800;
}

.btn-logout {
    color: var(--danger);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: opacity 0.2s;
}

.btn-logout:hover {
    opacity: 0.8;
}

.sidebar-title {
    font-family: var(--font-outfit);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Playback Control Panel */
.panel-controls {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.panel-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.panel-row .label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.panel-row .value {
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
}

.btn-action-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-family: var(--font-inter);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action.play {
    background: var(--success);
    color: #0f0c1b;
}

.btn-action.pause {
    background: var(--warning);
    color: #0f0c1b;
}

.btn-action.loop {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid var(--glass-border);
}

.btn-action.loop.active {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: #0f0c1b;
    border-color: transparent;
}

.btn-action:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

/* Upload zone */
.upload-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-drop-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.01);
}

.file-drop-area:hover, .file-drop-area.drag-over {
    border-color: var(--primary);
    background: rgba(79, 172, 254, 0.03);
}

.file-drop-area i {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.file-drop-area span {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.file-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.selected-file-name {
    font-size: 0.85rem;
    color: var(--success);
    margin-top: 0.5rem;
    font-weight: 500;
    text-align: center;
}

/* Playlist main section */
.playlist-main {
    flex: 1;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.playlist-header h2 {
    font-family: var(--font-outfit);
    font-size: 1.5rem;
    font-weight: 800;
}

.playlist-count {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    border: 1px solid var(--glass-border);
}

/* Sortable Playlist */
.songs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.song-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    transition: all 0.2s;
    user-select: none;
}

.song-item.playing {
    border-color: rgba(79, 172, 254, 0.4);
    background: rgba(79, 172, 254, 0.03);
}

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 0.25rem;
}

.drag-handle:active {
    cursor: grabbing;
}

.song-index {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    width: 20px;
}

.song-item.playing .song-index {
    color: var(--primary);
}

.song-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.song-details .title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

.song-item.playing .song-details .title {
    color: var(--secondary);
}

.song-details .meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.75rem;
}

.song-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-item-action {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-item-action:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.btn-item-action.play-next:hover {
    color: var(--primary);
    border-color: rgba(79, 172, 254, 0.3);
}

.btn-item-action.delete:hover {
    color: var(--danger);
    border-color: rgba(255, 71, 87, 0.3);
}

/* Drag and Drop styling from SortableJS */
.sortable-ghost {
    opacity: 0.4;
    background: rgba(79, 172, 254, 0.1);
    border-style: dashed;
}

.sortable-chosen {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Empty Playlist State */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.01);
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* --- KEYFRAME ANIMATIONS --- */
@keyframes rotate-slow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-logo {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)); }
    50% { transform: scale(1.03); filter: drop-shadow(0 4px 18px var(--primary-glow)); }
}

@keyframes marquee {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* Visualizer bar animations */
@keyframes bounce-bar-1 {
    0% { height: 8px; }
    100% { height: 35px; }
}

@keyframes bounce-bar-2 {
    0% { height: 12px; }
    100% { height: 28px; }
}

@keyframes bounce-bar-3 {
    0% { height: 6px; }
    100% { height: 32px; }
}

@keyframes bounce-bar-4 {
    0% { height: 10px; }
    100% { height: 25px; }
}
