/* 🎨 Login-Based Theme System - 6 Color Themes */
/* تطبيق ألوان Login على كامل النظام الداخلي */

/* ==================== الثيم البنفسجي الأصلي (Purple) ==================== */
:root[data-login-theme="purple"],
:root[data-login-theme="default"] {
    /* Primary Colors */
    --primary-color: #667eea;
    --primary-hover: #5568d3;
    --primary-dark: #5568d3;
    --primary-darker: #4a52b8;
    --primary-light: #764ba2;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Accent Colors */
    --accent-color: #764ba2;
    --accent-hover: #653a91;
    
    /* Gradients - System Wide */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #5568d3 0%, #667eea 100%);
    --gradient-navbar: linear-gradient(135deg, #4a52b8 0%, #667eea 50%, #5568d3 100%);
    --gradient-sidebar: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    --header-gradient: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.92) 50%, rgba(118, 75, 162, 0.90) 100%);
    
    /* Sidebar */
    --sidebar-bg: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    
    /* Buttons */
    --btn-primary-bg: linear-gradient(135deg, #667eea, #764ba2);
    --btn-primary-hover: linear-gradient(135deg, #5568d3, #653a91);
    
    /* Cards & Headers */
    --card-header-bg: linear-gradient(135deg, #667eea, #764ba2);
    --badge-primary: #667eea;
    
    /* Links */
    --link-color: #667eea;
    --link-hover: #5568d3;
    
    /* Table Colors */
    --table-header-bg: linear-gradient(135deg, #5568d3 0%, #667eea 100%);
    --table-hover-bg: rgba(102, 126, 234, 0.08);
    --table-stripe-bg: rgba(102, 126, 234, 0.03);
}

/* ==================== الثيم الأزرق (Blue) ==================== */
:root[data-login-theme="blue"] {
    /* Primary Colors */
    --primary-color: #1e3c72;
    --primary-hover: #152a52;
    --primary-dark: #152a52;
    --primary-darker: #0f1d39;
    --primary-light: #2a5298;
    --primary-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    
    /* Accent Colors */
    --accent-color: #2a5298;
    --accent-hover: #1f4178;
    
    /* Gradients - System Wide */
    --gradient-primary: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    --gradient-secondary: linear-gradient(135deg, #152a52 0%, #1e3c72 100%);
    --gradient-navbar: linear-gradient(135deg, #0f1d39 0%, #1e3c72 50%, #152a52 100%);
    --gradient-sidebar: linear-gradient(180deg, #1e3c72 0%, #2a5298 100%);
    --header-gradient: linear-gradient(135deg, rgba(30, 60, 114, 0.95) 0%, rgba(42, 82, 152, 0.92) 50%, rgba(42, 82, 152, 0.90) 100%);
    
    /* Sidebar */
    --sidebar-bg: linear-gradient(180deg, #1e3c72 0%, #2a5298 100%);
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    
    /* Buttons */
    --btn-primary-bg: linear-gradient(135deg, #1e3c72, #2a5298);
    --btn-primary-hover: linear-gradient(135deg, #152a52, #1f4178);
    
    /* Cards & Headers */
    --card-header-bg: linear-gradient(135deg, #1e3c72, #2a5298);
    --badge-primary: #1e3c72;
    
    /* Links */
    --link-color: #1e3c72;
    --link-hover: #2a5298;
    
    /* Table Colors */
    --table-header-bg: linear-gradient(135deg, #152a52 0%, #1e3c72 100%);
    --table-hover-bg: rgba(30, 60, 114, 0.08);
    --table-stripe-bg: rgba(30, 60, 114, 0.03);
}

/* ==================== الثيم الأخضر (Green) ==================== */
:root[data-login-theme="green"] {
    /* Primary Colors */
    --primary-color: #134e5e;
    --primary-hover: #0d3640;
    --primary-dark: #0d3640;
    --primary-darker: #082228;
    --primary-light: #71b280;
    --primary-gradient: linear-gradient(135deg, #134e5e 0%, #71b280 100%);
    
    /* Accent Colors */
    --accent-color: #71b280;
    --accent-hover: #5a8f66;
    
    /* Gradients - System Wide */
    --gradient-primary: linear-gradient(135deg, #134e5e 0%, #71b280 100%);
    --gradient-secondary: linear-gradient(135deg, #0d3640 0%, #134e5e 100%);
    --gradient-navbar: linear-gradient(135deg, #082228 0%, #134e5e 50%, #0d3640 100%);
    --gradient-sidebar: linear-gradient(180deg, #134e5e 0%, #71b280 100%);
    --header-gradient: linear-gradient(135deg, rgba(19, 78, 94, 0.95) 0%, rgba(113, 178, 128, 0.92) 50%, rgba(113, 178, 128, 0.90) 100%);
    
    /* Sidebar */
    --sidebar-bg: linear-gradient(180deg, #134e5e 0%, #71b280 100%);
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    
    /* Buttons */
    --btn-primary-bg: linear-gradient(135deg, #134e5e, #71b280);
    --btn-primary-hover: linear-gradient(135deg, #0d3640, #5a8f66);
    
    /* Cards & Headers */
    --card-header-bg: linear-gradient(135deg, #134e5e, #71b280);
    --badge-primary: #134e5e;
    
    /* Links */
    --link-color: #134e5e;
    --link-hover: #71b280;
    
    /* Table Colors */
    --table-header-bg: linear-gradient(135deg, #0d3640 0%, #134e5e 100%);
    --table-hover-bg: rgba(19, 78, 94, 0.08);
    --table-stripe-bg: rgba(19, 78, 94, 0.03);
}

/* ==================== الثيم السماوي (Sky) ==================== */
:root[data-login-theme="sky"] {
    /* Primary Colors */
    --primary-color: #005c97;
    --primary-hover: #004571;
    --primary-dark: #004571;
    --primary-darker: #003254;
    --primary-light: #363795;
    --primary-gradient: linear-gradient(135deg, #005c97 0%, #363795 100%);
    
    /* Accent Colors */
    --accent-color: #363795;
    --accent-hover: #2a2b75;
    
    /* Gradients - System Wide */
    --gradient-primary: linear-gradient(135deg, #005c97 0%, #363795 100%);
    --gradient-secondary: linear-gradient(135deg, #004571 0%, #005c97 100%);
    --gradient-navbar: linear-gradient(135deg, #003254 0%, #005c97 50%, #004571 100%);
    --gradient-sidebar: linear-gradient(180deg, #005c97 0%, #363795 100%);
    --header-gradient: linear-gradient(135deg, rgba(0, 92, 151, 0.95) 0%, rgba(54, 55, 149, 0.92) 50%, rgba(54, 55, 149, 0.90) 100%);
    
    /* Sidebar */
    --sidebar-bg: linear-gradient(180deg, #005c97 0%, #363795 100%);
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    
    /* Buttons */
    --btn-primary-bg: linear-gradient(135deg, #005c97, #363795);
    --btn-primary-hover: linear-gradient(135deg, #004571, #2a2b75);
    
    /* Cards & Headers */
    --card-header-bg: linear-gradient(135deg, #005c97, #363795);
    --badge-primary: #005c97;
    
    /* Links */
    --link-color: #005c97;
    --link-hover: #363795;
    
    /* Table Colors */
    --table-header-bg: linear-gradient(135deg, #004571 0%, #005c97 100%);
    --table-hover-bg: rgba(0, 92, 151, 0.08);
    --table-stripe-bg: rgba(0, 92, 151, 0.03);
}

/* ==================== الثيم البرتقالي (Orange) ==================== */
:root[data-login-theme="orange"] {
    /* Primary Colors */
    --primary-color: #d84315;
    --primary-hover: #b03710;
    --primary-dark: #b03710;
    --primary-darker: #8b2c0c;
    --primary-light: #e65100;
    --primary-gradient: linear-gradient(135deg, #d84315 0%, #e65100 100%);
    
    /* Accent Colors */
    --accent-color: #e65100;
    --accent-hover: #c44600;
    
    /* Gradients - System Wide */
    --gradient-primary: linear-gradient(135deg, #d84315 0%, #e65100 100%);
    --gradient-secondary: linear-gradient(135deg, #b03710 0%, #d84315 100%);
    --gradient-navbar: linear-gradient(135deg, #8b2c0c 0%, #d84315 50%, #b03710 100%);
    --gradient-sidebar: linear-gradient(180deg, #d84315 0%, #e65100 100%);
    --header-gradient: linear-gradient(135deg, rgba(216, 67, 21, 0.95) 0%, rgba(230, 81, 0, 0.92) 50%, rgba(230, 81, 0, 0.90) 100%);
    
    /* Sidebar */
    --sidebar-bg: linear-gradient(180deg, #d84315 0%, #e65100 100%);
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    
    /* Buttons */
    --btn-primary-bg: linear-gradient(135deg, #d84315, #e65100);
    --btn-primary-hover: linear-gradient(135deg, #b03710, #c44600);
    
    /* Cards & Headers */
    --card-header-bg: linear-gradient(135deg, #d84315, #e65100);
    --badge-primary: #d84315;
    
    /* Links */
    --link-color: #d84315;
    --link-hover: #e65100;
    
    /* Table Colors */
    --table-header-bg: linear-gradient(135deg, #b03710 0%, #d84315 100%);
    --table-hover-bg: rgba(216, 67, 21, 0.08);
    --table-stripe-bg: rgba(216, 67, 21, 0.03);
}

/* ==================== الثيم الرمادي (Gray) ==================== */
:root[data-login-theme="gray"] {
    /* Primary Colors */
    --primary-color: #232526;
    --primary-hover: #1a1b1c;
    --primary-dark: #1a1b1c;
    --primary-darker: #0f1010;
    --primary-light: #414345;
    --primary-gradient: linear-gradient(135deg, #232526 0%, #414345 100%);
    
    /* Accent Colors */
    --accent-color: #414345;
    --accent-hover: #353637;
    
    /* Gradients - System Wide */
    --gradient-primary: linear-gradient(135deg, #232526 0%, #414345 100%);
    --gradient-secondary: linear-gradient(135deg, #1a1b1c 0%, #232526 100%);
    --gradient-navbar: linear-gradient(135deg, #0f1010 0%, #232526 50%, #1a1b1c 100%);
    --gradient-sidebar: linear-gradient(180deg, #232526 0%, #414345 100%);
    --header-gradient: linear-gradient(135deg, rgba(35, 37, 38, 0.95) 0%, rgba(65, 67, 69, 0.92) 50%, rgba(65, 67, 69, 0.90) 100%);
    
    /* Sidebar */
    --sidebar-bg: linear-gradient(180deg, #232526 0%, #414345 100%);
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    
    /* Buttons */
    --btn-primary-bg: linear-gradient(135deg, #232526, #414345);
    --btn-primary-hover: linear-gradient(135deg, #1a1b1c, #353637);
    
    /* Cards & Headers */
    --card-header-bg: linear-gradient(135deg, #232526, #414345);
    --badge-primary: #232526;
    
    /* Links */
    --link-color: #232526;
    --link-hover: #414345;
    
    /* Table Colors */
    --table-header-bg: linear-gradient(135deg, #1a1b1c 0%, #232526 100%);
    --table-hover-bg: rgba(35, 37, 38, 0.08);
    --table-stripe-bg: rgba(35, 37, 38, 0.03);
}

/* ==================== تطبيق الثيمات على العناصر ==================== */

/* ===== TopBar / Navbar ===== */
main .top-row,
.top-row.navbar {
    background: var(--gradient-navbar) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1) !important;
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* ===== Page Headers ===== */
.page-header,
.wizard-header {
    background: var(--gradient-primary) !important;
    transition: background 0.3s ease;
}

/* ===== Sidebar ===== */
.sidebar,
.nav-scrollable {
    background: var(--sidebar-bg) !important;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--sidebar-hover) !important;
}

/* ===== Buttons ===== */
.btn-primary {
    background: var(--btn-primary-bg) !important;
    border: none !important;
}

.btn-primary:hover {
    background: var(--btn-primary-hover) !important;
}

.btn:not(.btn-secondary):not(.btn-success):not(.btn-danger):not(.btn-warning):not(.btn-info):not(.btn-light):not(.btn-dark):not(.btn-link):not(.btn-outline-primary):not(.btn-outline-secondary) {
    background: var(--btn-primary-bg) !important;
}

/* ===== Cards ===== */
.card-header.bg-primary,
.card-header {
    background: var(--card-header-bg) !important;
}

/* ===== Badges ===== */
.badge.bg-primary {
    background-color: var(--badge-primary) !important;
}

/* ===== Links ===== */
a:not(.btn):not(.nav-link):not(.dropdown-item) {
    color: var(--link-color);
}

a:not(.btn):not(.nav-link):not(.dropdown-item):hover {
    color: var(--link-hover);
}

/* ===== Progress Bars ===== */
.progress-bar {
    background: var(--primary-gradient) !important;
}

/* ===== Pagination ===== */
.pagination .page-link.active,
.pagination .page-item.active .page-link {
    background: var(--primary-gradient) !important;
    border-color: var(--primary-color) !important;
}

/* ===== Tables ===== */
.table thead,
table thead,
.unified-table thead {
    background: var(--table-header-bg) !important;
    color: white !important;
}

.table thead th,
table thead th,
.unified-table thead th {
    background: transparent !important;
    color: white !important;
}

.table tbody tr:hover,
table tbody tr:hover,
.unified-table tbody tr:hover {
    background: var(--table-hover-bg) !important;
}

.table-striped tbody tr:nth-of-type(odd),
table.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--table-stripe-bg) !important;
}

/* ===== Forms ===== */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
}

/* ===== Dropdown ===== */
.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--primary-color) !important;
}

/* ===== Alerts ===== */
.alert-primary {
    background-color: var(--primary-light) !important;
    border-color: var(--primary-color) !important;
}

/* ===== Stats Cards (Dashboard) ===== */
.stats-primary {
    background: var(--gradient-primary) !important;
}

/* ===== Smooth Transitions ===== */
:root {
    transition: all 0.3s ease;
}

.sidebar,
.nav-scrollable,
.btn-primary,
.card-header,
.badge,
a,
main .top-row,
.top-row.navbar,
.page-header,
.wizard-header,
.table thead,
table thead {
    transition: all 0.3s ease;
}