/**
 * Admin Dashboard Dark Theme
 * PHP Base Platform - Dark Mode Overrides
 * Activated via: html[data-theme="dark"]
 */

/* ============================================
   DARK THEME VARIABLES
   ============================================ */
[data-theme="dark"] {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --primary-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --secondary-color: #94a3b8;
    --secondary-light: #64748b;
    --accent-color: #22d3ee;
    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.12);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.12);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.12);
    --info: #60a5fa;
    --info-light: rgba(96, 165, 250, 0.12);
    --bg-color: #0b0e1a;
    --bg-secondary: rgba(255, 255, 255, 0.06);
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-bg-solid: #141428;
    --text-color: #c8cdd5;
    --text-muted: #6b7280;
    --text-heading: #f1f5f9;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-solid: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(20, 20, 45, 0.65);
    --glass-bg-hover: rgba(30, 30, 60, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] body {
    background-color: #0b0e1a;
    background-image: 
        radial-gradient(ellipse at 10% 20%, rgba(79, 70, 229, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(124, 58, 237, 0.05) 0%, transparent 50%);
    color: var(--text-color);
}

/* ============================================
   SIDEBAR DARK
   ============================================ */
[data-theme="dark"] .sidebar {
    background: rgba(15, 15, 35, 0.85);
    border-right-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .sidebar-brand {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .sidebar-brand .brand-link {
    color: #e2e8f0;
}

[data-theme="dark"] .sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .sidebar-link {
    color: #94a3b8;
}

[data-theme="dark"] .sidebar-link:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-light);
}

[data-theme="dark"] .sidebar-link.active {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .sidebar-footer {
    border-top-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .sidebar-submenu .sidebar-link.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
}

[data-theme="dark"] .sidebar-submenu .sidebar-link::before {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .sidebar-submenu .sidebar-link:hover::before,
[data-theme="dark"] .sidebar-submenu .sidebar-link.active::before {
    background: var(--primary-light);
}

/* ============================================
   TOP NAVBAR DARK
   ============================================ */
[data-theme="dark"] .top-navbar {
    background: rgba(15, 15, 35, 0.7);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .mobile-toggle {
    color: #e2e8f0;
}

[data-theme="dark"] .mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .navbar-search .search-input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

[data-theme="dark"] .navbar-search .search-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .navbar-search .search-input::placeholder {
    color: #6b7280;
}

[data-theme="dark"] .navbar-search .search-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .nav-icon-btn {
    color: #94a3b8;
}

[data-theme="dark"] .nav-icon-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

[data-theme="dark"] .nav-icon-btn .nav-badge {
    border-color: rgba(15, 15, 35, 0.9);
}

[data-theme="dark"] .nav-profile:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .nav-profile .profile-name {
    color: #e2e8f0;
}

[data-theme="dark"] .nav-profile .profile-role {
    color: #6b7280;
}

/* ============================================
   DROPDOWNS DARK
   ============================================ */
[data-theme="dark"] .dropdown-menu-glass {
    background: rgba(25, 25, 50, 0.9);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .dropdown-menu-glass .dropdown-header {
    color: #6b7280;
}

[data-theme="dark"] .dropdown-menu-glass .dropdown-item {
    color: #c8cdd5;
}

[data-theme="dark"] .dropdown-menu-glass .dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
}

[data-theme="dark"] .dropdown-menu-glass .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .dropdown-notifications .notification-item:hover {
    background: rgba(99, 102, 241, 0.05);
}

[data-theme="dark"] .dropdown-notifications .notification-item.unread {
    background: rgba(59, 130, 246, 0.06);
}

[data-theme="dark"] .notification-content .notification-title {
    color: #e2e8f0;
}

[data-theme="dark"] .notification-content .notification-text {
    color: #6b7280;
}

/* ============================================
   CARDS DARK
   ============================================ */
[data-theme="dark"] .glass-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .card-header-glass {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .card-footer-glass {
    background: rgba(255, 255, 255, 0.02);
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* ============================================
   STAT CARDS DARK
   ============================================ */
[data-theme="dark"] .stat-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .stat-card .stat-value {
    color: #f1f5f9;
}

[data-theme="dark"] .stat-card .stat-label {
    color: #6b7280;
}

[data-theme="dark"] .stat-icon.icon-primary { background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(139,92,246,0.18)); color: #818cf8; }
[data-theme="dark"] .stat-icon.icon-success { background: linear-gradient(135deg, rgba(52,211,153,0.18), rgba(110,231,183,0.18)); color: #34d399; }
[data-theme="dark"] .stat-icon.icon-warning { background: linear-gradient(135deg, rgba(251,191,36,0.18), rgba(252,211,77,0.18)); color: #fbbf24; }
[data-theme="dark"] .stat-icon.icon-danger { background: linear-gradient(135deg, rgba(248,113,113,0.18), rgba(252,165,165,0.18)); color: #f87171; }
[data-theme="dark"] .stat-icon.icon-info { background: linear-gradient(135deg, rgba(96,165,250,0.18), rgba(147,197,253,0.18)); color: #60a5fa; }
[data-theme="dark"] .stat-icon.icon-accent { background: linear-gradient(135deg, rgba(34,211,238,0.18), rgba(103,232,249,0.18)); color: #22d3ee; }

[data-theme="dark"] .stat-trend.trend-neutral {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
}

/* ============================================
   TABLES DARK
   ============================================ */
[data-theme="dark"] .glass-table thead th {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .glass-table tbody td {
    color: #c8cdd5;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .glass-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.03);
}

[data-theme="dark"] .table-actions .btn-icon {
    color: #6b7280;
}

[data-theme="dark"] .table-actions .btn-icon:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--primary-light);
}

[data-theme="dark"] .table-actions .btn-icon.btn-danger:hover {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
}

/* ============================================
   FORMS DARK
   ============================================ */
[data-theme="dark"] .form-label {
    color: #e2e8f0;
}

[data-theme="dark"] .form-control-glass {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

[data-theme="dark"] .form-control-glass:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

[data-theme="dark"] .form-control-glass::placeholder {
    color: #6b7280;
}

[data-theme="dark"] .form-control-glass:disabled,
[data-theme="dark"] .form-control-glass[readonly] {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .form-floating-glass .form-control-glass:focus ~ label,
[data-theme="dark"] .form-floating-glass .form-control-glass:not(:placeholder-shown) ~ label {
    background: #141428;
}

[data-theme="dark"] select.form-control-glass {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .input-group-glass .input-group-text {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

[data-theme="dark"] .form-check-glass label {
    color: #c8cdd5;
}

/* ============================================
   BUTTONS DARK
   ============================================ */
[data-theme="dark"] .btn-glass.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #c8cdd5;
}

[data-theme="dark"] .btn-glass.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .btn-glass.btn-outline-primary {
    border-color: var(--primary-light);
    color: var(--primary-light);
}

[data-theme="dark"] .btn-glass.btn-outline-primary:hover:not(:disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ============================================
   MODALS DARK
   ============================================ */
[data-theme="dark"] .modal-glass .modal-content {
    background: rgba(25, 25, 50, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-glass .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .modal-glass .modal-title {
    color: #f1f5f9;
}

[data-theme="dark"] .modal-glass .modal-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .modal-backdrop-glass {
    background: rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .modal-glass .btn-close {
    filter: invert(1);
    opacity: 0.4;
}

[data-theme="dark"] .modal-glass .btn-close:hover {
    opacity: 0.7;
}

/* ============================================
   TABS DARK
   ============================================ */
[data-theme="dark"] .nav-tabs-glass {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .nav-tabs-glass .nav-link {
    color: #6b7280;
}

[data-theme="dark"] .nav-tabs-glass .nav-link:hover {
    color: var(--primary-light);
    border-bottom-color: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .nav-tabs-glass .nav-link.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary-light);
}

/* ============================================
   TOAST DARK
   ============================================ */
[data-theme="dark"] .toast-glass {
    background: rgba(25, 25, 50, 0.95);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .toast-glass .toast-title {
    color: #f1f5f9;
}

[data-theme="dark"] .toast-glass .toast-message {
    color: #6b7280;
}

[data-theme="dark"] .toast-glass .toast-close {
    color: #6b7280;
}

[data-theme="dark"] .toast-glass .toast-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

/* ============================================
   FOOTER DARK
   ============================================ */
[data-theme="dark"] .admin-footer {
    background: rgba(255, 255, 255, 0.02);
    border-top-color: rgba(255, 255, 255, 0.06);
    color: #6b7280;
}

[data-theme="dark"] .admin-footer a {
    color: #6b7280;
}

[data-theme="dark"] .admin-footer a:hover {
    color: var(--primary-light);
}

/* ============================================
   BREADCRUMBS DARK
   ============================================ */
[data-theme="dark"] .admin-breadcrumb {
    color: #6b7280;
}

[data-theme="dark"] .admin-breadcrumb a {
    color: #6b7280;
}

[data-theme="dark"] .admin-breadcrumb a:hover {
    color: var(--primary-light);
}

[data-theme="dark"] .admin-breadcrumb .breadcrumb-active {
    color: #e2e8f0;
}

/* ============================================
   PAGE HEADER DARK
   ============================================ */
[data-theme="dark"] .page-header .page-title {
    color: #f1f5f9;
}

[data-theme="dark"] .page-header .page-subtitle {
    color: #6b7280;
}

/* ============================================
   FILE UPLOAD DARK
   ============================================ */
[data-theme="dark"] .file-upload-zone {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .file-upload-zone:hover,
[data-theme="dark"] .file-upload-zone.drag-over {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.04);
}

[data-theme="dark"] .file-upload-zone .upload-text {
    color: #e2e8f0;
}

[data-theme="dark"] .file-upload-zone .upload-hint {
    color: #6b7280;
}

[data-theme="dark"] .image-preview-item {
    border-color: rgba(255, 255, 255, 0.1);
}

/* ============================================
   SCROLLBAR DARK
   ============================================ */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #374151;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* ============================================
   PROGRESS DARK
   ============================================ */
[data-theme="dark"] .progress-glass {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .loading-skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
}

/* ============================================
   EMPTY STATE DARK
   ============================================ */
[data-theme="dark"] .empty-state .empty-icon {
    background: rgba(255, 255, 255, 0.04);
    color: #4b5563;
}

[data-theme="dark"] .empty-state .empty-title {
    color: #e2e8f0;
}

[data-theme="dark"] .empty-state .empty-text {
    color: #6b7280;
}

/* ============================================
   STATUS BADGES DARK
   ============================================ */
[data-theme="dark"] .status-badge.status-active { background: rgba(52, 211, 153, 0.12); color: #34d399; }
[data-theme="dark"] .status-badge.status-active::before { background: var(--success); }
[data-theme="dark"] .status-badge.status-inactive { background: rgba(148, 163, 184, 0.12); color: #94a3b8; }
[data-theme="dark"] .status-badge.status-inactive::before { background: var(--secondary-color); }
[data-theme="dark"] .status-badge.status-pending { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }
[data-theme="dark"] .status-badge.status-pending::before { background: var(--warning); }
[data-theme="dark"] .status-badge.status-suspended { background: rgba(248, 113, 113, 0.12); color: #f87171; }
[data-theme="dark"] .status-badge.status-suspended::before { background: var(--danger); }
[data-theme="dark"] .status-badge.status-draft { background: rgba(96, 165, 250, 0.12); color: #60a5fa; }
[data-theme="dark"] .status-badge.status-draft::before { background: var(--info); }
[data-theme="dark"] .status-badge.status-published { background: rgba(52, 211, 153, 0.12); color: #34d399; }
[data-theme="dark"] .status-badge.status-published::before { background: var(--success); }

/* ============================================
   QUICK ACTIONS DARK
   ============================================ */
[data-theme="dark"] .quick-action-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .quick-action-card:hover {
    border-color: var(--primary-light);
}

[data-theme="dark"] .quick-action-card .quick-title {
    color: #e2e8f0;
}

[data-theme="dark"] .quick-action-card .quick-desc {
    color: #6b7280;
}

/* ============================================
   AVATAR DARK
   ============================================ */
[data-theme="dark"] .avatar-text {
    background: var(--primary-gradient);
}

/* ============================================
   DIVIDER DARK
   ============================================ */
[data-theme="dark"] .divider-glass {
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* ============================================
   SIDEBAR OVERLAY DARK
   ============================================ */
[data-theme="dark"] .sidebar-overlay {
    background: rgba(0, 0, 0, 0.6);
}

/* ============================================
   TOOLTIP DARK (Collapsed sidebar)
   ============================================ */
[data-theme="dark"] .admin-wrapper.sidebar-collapsed .sidebar-link:hover::after {
    background: #1e293b;
    color: #e2e8f0;
}

[data-theme="dark"] .admin-wrapper.sidebar-collapsed .sidebar-link:hover::before {
    border-right-color: #1e293b;
}
