/* SpotifySort - Modern Dark Theme */

:root {
    --spotify-green: #1db954;
    --spotify-green-hover: #1ed760;
    --bg-primary: #121212;
    --bg-secondary: #181818;
    --bg-elevated: #282828;
    --bg-highlight: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-subdued: #6a6a6a;
    --border-color: #3e3e3e;
    --danger: #e22134;
    --warning: #ffa500;
    --info: #3b82f6;
    --success: var(--spotify-green);
}

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

body {
    font-family: 'Circular', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    background-color: var(--bg-primary);
    padding: 24px 0;
    border-right: 1px solid var(--border-color);
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 0 24px 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.sidebar-logo i {
    color: var(--spotify-green);
    font-size: 32px;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav-item {
    padding: 8px 24px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
    cursor: pointer;
}

.sidebar-nav-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-elevated);
}

.sidebar-nav-link.active {
    color: var(--text-primary);
    background-color: var(--bg-elevated);
}

.sidebar-nav-link i {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    position: absolute;
    bottom: 24px;
    left: 24px;
    right: 24px;
    padding: 16px;
    background-color: var(--bg-elevated);
    border-radius: 8px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--spotify-green), #1ed760);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    padding: 24px 32px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Sections */
.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.card {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.card:hover {
    background-color: var(--bg-elevated);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.card-clickable {
    cursor: pointer;
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 24px;
}

.card-icon.green {
    background-color: rgba(29, 185, 84, 0.15);
    color: var(--spotify-green);
}

.card-icon.blue {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.card-icon.orange {
    background-color: rgba(255, 165, 0, 0.15);
    color: var(--warning);
}

.card-icon.purple {
    background-color: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-description {
    color: var(--text-secondary);
    font-size: 14px;
}

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

.stat-card {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--spotify-green), #1ed760);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 500px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--spotify-green);
    color: var(--text-primary);
}

.btn-primary:hover {
    background-color: var(--spotify-green-hover);
    transform: scale(1.04);
}

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

.btn-secondary:hover {
    background-color: var(--bg-highlight);
    border-color: var(--text-secondary);
}

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

.btn-danger:hover {
    background-color: #c91c2b;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon {
    padding: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Form Elements */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--spotify-green);
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.1);
}

.form-input::placeholder {
    color: var(--text-subdued);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: var(--bg-elevated);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-container:hover {
    background-color: var(--bg-highlight);
}

.checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--spotify-green);
    cursor: pointer;
}

/* Table */
.table-container {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

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

.table thead {
    background-color: var(--bg-elevated);
}

.table th {
    padding: 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

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

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s;
}

.modal {
    background-color: var(--bg-secondary);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

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

.modal-title {
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

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

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: start;
    gap: 12px;
}

.alert-success {
    background-color: rgba(29, 185, 84, 0.15);
    border: 1px solid rgba(29, 185, 84, 0.3);
    color: var(--spotify-green);
}

.alert-warning {
    background-color: rgba(255, 165, 0, 0.15);
    border: 1px solid rgba(255, 165, 0, 0.3);
    color: var(--warning);
}

.alert-danger {
    background-color: rgba(226, 33, 52, 0.15);
    border: 1px solid rgba(226, 33, 52, 0.3);
    color: var(--danger);
}

/* Loading */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-elevated);
    border-top-color: var(--spotify-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-secondary);
}

.text-success {
    color: var(--spotify-green);
}

.text-danger {
    color: var(--danger);
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 8px;
}

.gap-2 {
    gap: 16px;
}

.gap-3 {
    gap: 24px;
}

.hidden {
    display: none !important;
}
