/* Global Styles & Variables */
:root {
    --primary-color: #007aff;
    --primary-color-dark: #005ecb;
    --bg-color: #f5f5f7;
    --sidebar-bg: #ffffff;
    --text-color: #1d1d1f;
    --text-color-light: #86868b;
    --border-color: #d2d2d7;
    --hover-bg: #f5f5f7;
    --modal-bg: #ffffff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Main Layout */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
}

/* Sidebar */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.2rem; /* Font size adjustment */
    color: var(--text-primary);
    white-space: nowrap; /* Prevent line break */
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-header .fa-music {
    margin-right: 10px;
    font-size: 1.1rem; /* Icon size adjustment */
    color: #000000; /* Change icon color to black */
}

.sidebar-nav {
    margin-top: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.nav-item:hover {
    background-color: var(--hover-bg);
}

.nav-item.active {
    background-color: var(--primary-color);
    color: white;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

/* Main Content Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h1 {
    font-size: 2rem;
    font-weight: 700;
}

/* Buttons */
.btn {
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
}

.btn-secondary {
    background-color: #e5e5e7;
    color: var(--text-color);
}

/* Music List */
.music-list-container {
    background-color: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.music-table {
    width: 100%;
    border-collapse: collapse;
}

.music-table th, .music-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.music-table th {
    font-weight: 600;
    color: var(--text-color-light);
    font-size: 0.875rem;
    text-transform: uppercase;
}

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

.music-table tbody tr:hover {
    background-color: var(--hover-bg);
}

.music-table .cover-col {
    width: 60px;
}

.cover-container {
    position: relative;
    width: 50px;
    height: 50px;
}

.music-table .cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cover-container:hover .play-btn {
    opacity: 1;
}

.play-btn i {
    font-size: 14px;
    margin-left: 2px; /* Center align icon */
}

.music-table .title-col {
    width: 30%;
}

.music-table .artist-col, .music-table .genre-col {
    width: 20%;
}

.music-table .duration-col {
    width: 10%;
}

.music-table .actions-col {
    width: 100px;
    text-align: right;
    white-space: nowrap;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-color-light);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1rem;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.btn-icon:hover {
    background-color: var(--hover-bg);
    color: var(--text-color);
}

.btn-icon.btn-danger:hover {
    color: #ff453a;
}


/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-color-light);
    margin-bottom: 1.5rem;
}

/* Upload Form */
.upload-form {
    background-color: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.file-upload-area {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fafafa;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: #f0f8ff;
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background-color: #e6f3ff;
    transform: scale(1.02);
}

.file-upload-area.has-file {
    border-color: #28a745;
    background-color: #f8fff9;
    border-style: solid;
}

.file-upload-area input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-content i {
    font-size: 2rem;
    color: var(--text-color-light);
    margin-bottom: 1rem;
    display: block;
}

.file-upload-content p {
    font-weight: 500;
    margin: 0.5rem 0;
}

.file-upload-content small {
    color: var(--text-color-light);
    display: block;
    margin-top: 0.5rem;
}

.file-info {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
    font-size: 0.9rem;
}

.file-info .file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.file-info .file-size {
    color: var(--text-color-light);
    font-size: 0.8rem;
}

.file-upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.file-upload-progress .progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--modal-bg);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow);
}

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

.modal-header h3 {
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Loading & Notifications */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#notificationContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.notification {
    background-color: var(--text-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}