/* Root Variables */
:root {
    --primary-color: #6c63ff;
    --primary-dark: #5a52d6;
    --secondary-color: #ff6584;
    --success-color: #00c853;
    --warning-color: #ffc107;
    --danger-color: #ff4757;
    --dark-bg: #0a0a0a;
    --darker-bg: #050505;
    --card-bg: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --border-color: #2a2a2a;
    --hover-bg: #2a2a2a;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* App Container */
.app-container {
    display: flex;
    margin-top: 70px;
    min-height: calc(100vh - 70px);
}

#main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    margin-bottom: 90px;
}

/* Audio Player */
#audio-player-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-secondary {
    background: var(--hover-bg);
    color: var(--text-primary);
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-success {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--hover-bg);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
}

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

/* Forms */
.form-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 40px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: var(--darker-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: var(--danger-color);
}

.field-error {
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 5px;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Grids */
.songs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.artists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

.dashboard-section {
    margin-bottom: 30px;
}

.dashboard-section h2 {
    margin-bottom: 20px;
    font-size: 20px;
}

.dashboard-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Admin Section */
.admin-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
}

.admin-section h2 {
    margin-bottom: 20px;
}

.admin-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.pending-song-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.pending-song-item:last-child {
    border-bottom: none;
}

.pending-song-item .song-info {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.pending-song-item .song-info strong {
    font-size: 16px;
}

.pending-song-item .song-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.pending-song-item .song-actions {
    display: flex;
    gap: 10px;
}

/* Upload Area */
.upload-container {
    max-width: 800px;
    margin: 0 auto;
}

.upload-container h1 {
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 60px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(108, 99, 255, 0.05);
}

.upload-area i {
    font-size: 48px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.upload-form {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    margin-top: 20px;
}

.upload-progress {
    text-align: center;
    padding: 40px;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s;
}

/* Loading */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.loading-container .spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-container p {
    color: var(--text-secondary);
    font-size: 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error */
.error {
    text-align: center;
    padding: 50px;
    color: var(--danger-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    margin-bottom: 20px;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
}

.toast {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
    max-width: 350px;
    border-left: 4px solid;
}

.toast-success {
    border-left-color: var(--success-color);
}

.toast-error {
    border-left-color: var(--danger-color);
}

.toast-info {
    border-left-color: var(--primary-color);
}

.toast-warning {
    border-left-color: var(--warning-color);
}

.toast i {
    font-size: 18px;
}

.toast-success i { color: var(--success-color); }
.toast-error i { color: var(--danger-color); }
.toast-info i { color: var(--primary-color); }
.toast-warning i { color: var(--warning-color); }

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 24px;
    padding: 60px 40px;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    color: white;
}

.hero-section p {
    font-size: 18px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

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

.hero-buttons .btn-primary:hover {
    background: rgba(255,255,255,0.9);
}

.hero-buttons .btn-outline {
    border-color: white;
    color: white;
}

.hero-buttons .btn-outline:hover {
    background: rgba(255,255,255,0.1);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.view-all:hover {
    color: var(--primary-dark);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--darker-bg) 100%);
    border-radius: 24px;
    padding: 50px;
    text-align: center;
    border: 1px solid var(--border-color);
    margin-top: 40px;
}

.cta-content h2 {
    font-size: 28px;
    margin-bottom: 16px;
}

.cta-content p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Genre Filters */
.genre-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.genre-filter {
    padding: 8px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.genre-filter:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
}

.genre-filter.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Pagination */
.pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.pagination-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
}

.page-info {
    padding: 0 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    #main-content {
        margin-left: 0;
        padding: 1rem;
        margin-bottom: 120px;
    }
    
    .songs-grid,
    .albums-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card .value {
        font-size: 24px;
    }
    
    .hero-section {
        padding: 40px 20px;
    }
    
    .hero-section h1 {
        font-size: 32px;
    }
    
    .hero-section p {
        font-size: 16px;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .section-header h2 {
        font-size: 20px;
    }
    
    .genre-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
    }
    
    .pending-song-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .pending-song-item .song-info {
        flex-direction: column;
        gap: 5px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .cta-section {
        padding: 30px 20px;
    }
    
    .cta-content h2 {
        font-size: 22px;
    }
}

/* ==================== FIXES FOR OVERALL LAYOUT ==================== */

/* Ensure main content has proper spacing */
#main-content {
    overflow-x: auto;
}

/* Fix for containers */
.container {
    max-width: 100%;
    overflow-x: auto;
}

/* Improve card responsiveness */
.stat-card, .stat-card-sm {
    box-sizing: border-box;
}

/* Fix for buttons on mobile */
@media (max-width: 768px) {
    .btn-primary, .btn-secondary, .btn-outline, .btn-danger, .btn-success {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Ensure proper scrolling on tables */
.data-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Verification Info Modal */
.verification-info {
    text-align: center;
    padding: 10px;
}

.verification-info i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.verification-info h3 {
    margin-bottom: 12px;
}

.verification-info p {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.verification-info hr {
    margin: 16px 0;
    border-color: var(--border-color);
}

.verification-info small {
    color: var(--text-secondary);
}

#resend-link {
    cursor: pointer;
    text-decoration: underline;
}

/* Forgot Password & Reset Password Pages */
.form-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

.success-icon {
    text-align: center;
    margin-bottom: 20px;
}

.success-icon i {
    font-size: 64px;
    color: var(--success-color);
}

.error-message {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    text-align: center;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

#resend-link {
    cursor: pointer;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.fa-spinner {
    margin-right: 8px;
}