@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    --bg-dark: #0d0914;
    --accent-violet: #b392f0;
    --accent-violet-glow: rgba(179, 146, 240, 0.4);
    --glass-bg: rgba(25, 20, 35, 0.5);
    --glass-border: rgba(255, 255, 255, 0.06);
    --text-main: #f5f0ff;
    --text-muted: #958da5;
    --card-radius: 16px;
    --btn-radius: 12px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Ambient Background Orbs */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
    pointer-events: none;
}
body::before {
    width: 300px;
    height: 300px;
    background: var(--accent-violet);
    top: -50px;
    left: -50px;
    opacity: 0.15;
}
body::after {
    width: 400px;
    height: 400px;
    background: #6a4c9c;
    bottom: -100px;
    right: -100px;
    opacity: 0.1;
}

/* Typography */
h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

.text-accent {
    color: var(--accent-violet);
}

/* Layout */
.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.admin-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 20px;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title i {
    color: var(--accent-violet);
}

/* Glassmorphism Components */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.glass-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--btn-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}
.glass-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(179, 146, 240, 0.2);
    transform: translateY(-2px);
}

/* Icon Avatar (Replacement for Photos) */
.icon-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(179, 146, 240, 0.08);
    border: 1px solid rgba(179, 146, 240, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--accent-violet);
    flex-shrink: 0;
}

/* Form Elements */
.input-field {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--btn-radius);
    padding: 14px 16px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
}
.input-field:focus {
    border-color: var(--accent-violet);
    box-shadow: 0 0 0 2px var(--accent-violet-glow);
}

.input-group {
    position: relative;
    width: 100%;
}
.input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.input-group .input-field {
    padding-left: 44px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #9b72e3, #6a4c9c);
    color: white;
    border: none;
    border-radius: var(--btn-radius);
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.btn-primary:hover {
    box-shadow: 0 4px 20px var(--accent-violet-glow);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    width: auto;
}

.w-auto {
    width: auto !important;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    border-radius: var(--btn-radius);
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}
.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
}
.btn-icon:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* Tabs */
.tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--btn-radius);
    padding: 6px;
    margin-bottom: 24px;
    border: 1px solid var(--glass-border);
}
.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    font-family: inherit;
}
.tab-btn.active {
    background: var(--glass-bg);
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.tab-btn:hover:not(.active) {
    color: var(--text-main);
}

.badge {
    position: absolute;
    top: 6px;
    right: 8px;
    background: var(--accent-violet);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

/* Song Info */
.song-info {
    flex-grow: 1;
    min-width: 0;
}
.song-title {
    font-weight: 600;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.song-artist {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Layout Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.text-sm { font-size: 0.85rem; }
.text-muted { color: var(--text-muted); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.min-h-screen { min-height: 100vh; }
.flex-grow { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.ml-auto { margin-left: auto; }
.mr-2 { margin-right: 8px; }
.mr-4 { margin-right: 16px; }
.min-w-0 { min-width: 0; }
.table-badge {
    background: rgba(179, 146, 240, 0.15);
    color: var(--accent-violet);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(179, 146, 240, 0.3);
}

.error-msg {
    background: rgba(255, 95, 109, 0.1);
    color: #ff5f6d;
    padding: 14px;
    border-radius: var(--btn-radius);
    border: 1px solid rgba(255, 95, 109, 0.3);
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Grid & Utility (for Admin Panel) */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gap-6 { gap: 24px; }
.col-span-full { grid-column: 1 / -1; }
.max-w-md { max-width: 28rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-6 { padding: 24px; }
.p-5 { padding: 20px; }
.p-4 { padding: 16px; }

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-50 { z-index: 50; }
.z-10 { z-index: 10; }
.absolute { position: absolute; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.max-h-\[600px\] { max-height: 600px; }
.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: var(--card-radius); }
.border-b { border-bottom: 1px solid var(--glass-border); }
.bg-black\/60 { background-color: rgba(0,0,0,0.7); }
.backdrop-blur-sm { backdrop-filter: blur(8px); }
.transform { transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0)) scaleX(var(--tw-scale-x, 1)) scaleY(var(--tw-scale-y, 1)); }
.scale-95 { --tw-scale-x: .95; --tw-scale-y: .95; }
.scale-100 { --tw-scale-x: 1; --tw-scale-y: 1; }
.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }
.transition-all { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); }

/* specific components for admin */
.ast-widget {
    background: var(--glass-bg);
    border: 1px solid rgba(179, 146, 240, 0.2);
    border-radius: var(--card-radius);
    padding: 24px;
}
.progress-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    height: 8px;
    margin-bottom: 4px;
}
.progress-bar {
    background: var(--accent-violet);
    height: 8px;
    border-radius: 9999px;
    transition: width 0.5s linear;
}
/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 1px;
    background-color: var(--text-muted);
    transition: .3s;
    border-radius: 50%;
}
input:checked + .toggle-slider {
    background-color: rgba(255, 95, 109, 0.5);
    border-color: #ff5f6d;
}
input:checked + .toggle-slider:before {
    transform: translateX(16px);
    background-color: white;
}

/* Table Queue Chip */
.tq-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
    margin-right: 8px;
    margin-bottom: 8px;
}
.tq-chip.active {
    background: rgba(179, 146, 240, 0.2);
    border-color: var(--accent-violet);
    color: white;
}
.tq-chip .tq-remove-btn {
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transition: all 0.2s;
}
.tq-chip .tq-remove-btn:hover {
    color: white;
    background: rgba(255, 95, 109, 0.8);
}
    background: rgba(255, 95, 109, 0.8);
}

/* Segmented Control */
.segmented-control {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.mode-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.mode-btn.active {
    background: white;
    color: var(--bg-dark) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
