@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #000000;
    --glass-bg: rgba(30, 30, 30, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary-color: #fa243c;
    --primary-hover: #ff3b53;
    --accent-color: #ff6b81;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --radius-lg: 24px;
    --radius-md: 14px;
    --radius-sm: 8px;
    --blur-effect: blur(40px) saturate(180%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 20px 0;
}

/* Background Animated Orbs */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    animation: drift 20s infinite ease-in-out alternate;
}
.orb-1 {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #5e1834, #29081e);
    top: -10%;
    left: -10%;
    opacity: 0.8;
}
.orb-2 {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, #2d1847, #130a1f);
    bottom: -10%;
    right: -10%;
    opacity: 0.8;
    animation-delay: -10s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5vw, -5vh) scale(1.1); }
}

/* Main Container (Login, DJ) */
.container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--blur-effect);
    -webkit-backdrop-filter: var(--blur-effect);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 90%;
    max-width: 650px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* Dashboard Container */
.dashboard-container {
    width: 90%;
    max-width: 650px;
    padding: 20px 0;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
}
.header h1 {
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: -0.5px;
    margin-bottom: 5px;
}
.header p {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.95rem;
}

/* Top Bar (Dashboard) */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.top-bar h1 {
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-badge {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-logout:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

/* Auth Card (Login/Register) */
.auth-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--blur-effect);
    -webkit-backdrop-filter: var(--blur-effect);
    border-radius: var(--radius-lg);
    padding: 35px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 25px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 100px;
    overflow: hidden;
}
.auth-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.auth-tab.active {
    background: var(--primary-color);
    color: white;
    border-radius: 100px;
}

.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.form-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
    font-family: inherit;
}
.form-group input:focus {
    border-color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.5);
}
.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.btn-submit {
    width: 100%;
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 14px 24px;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 5px;
}
.btn-submit:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}
.btn-submit:active {
    transform: scale(0.98);
}

.error-msg {
    background: rgba(250, 36, 60, 0.1);
    border: 1px solid rgba(250, 36, 60, 0.3);
    color: var(--primary-color);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 15px;
    display: none;
}

.footer {
    text-align: center;
    margin-top: 30px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}
.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Stream URL Card */
.stream-card {
    background: linear-gradient(135deg, rgba(250, 36, 60, 0.15), rgba(45, 24, 71, 0.3));
    border: 1px solid rgba(250, 36, 60, 0.2);
    border-radius: var(--radius-lg);
    padding: 25px;
    text-align: center;
    margin-bottom: 20px;
}
.stream-card h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.stream-url {
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--accent-color);
    cursor: pointer;
    transition: all 0.2s ease;
    word-break: break-all;
}
.stream-url:hover {
    background: rgba(0, 0, 0, 0.6);
}
.copy-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Storage Bar */
.storage-bar-container {
    margin-bottom: 25px;
}
.storage-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.storage-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}
.storage-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

/* Card (Glass) */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--blur-effect);
    -webkit-backdrop-filter: var(--blur-effect);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 20px;
    position: relative;
}

/* Now Playing Section */
.now-playing {
    text-align: center;
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

.album-cover-container {
    width: 180px;
    height: 180px;
    margin: 0 auto 20px auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    background: rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--glass-border);
}

#album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: fadeIn 0.5s ease-in;
}

.default-cover {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    color: rgba(255,255,255,0.2);
}
.default-cover i {
    width: 60px;
    height: 60px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.pulsing-dot {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 8px;
    height: 8px;
    background-color: #4cd964;
    border-radius: 50%;
    box-shadow: 0 0 10px #4cd964;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

#current-song {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0;
    letter-spacing: -0.5px;
    word-break: break-word;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
#current-artist {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}
.btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
}
.btn:active {
    transform: scale(0.98);
}
.btn-primary {
    background: var(--primary-color);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-hover);
}

/* Upload Section */
.upload-area {
    border: 1.5px dashed var(--glass-border);
    border-radius: var(--radius-md);
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.2);
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(250, 36, 60, 0.05);
}
.upload-area p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}
#file-input {
    display: none;
}

.upload-progress {
    margin-top: 15px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    display: none;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

/* Link Input Area */
.link-input-area {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    align-items: center;
}
#link-input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
    font-family: inherit;
}
#link-input:focus {
    border-color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.5);
}
#link-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Playlist Section */
.playlist-section {
    margin-top: 35px;
    text-align: left;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 12px;
}
.playlist-header h3 {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.song-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.06);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 12px;
}
.search-bar i {
    color: var(--text-secondary);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.search-bar input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    width: 100%;
    outline: none;
}
.search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.playlist-scroll {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}
.playlist-scroll::-webkit-scrollbar {
    width: 5px;
}
.playlist-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

#playlist {
    list-style: none;
}

.queue-item {
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 14px;
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: grab;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}
.queue-item:hover {
    background: rgba(255, 255, 255, 0.08);
}
.queue-item:active {
    cursor: grabbing;
}
.queue-item.dragging {
    opacity: 0.5;
    background: rgba(250, 36, 60, 0.15);
}

.song-number {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 22px;
    text-align: center;
    opacity: 0.5;
}

.queue-item .drag-handle {
    color: var(--text-secondary);
    cursor: grab;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.queue-item .song-name {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

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

.move-next-btn, .action-btn.move {
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    width: 18px;
    height: 18px;
    opacity: 0;
    background: none;
    border: none;
    font-size: 1rem;
}
.queue-item:hover .move-next-btn,
.queue-item:hover .action-btn.move {
    opacity: 1;
}
.move-next-btn:hover, .action-btn.move:hover {
    color: #4cd964;
    transform: scale(1.15);
}

.delete-btn, .action-btn {
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    padding: 2px;
    width: 18px;
    height: 18px;
    opacity: 0;
    background: none;
    border: none;
    font-size: 1rem;
}
.queue-item:hover .delete-btn,
.queue-item:hover .action-btn {
    opacity: 1;
}
.delete-btn:hover, .action-btn:hover {
    color: var(--primary-color);
    transform: scale(1.15);
}

/* Toast */
.toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--blur-effect);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: bottom 0.3s ease;
    z-index: 1000;
}
.toast.show {
    bottom: 30px;
}

/* Admin Table */
.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.users-table th {
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--glass-border);
}
.users-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}
.status-dot.online {
    background: #4cd964;
    box-shadow: 0 0 8px #4cd964;
}
.status-dot.offline {
    background: rgba(255,255,255,0.2);
}
.toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mode Badge */
.mode-badge {
    display: inline-block;
    background: rgba(76, 217, 100, 0.15);
    color: #4cd964;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 6px;
}

/* Spin Animation */
.spin { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }
