/* 
 * Playlist Panel - Custom Styles
 * Modern dark theme with Bootstrap 5
 */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a1d21;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --body-bg: #0d1117;
    --card-bg: #161b22;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent-primary: #58a6ff;
    --accent-success: #3fb950;
    --accent-warning: #d29922;
    --accent-danger: #f85149;
}

/* Font */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--body-bg);
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* =====================
   SIDEBAR
   ===================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
}

.sidebar-brand i {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.25rem;
    cursor: pointer;
    font-size: 1.25rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-nav .nav-header {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav .nav-link.active {
    color: var(--accent-primary);
    background: rgba(88, 166, 255, 0.1);
    border-left-color: var(--accent-primary);
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--sidebar-border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(88, 166, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 1.25rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* =====================
   MAIN CONTENT
   ===================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.top-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--sidebar-border);
}

.navbar-title {
    font-weight: 500;
    font-size: 1.1rem;
}

.navbar-actions .dropdown-toggle {
    color: var(--text-secondary);
    text-decoration: none;
}

.navbar-actions .dropdown-toggle:hover {
    color: var(--text-primary);
}

.page-content {
    padding: 1.5rem;
}

/* =====================
   CARDS
   ===================== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: 0.75rem;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--sidebar-border);
    padding: 1rem 1.25rem;
}

.card-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--sidebar-border);
    padding: 0.75rem 1.25rem;
}

/* =====================
   STAT CARDS
   ===================== */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.stat-card-primary::before { background: var(--accent-primary); }
.stat-card-success::before { background: var(--accent-success); }
.stat-card-warning::before { background: var(--accent-warning); }
.stat-card-info::before { background: #8957e5; }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card-primary .stat-icon { background: rgba(88, 166, 255, 0.15); color: var(--accent-primary); }
.stat-card-success .stat-icon { background: rgba(63, 185, 80, 0.15); color: var(--accent-success); }
.stat-card-warning .stat-icon { background: rgba(210, 153, 34, 0.15); color: var(--accent-warning); }
.stat-card-info .stat-icon { background: rgba(137, 87, 229, 0.15); color: #8957e5; }

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.stat-footer {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

.stat-footer a {
    color: inherit;
    text-decoration: none;
}

.stat-footer a:hover {
    text-decoration: underline;
}

/* =====================
   TABLES
   ===================== */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    margin: 0;
}

.table th {
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--sidebar-border);
    padding: 0.85rem 1rem;
}

.table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

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

.table-hover tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* =====================
   FORMS
   ===================== */
.form-control,
.form-select {
    background-color: #21262d;
    border: 1px solid var(--sidebar-border);
    color: var(--text-primary);
    padding: 0.6rem 0.9rem;
    color-scheme: dark;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238b949e' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.form-select option {
    background-color: #21262d;
    color: var(--text-primary);
    padding: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    background-color: #30363d;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.form-control:disabled,
.form-select:disabled {
    background-color: #161b22;
    color: var(--text-secondary);
    opacity: 0.7;
}

.form-control[readonly] {
    background-color: #161b22;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.input-group-text {
    background-color: #21262d;
    border: 1px solid var(--sidebar-border);
    color: var(--text-secondary);
}

.form-check-input {
    background-color: #21262d;
    border-color: var(--sidebar-border);
}

.form-check-input:checked {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.form-check-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.form-floating > label {
    color: var(--text-secondary);
}

.form-floating > .form-control,
.form-floating > .form-select {
    background-color: #21262d;
}

/* =====================
   BUTTONS
   ===================== */
.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background: #79b8ff;
    border-color: #79b8ff;
}

.btn-outline-primary {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.btn-outline-primary:hover {
    background: var(--accent-primary);
    color: #fff;
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--sidebar-border);
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--sidebar-border);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.btn-group .btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* =====================
   BADGES
   ===================== */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* =====================
   MODALS
   ===================== */
.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--sidebar-border);
}

.modal-header {
    border-bottom-color: var(--sidebar-border);
}

.modal-footer {
    border-top-color: var(--sidebar-border);
}

/* =====================
   ALERTS
   ===================== */
.alert {
    border-radius: 0.5rem;
    border: none;
}

/* =====================
   DROPDOWN
   ===================== */
.dropdown-menu {
    background: var(--card-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dropdown-item {
    color: var(--text-primary);
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.dropdown-divider {
    border-color: var(--sidebar-border);
}

/* =====================
   PAGINATION
   ===================== */
.pagination {
    gap: 0.25rem;
}

.page-link {
    background: transparent;
    border: 1px solid var(--sidebar-border);
    color: var(--text-secondary);
    border-radius: 0.375rem !important;
    padding: 0.4rem 0.75rem;
}

.page-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--sidebar-border);
    color: var(--text-primary);
}

.page-item.active .page-link {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.page-item.disabled .page-link {
    background: transparent;
    border-color: var(--sidebar-border);
    color: var(--text-secondary);
    opacity: 0.5;
}

/* =====================
   LOGIN PAGE
   ===================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: 1rem;
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: rgba(88, 166, 255, 0.15);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo i {
    font-size: 2rem;
    color: var(--accent-primary);
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    margin: 0;
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--sidebar-border);
}

/* =====================
   CODE STYLING
   ===================== */
code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.85em;
    color: #ff7b72;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 575.98px) {
    .page-content {
        padding: 1rem;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin: 0 auto;
    }
    
    .table th,
    .table td {
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
}

/* Utility */
.user-select-all {
    user-select: all;
}
