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

:root {
    /* Color Palette */
    --bg-primary: hsl(240, 15%, 7%);
    --bg-secondary: hsl(240, 14%, 11%);
    --bg-surface: hsl(240, 12%, 16%);
    
    --accent: hsl(271, 91%, 65%);
    --accent-hover: hsl(271, 91%, 72%);
    --accent-glow: hsla(271, 91%, 65%, 0.4);
    --accent-gradient: linear-gradient(135deg, hsl(271, 91%, 65%) 0%, hsl(315, 90%, 58%) 100%);
    --accent-gradient-hover: linear-gradient(135deg, hsl(271, 91%, 72%) 0%, hsl(315, 90%, 66%) 100%);
    
    --success: hsl(142, 72%, 50%);
    --error: hsl(350, 89%, 60%);
    --warning: hsl(35, 92%, 55%);
    
    --text-primary: hsl(0, 0%, 98%);
    --text-secondary: hsl(240, 5%, 75%);
    --text-muted: hsl(240, 4%, 55%);
    
    /* UI Styling */
    --glass-bg: rgba(15, 15, 25, 0.45);
    --glass-border: rgba(255, 255, 255, 0.07);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

a {
    color: inherit;
    text-decoration: none;
}

input, button, select, textarea {
    font-family: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
}

/* Layout Wrapper */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

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

/* Sidebar Navigation */
.sidebar {
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (max-width: 900px) {
    .sidebar {
        display: none;
    }
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--accent-glow);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
    background-color: var(--bg-surface);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--accent);
}

/* Header & Navbar for Mobile */
.mobile-header {
    display: none;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 900px) {
    .mobile-header {
        display: flex;
    }
}

/* Main Content Area */
.main-content {
    padding: 2.5rem;
    overflow-y: auto;
    padding-bottom: 120px;
}

@media (max-width: 600px) {
    .main-content {
        padding: 1.5rem;
        padding-bottom: 130px;
    }
}

/* Search Bar & Filters */
.search-wrapper {
    position: relative;
    max-width: 500px;
    width: 100%;
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Grid & Section layout */
.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.genre-tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.genre-tag {
    padding: 0.5rem 1.25rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: var(--transition);
    cursor: pointer;
}

.genre-tag:hover, .genre-tag.active {
    background: var(--accent-gradient);
    color: var(--text-primary);
    border-color: transparent;
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* Songs Grid */
.songs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

@media (max-width: 500px) {
    .songs-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }
}

/* Glass Card */
.song-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.song-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 24px rgba(0,0,0,0.5);
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1rem;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.song-card:hover .card-img {
    transform: scale(1.08);
}

.play-hover-btn {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.song-card:hover .play-hover-btn {
    opacity: 1;
}

.play-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--accent-glow);
    transform: translateY(10px);
    transition: var(--transition);
}

.song-card:hover .play-icon-circle {
    transform: translateY(0);
}

.song-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-card-artist {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Detail Page Layout */
.detail-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 3rem;
    margin-top: 1rem;
}

@media (max-width: 800px) {
    .detail-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.detail-img-box {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    border: 1px solid var(--glass-border);
}

.detail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.detail-tag {
    align-self: flex-start;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    background-color: hsla(271, 91%, 65%, 0.15);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.detail-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.detail-meta {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.detail-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: var(--bg-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.stat-val {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-lbl {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Buttons */
.btn {
    padding: 0.9rem 2rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--text-primary);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 4px 25px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: hsl(240, 12%, 22%);
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

/* Floating Bottom Audio Player */
.audio-player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    padding: 1.25rem 2.5rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.audio-player-bar.active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .audio-player-bar {
        flex-direction: column;
        padding: 1rem;
        gap: 0.75rem;
    }
}

.player-track-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 25%;
    min-width: 200px;
}

@media (max-width: 768px) {
    .player-track-info {
        width: 100%;
        justify-content: center;
    }
}

.player-img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--glass-border);
}

.player-details {
    overflow: hidden;
}

.player-title {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-artist {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex-grow: 1;
    max-width: 600px;
}

@media (max-width: 768px) {
    .player-controls {
        width: 100%;
    }
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.control-btn {
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.control-btn:hover {
    color: var(--text-primary);
}

.control-btn.btn-play-pause {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--text-primary);
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn.btn-play-pause:hover {
    transform: scale(1.05);
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.progress-bar-wrap {
    flex-grow: 1;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    width: 0%;
    position: relative;
}

.progress-bar-wrap:hover .progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--text-primary);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.time-display {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 35px;
}

.player-vol-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 20%;
    min-width: 120px;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .player-vol-container {
        display: none;
    }
}

.vol-slider {
    width: 70px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
}

.vol-fill {
    height: 100%;
    background: var(--text-primary);
    border-radius: var(--radius-full);
    width: 80%;
}

/* Admin Dashboard Elements */
.admin-login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    background: radial-gradient(circle at 10% 20%, rgb(10, 10, 25) 0%, rgb(4, 4, 10) 90.1%);
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--glass-shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Alert Notification box */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-error {
    background-color: hsla(350, 89%, 60%, 0.15);
    color: var(--error);
    border: 1px solid hsla(350, 89%, 60%, 0.25);
}

.alert-success {
    background-color: hsla(142, 72%, 50%, 0.15);
    color: var(--success);
    border: 1px solid hsla(142, 72%, 50%, 0.25);
}

/* Stats Dashboard grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: hsla(271, 91%, 65%, 0.1);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-number {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.1;
    font-family: 'Outfit', sans-serif;
}

.stat-name {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Admin Table styles */
.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th, .admin-table td {
    padding: 1rem 1.5rem;
}

.admin-table th {
    background-color: rgba(255,255,255,0.02);
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
}

.admin-table td {
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.95rem;
    color: var(--text-secondary);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.table-song-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.table-song-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.action-links {
    display: flex;
    gap: 0.75rem;
}

.action-link {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.action-edit {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
}

.action-edit:hover {
    background: var(--bg-surface);
}

.action-delete {
    background: hsla(350, 89%, 60%, 0.1);
    color: var(--error);
    border: 1px solid hsla(350, 89%, 60%, 0.15);
}

.action-delete:hover {
    background: hsla(350, 89%, 60%, 0.2);
}

/* File Upload drag-and-drop placeholder style */
.file-upload-area {
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-md);
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background-color: rgba(255,255,255,0.01);
}

.file-upload-area:hover, .file-upload-area.drag-over {
    border-color: var(--accent);
    background-color: hsla(271, 91%, 65%, 0.02);
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.file-upload-area:hover .upload-icon {
    color: var(--accent);
    transform: translateY(-5px);
}

/* Ad Placeholders */
.ad-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 1.5rem 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    position: relative;
    overflow: hidden;
}

.ad-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.ad-placeholder-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.ad-header {
    max-width: 728px;
    width: 100%;
    height: 90px;
    margin: 0 auto 2rem auto;
}

.ad-sidebar {
    width: 100%;
    min-height: 250px;
    margin: 1rem 0;
}

.ad-download {
    max-width: 336px;
    width: 100%;
    height: 280px;
    margin: 2rem auto;
}
