/* ============================================
   SMM PANEL MODERN THEME - LIGHT & DARK MODE
   ============================================ */

/* ===========================================
   TABLE OF CONTENTS
   ===========================================
   1. CSS VARIABLES & THEME SETUP (Lines 10-150)
   2. BASE/RESET STYLES (Lines 152-190)
   3. TYPOGRAPHY (Lines 192-210)
   4. LAYOUT - NAVBAR (Lines 212-540)
   5. LAYOUT - CARDS & PANELS (Lines 542-640)
   6. COMPONENTS - BUTTONS (Lines 642-1040)
   7. COMPONENTS - FORMS (Lines 1042-1180)
   8. COMPONENTS - TABLES (Lines 1182-1210)
   9. COMPONENTS - ALERTS (Lines 1212-1240)
   10. COMPONENTS - DROPDOWNS (Lines 1242-1310)
   11. COMPONENTS - BADGES & LABELS (Lines 1312-1450)
   12. COMPONENTS - MODALS (Lines 1452-1490)
   13. COMPONENTS - SERVICE CARDS (Lines 1492-1590)
   14. COMPONENTS - STATS CARDS (Lines 1592-1650)
   15. COMPONENTS - NAV TABS & PILLS (Lines 1652-1710)
   16. THIRD-PARTY - SELECT2 OVERRIDES (Lines 1712-1780)
   17. UTILITIES & HELPERS (Lines 1782-1890)
   18. ANIMATIONS & TRANSITIONS (Lines 1892-1950)
   19. DARK THEME OVERRIDES (Lines 1952-2050)
   20. RESPONSIVE/MEDIA QUERIES (Lines 2052-2080)
   21. RTL SUPPORT (Lines 2082-2110)
   =========================================== */

/* ============================================
   1. CSS VARIABLES & THEME SETUP
   ============================================ */

:root {
    /* Brand Colors - New Palette */
    --primary: #1E9E74;
    --primary-dark: #188660;
    --primary-light: #29B885;
    --primary-rgb: 30, 158, 116;
    
    --secondary: #29B885;
    --secondary-dark: #22A571;
    --secondary-light: #3ED2A0;
    --secondary-rgb: 41, 184, 133;
    
    --accent: #1E9E74;
    --accent-dark: #188660;
    --accent-light: #29B885;
    --accent-rgb: 30, 158, 116;
    
    --turquoise: #29B885;
    --turquoise-dark: #1E9E74;
    --turquoise-light: #3ED2A0;
    --turquoise-rgb: 41, 184, 133;
    
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    
    /* Light Theme Colors - Glassmorphism */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafcee;
    --bg-tertiary: #f1f5f9dd;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-hover: rgba(248, 250, 252, 0.9);
    --bg-active: rgba(226, 232, 240, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-dark: rgba(248, 250, 252, 0.8);
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;
    
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;
    
    --shadow-sm: 0 2px 8px 0 rgba(30, 158, 116, 0.08);
    --shadow-md: 0 4px 12px -1px rgba(30, 158, 116, 0.12), 0 2px 6px -2px rgba(41, 184, 133, 0.08);
    --shadow-lg: 0 10px 25px -3px rgba(30, 158, 116, 0.15), 0 4px 10px -4px rgba(41, 184, 133, 0.1);
    --shadow-xl: 0 20px 35px -5px rgba(30, 158, 116, 0.2), 0 8px 15px -6px rgba(41, 184, 133, 0.15);
    --shadow-glass: 0 8px 32px 0 rgba(30, 158, 116, 0.25);
    
    --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.3) 100%);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-blur: blur(10px);
    
    /* Gradients - Modern 2025 */
    --gradient-primary: linear-gradient(145deg, #1E9E74 0%, #29B885 50%, #1E9E74 100%);
    --gradient-secondary: linear-gradient(135deg, #29B885 0%, #3ED2A0 100%);
    --gradient-hero: linear-gradient(135deg, #1E9E74 0%, #29B885 35%, #3ED2A0 70%, #29B885 100%);
    --gradient-mesh: radial-gradient(at 40% 20%, #29B885 0px, transparent 50%),
                     radial-gradient(at 80% 0%, #3ED2A0 0px, transparent 50%),
                     radial-gradient(at 10% 50%, #1E9E74 0px, transparent 50%),
                     radial-gradient(at 80% 80%, #29B885 0px, transparent 50%),
                     radial-gradient(at 0% 100%, #3ED2A0 0px, transparent 50%);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    /* Dark backgrounds with glassmorphism */
    --bg-primary: #0a0e1a;
    --bg-secondary: #141925ee;
    --bg-tertiary: #1e2530dd;
    --bg-card: rgba(20, 25, 37, 0.85);
    --bg-hover: rgba(30, 37, 48, 0.9);
    --bg-active: rgba(40, 47, 60, 0.9);
    --bg-glass: rgba(20, 25, 37, 0.6);
    --bg-glass-dark: rgba(10, 14, 26, 0.8);
    
    --text-primary: #e8edf5;
    --text-secondary: #b8c5d6;
    --text-tertiary: #8896a8;
    --text-inverse: #0a0e1a;
    
    --border-color: rgba(138, 150, 168, 0.2);
    --border-light: rgba(184, 197, 214, 0.2);
    --border-dark: rgba(20, 25, 37, 0.3);
    
    /* Dark theme shadows with color tint */
    --shadow-sm: 0 2px 8px 0 rgba(30, 158, 116, 0.1);
    --shadow-md: 0 4px 12px -1px rgba(30, 158, 116, 0.15);
    --shadow-lg: 0 10px 25px -3px rgba(30, 158, 116, 0.2);
    --shadow-xl: 0 20px 35px -5px rgba(41, 184, 133, 0.25);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    
    --glass-bg: linear-gradient(135deg, rgba(20, 25, 37, 0.6) 0%, rgba(30, 37, 48, 0.3) 100%);
    --glass-border: rgba(138, 150, 168, 0.18);
    --glass-blur: blur(12px);
}

/* ============================================
   2. BASE/RESET STYLES
   ============================================ */

* {
    box-sizing: border-box;
}

body {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    position: relative;
    transition: background-color 0.2s ease, color 0.2s ease;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Remove default focus outlines */
*:focus {
    outline: none !important;
}

/* Add subtle animation to panels on load */
.panel, .well {
    animation: slideInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.panel:nth-child(2) { animation-delay: 0.1s; }
.panel:nth-child(3) { animation-delay: 0.2s; }
.panel:nth-child(4) { animation-delay: 0.3s; }

/* ============================================
   3. TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 0;
}

p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* ============================================
   4. LAYOUT - NAVBAR
   ============================================ */

/* Main Navbar Styles */
.navbar {
    background: linear-gradient(145deg, #1E9E74 0%, #29B885 50%, #1E9E74 100%);
    border-bottom: none;
    box-shadow: none;
    position: relative;
    overflow: visible;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-height: 60px;
    align-items: center;
}

/* Transition wave at navbar bottom */
.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.6) 25%, 
        rgba(62, 210, 160, 0.8) 50%, 
        rgba(255, 255, 255, 0.6) 75%, 
        transparent 100%);
    animation: wave-slide 3s linear infinite;
}

/* Shine effect */
.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%);
    animation: shine 8s infinite;
}

/* Dark mode navbar */
[data-theme="dark"] .navbar {
    background: linear-gradient(145deg, #14704f 0%, #1a8b5a 50%, #14704f 100%);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Navbar Header */
.navbar-header {
    min-height: 60px;
    display: flex;
    align-items: center;
}

/* Navbar Brand */
.navbar-brand {
    font-size: 1.1rem;
    font-weight: 600;
    color: white !important;
    height: 60px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.3);
}

.navbar-brand img {
    height: 35px;
    filter: brightness(0) invert(1);
}

/* Navbar Navigation */
.navbar-nav {
    display: flex;
    align-items: center;
    height: 60px;
    margin: 0;
}

.navbar-default .navbar-nav > li {
    display: flex;
    align-items: center;
    height: 100%;
    position: relative;
    transition: all 0.3s ease;
}

.navbar-default .navbar-nav > li > a {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    position: relative;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Hover effect on li */
.navbar-default .navbar-nav > li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.navbar-default .navbar-nav > li:hover::before {
    opacity: 1;
}

.navbar-default .navbar-nav > li:hover > a {
    color: white;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Active menu item */
.navbar-default .navbar-nav > li.active {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
}

.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
    background-color: transparent !important;
    color: white !important;
    position: relative;
}

/* Active indicator */
.navbar-default .navbar-nav > li.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 3px;
    background: linear-gradient(90deg, #1E9E74 0%, #29B885 50%, #3ED2A0 100%);
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -2px 10px rgba(41, 184, 133, 0.4);
    transition: all 0.3s ease;
    animation: glow-pulse 2s ease-in-out infinite;
    z-index: 1;
}

.navbar-default .navbar-nav > li.active:hover::after {
    left: 5%;
    right: 5%;
}

/* Navbar toggle button */
.navbar-default .navbar-toggle {
    border-color: rgba(255, 255, 255, 0.3);
    margin-top: 13px;
    margin-bottom: 13px;
}

.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-default .navbar-toggle .icon-bar {
    background-color: white;
}

/* Dropdown improvements */
.navbar-nav .dropdown-menu {
    margin-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Balance Badge in navbar */
.navbar .badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 14px;
    vertical-align: middle;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.25);
    position: relative;
    animation: subtle-pulse 3s ease-in-out infinite;
    font-size: 13px;
    letter-spacing: 0.3px;
}

/* Theme Toggle Button */
.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    vertical-align: middle;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 8px rgba(30, 158, 116, 0.2);
}

.theme-toggle .toggle-icon {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.theme-toggle .toggle-icon.active {
    background: rgba(255, 255, 255, 0.9);
    color: #1E9E74;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.theme-toggle .toggle-icon:not(.active) {
    opacity: 0.4;
}

/* Theme toggle wrapper in navbar */
.navbar .theme-toggle-wrapper {
    padding: 0;
    display: flex;
    align-items: center;
    height: 100%;
}

.navbar .theme-toggle-wrapper .theme-toggle {
    margin: 0 12px;
}

/* Dark mode theme toggle */
[data-theme="dark"] .theme-toggle {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

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

[data-theme="dark"] .theme-toggle .toggle-icon {
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .theme-toggle .toggle-icon.active {
    background: var(--primary);
    color: white;
}

/* ============================================
   5. LAYOUT - CARDS & PANELS
   ============================================ */

.panel {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-glass);
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-mesh);
    opacity: 0.03;
    pointer-events: none;
}

.panel:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.panel-default {
    border-color: var(--border-color);
}

.panel-default > .panel-heading {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.panel-heading {
    background: linear-gradient(135deg, rgba(30, 158, 116, 0.1) 0%, rgba(41, 184, 133, 0.1) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    border-radius: 16px 16px 0 0;
    font-weight: 500;
    backdrop-filter: blur(5px);
}

.panel-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}

.panel-body {
    padding: 15px;
}

.well {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
}

.well:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ============================================
   6. COMPONENTS - BUTTONS
   ============================================ */

/* Base button styles */
.btn {
    border-radius: 12px;
    font-weight: 500;
    padding: 10px 20px;
    transition: all 0.2s ease;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    transform: translateY(0);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(30, 158, 116, 0.2);
    overflow: hidden;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
}

/* Subtle wave effect on hover */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::after {
    width: 300%;
    height: 300%;
}

.btn:hover {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--turquoise-light) 100%);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    box-shadow: 0 6px 25px rgba(41, 184, 133, 0.25);
    transform: translateY(-2px) scale(1.02);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 158, 116, 0.2);
}

.btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(30, 158, 116, 0.15);
}

/* Button variants */
.btn-primary,
.btn-primary:link,
.btn-primary:visited {
    background: linear-gradient(135deg, #1E9E74 0%, #29B885 100%);
    border-color: #1E9E74;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #29B885 0%, #3ED2A0 100%);
    border-color: #29B885;
    box-shadow: 0 6px 20px rgba(30, 158, 116, 0.25);
}

.btn-primary:focus {
    box-shadow: 0 0 0 3px rgba(30, 158, 116, 0.2);
}

.btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(30, 158, 116, 0.15);
}

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

.btn-default:hover {
    background: var(--bg-secondary);
    border-color: var(--border-dark);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.btn-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border-color: #10B981;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #059669;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    border-color: #EF4444;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    border-color: #DC2626;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.25);
}

.btn-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    border-color: #F59E0B;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
    border-color: #D97706;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.25);
}

.btn-info {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    border-color: #3B82F6;
}

.btn-info:hover {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    border-color: #2563EB;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25);
}

/* Button sizes */
.btn-lg {
    padding: 12px 24px;
    font-size: 1.125rem;
    border-radius: 14px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
    border-radius: 8px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 6px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Remove text decoration on button links */
a.btn:hover,
a.btn:focus {
    text-decoration: none !important;
}

/* ============================================
   7. COMPONENTS - FORMS
   ============================================ */

.form-control,
textarea.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
select.form-control {
    background: var(--bg-glass);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 10px 14px;
    height: auto;
    transition: all 0.3s ease;
    font-size: 14px;
}

.form-control:focus:not([readonly]),
textarea.form-control:focus:not([readonly]),
input:focus:not([readonly]),
select.form-control:focus:not([readonly]) {
    background: var(--bg-primary);
    border: 1px solid transparent;
    color: var(--text-primary);
    outline: none;
    position: relative;
    background-image: linear-gradient(var(--bg-primary), var(--bg-primary)),
                      linear-gradient(135deg, #1E9E74 0%, #29B885 50%, #3ED2A0 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 0 25px rgba(41, 184, 133, 0.15);
    transform: translateY(-1px);
}

/* Readonly inputs - no focus effects */
.form-control[readonly],
textarea.form-control[readonly],
input[readonly],
select.form-control[readonly] {
    cursor: default;
    background-color: var(--bg-tertiary);
    opacity: 0.8;
}

.form-control[readonly]:focus,
textarea.form-control[readonly]:focus,
input[readonly]:focus,
select.form-control[readonly]:focus {
    border-color: var(--border-color);
    box-shadow: none;
    transform: none;
}

.form-control::placeholder,
textarea::placeholder,
input::placeholder {
    color: var(--text-tertiary);
}

/* Textarea specific */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Checkboxes and Radio Buttons */
input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Dark theme checkbox and radio styling */
[data-theme="dark"] input[type="checkbox"],
[data-theme="dark"] input[type="radio"] {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

/* Webkit browsers checkbox styling for dark theme */
[data-theme="dark"] input[type="checkbox"]:not(:checked) {
    -webkit-appearance: none;
    appearance: none;
    background-color: #252830;
    border: 2px solid #4a5568;
    border-radius: 4px;
    width: 18px;
    height: 18px;
    position: relative;
    cursor: pointer;
}

[data-theme="dark"] input[type="checkbox"]:checked {
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 4px;
    width: 18px;
    height: 18px;
    position: relative;
}

[data-theme="dark"] input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Radio button dark theme styling */
[data-theme="dark"] input[type="radio"]:not(:checked) {
    -webkit-appearance: none;
    appearance: none;
    background-color: #252830;
    border: 2px solid #4a5568;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    position: relative;
    cursor: pointer;
}

[data-theme="dark"] input[type="radio"]:checked {
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    position: relative;
}

[data-theme="dark"] input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: white;
}

/* Labels */
label {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 6px;
    display: inline-block;
}

/* Custom Select */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* Input groups */
.input-group {
    position: relative;
    display: flex;
    width: 100%;
}

.input-group-addon {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px 0 0 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
}

.input-group .form-control {
    border-radius: 0 8px 8px 0;
}

/* ============================================
   8. COMPONENTS - TABLES
   ============================================ */

.table {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
}

.table > thead > tr > th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    padding: 1rem;
    text-align: left;
}

.table > tbody > tr > td {
    color: var(--text-secondary);
    padding: 1rem;
    border-top: 1px solid var(--border-light);
}

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

.table-striped > tbody > tr:nth-of-type(odd) {
    background: var(--bg-secondary);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   9. COMPONENTS - ALERTS
   ============================================ */

.alert {
    border-radius: 12px;
    border: none;
    padding: 14px 20px;
    margin-bottom: 20px;
    position: relative;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    color: #059669;
    border-left: 4px solid #10B981;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    color: #DC2626;
    border-left: 4px solid #EF4444;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    color: #D97706;
    border-left: 4px solid #F59E0B;
}

.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    color: #2563EB;
    border-left: 4px solid #3B82F6;
}

.alert .close {
    color: inherit;
    opacity: 0.5;
}

.alert .close:hover {
    opacity: 0.8;
}

/* ============================================
   10. COMPONENTS - DROPDOWNS
   ============================================ */

.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    margin-top: 0.5rem;
    min-width: 200px;
}

.dropdown-menu > li {
    position: relative;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 2px 0;
}

.dropdown-menu > li > a {
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    background: transparent;
    transition: all 0.2s ease;
    display: block;
    text-decoration: none;
}

.dropdown-menu > li:hover {
    background: var(--bg-hover);
}

.dropdown-menu > li:hover > a {
    background: transparent !important;
    color: var(--primary);
}

.dropdown-menu > li.active {
    background: linear-gradient(145deg, #1E9E74 0%, #29B885 50%, #1E9E74 100%) !important;
}

.dropdown-menu > li.active > a,
.dropdown-menu > li.active > a:hover,
.dropdown-menu > li.active > a:focus {
    background: transparent !important;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.dropdown-divider {
    height: 1px;
    margin: 0.5rem 0;
    overflow: hidden;
    background-color: var(--border-color);
}

/* ============================================
   11. COMPONENTS - BADGES & LABELS
   ============================================ */

.badge, .label {
    border-radius: 6px;
}

.badge-primary, .label-primary {
    background: var(--gradient-primary);
    color: white;
}

.badge-success, .label-success {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
}

.badge-warning, .label-warning {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
}

.badge-danger, .label-danger {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
}

/* Metric Badges for Service Metrics */
.metric-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    color: white;
    vertical-align: middle;
}

.metric-badge i {
    margin-right: 2px;
    font-size: 9px;
}

/* Speed color codes */
.metric-badge.speed-excellent {
    background: linear-gradient(145deg, #10B981, #059669);
}

.metric-badge.speed-good {
    background: linear-gradient(145deg, #22C55E, #16A34A);
}

.metric-badge.speed-average {
    background: linear-gradient(145deg, #F59E0B, #D97706);
}

.metric-badge.speed-slow {
    background: linear-gradient(145deg, #EF4444, #DC2626);
}

/* Start time color codes */
.metric-badge.time-excellent {
    background: linear-gradient(145deg, #10B981, #059669);
}

.metric-badge.time-good {
    background: linear-gradient(145deg, #22C55E, #16A34A);
}

.metric-badge.time-average {
    background: linear-gradient(145deg, #F59E0B, #D97706);
}

.metric-badge.time-slow {
    background: linear-gradient(145deg, #EF4444, #DC2626);
}

/* Reliability color codes */
.metric-badge.reliability-excellent {
    background: linear-gradient(145deg, #10B981, #059669);
}

.metric-badge.reliability-good {
    background: linear-gradient(145deg, #22C55E, #16A34A);
}

.metric-badge.reliability-average {
    background: linear-gradient(145deg, #F59E0B, #D97706);
}

.metric-badge.reliability-slow {
    background: linear-gradient(145deg, #EF4444, #DC2626);
}

/* Popularity color codes */
.metric-badge.popularity-hot {
    background: linear-gradient(145deg, #22C55E, #16A34A);
}

.metric-badge.popularity-standard {
    background: linear-gradient(145deg, #F59E0B, #D97706);
}

.metric-badge.popularity-low {
    background: linear-gradient(145deg, #6B7280, #4B5563);
}

.metric-badge.popularity-new {
    background: linear-gradient(145deg, #3B82F6, #2563EB);
}

/* Fallback for undefined color codes */
.metric-badge:not([class*="-excellent"]):not([class*="-good"]):not([class*="-average"]):not([class*="-slow"]):not([class*="popularity-"]) {
    background: linear-gradient(145deg, #6B7280, #4B5563);
}

/* ============================================
   12. COMPONENTS - MODALS
   ============================================ */

.modal-content {
    background: var(--bg-card);
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    border-radius: 16px 16px 0 0;
    padding: 1.25rem 1.5rem;
}

.modal-title {
    color: var(--text-primary);
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
    color: var(--text-secondary);
}

.modal-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 16px 16px;
    padding: 1rem 1.5rem;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

/* ============================================
   13. COMPONENTS - SERVICE CARDS
   ============================================ */

.service-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

/* Animated icon on hover */
.service-card .fa,
.service-card .fas,
.service-card .far {
    transition: all 0.3s ease;
}

.service-card:hover .fa,
.service-card:hover .fas,
.service-card:hover .far {
    transform: rotate(10deg) scale(1.1);
    color: var(--primary);
}

/* Gradient glow effect */
.service-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(41, 184, 133, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease;
    pointer-events: none;
}

.service-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(41, 184, 133, 0.3);
}

.service-card:hover::before {
    transform: translate(-50%, -50%) scale(1.5);
}

.service-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.service-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.service-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.service-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* ============================================
   14. COMPONENTS - STATS CARDS
   ============================================ */

.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    position: relative;
}

.stat-icon {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(30, 158, 116, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-change {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* ============================================
   15. COMPONENTS - NAV TABS & PILLS
   ============================================ */

.nav-tabs {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.nav-tabs > li > a {
    color: var(--text-secondary);
    border: none;
    border-radius: 8px 8px 0 0;
    padding: 10px 16px;
    margin-right: 4px;
    transition: all 0.2s ease;
}

.nav-tabs > li > a:hover {
    background: var(--bg-hover);
    border-color: transparent;
    color: var(--primary);
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
    color: var(--primary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-bottom-color: var(--bg-card);
}

.nav-pills > li > a {
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 8px 16px;
    margin: 2px;
    transition: all 0.2s ease;
}

.nav-pills > li > a:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
    background: var(--primary);
    color: white;
}

.tab-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
    padding: 20px;
    border-radius: 0 0 8px 8px;
}

/* ============================================
   16. THIRD-PARTY - SELECT2 OVERRIDES
   ============================================ */

/* Select2 container */
.select2-container--default .select2-selection--single {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: auto;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

/* Select2 focus state - show box-shadow when dropdown is open */
.select2-container--open .select2-selection--single {
    border-color: var(--primary) !important;
    box-shadow: 0 0 25px rgba(41, 184, 133, 0.15) !important;
}

/* Remove box-shadow when dropdown is closed */
.select2-container:not(.select2-container--open) .select2-selection--single {
    box-shadow: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary);
    padding: 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 10px;
}

/* Select2 dropdown */
.select2-dropdown {
    background-color: #ffffff !important; /* Fully opaque white */
    background: #ffffff !important;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    opacity: 1 !important;
}

.select2-results {
    background-color: #ffffff !important; /* Fully opaque */
    background: #ffffff !important;
}

.select2-search--dropdown {
    background-color: #ffffff !important; /* Fully opaque */
}

.select2-search--dropdown .select2-search__field {
    background-color: #ffffff !important; /* Fully opaque white */
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px;
}

.select2-results__option {
    padding: 8px 12px;
    color: var(--text-primary);
    transition: background-color 0.2s ease;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.select2-results__option--highlighted {
    background-color: var(--bg-hover);
    color: var(--primary);
}

.select2-results__option[aria-selected="true"] {
    background-color: var(--bg-tertiary);
}

/* Hide disabled options in Select2 */
.select2-results__option[aria-disabled="true"],
.select2-results__option.select2-results__option--disabled,
.select2-container--default .select2-results__option[aria-disabled="true"],
.select2-results__option[aria-disabled="true"][aria-selected="false"],
.select2-results__option:not([aria-selected="true"])[aria-disabled="true"],
.select2-results__option[data-select2-hidden="true"],
.select2-results__option.select2-results__option--hidden {
    display: none !important;
}

/* Hide options in native select */
select option[hidden],
select option:disabled[hidden],
select option[disabled][hidden],
select option[data-hidden="true"],
option.hidden-category {
    display: none !important;
}

/* Service metrics badges container */
.service-metrics-badges {
    display: inline-flex !important;
    gap: 6px;
    align-items: center;
}

/* Hidden category class */
.hidden-category {
    display: none !important;
}

/* Fix search icon z-index */
.search-dropdown .input-wrapper .input-wrapper__prepend,
.search-dropdown .input-wrapper .input-wrapper__append {
    z-index: 1;
    position: relative;
}

/* ============================================
   17. UTILITIES & HELPERS
   ============================================ */

/* Text utilities */
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-tertiary) !important; }

/* Background utilities */
.bg-primary-gradient { background: var(--gradient-primary) !important; }
.bg-secondary-gradient { background: var(--gradient-secondary) !important; }

/* Border radius utilities */
.rounded { border-radius: 12px !important; }
.rounded-lg { border-radius: 16px !important; }
.rounded-full { border-radius: 50% !important; }

/* Shadow utilities */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }
.shadow-none { box-shadow: none !important; }

/* Spacing utilities */
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 2rem !important; }

.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 2rem !important; }

.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 2rem !important; }

/* Display utilities */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }

/* Flexbox utilities */
.align-items-center { align-items: center !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }

/* Position utilities */
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed { position: fixed !important; }

/* Overflow utilities */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }

/* Cursor utilities */
.cursor-pointer { cursor: pointer !important; }
.cursor-default { cursor: default !important; }

/* ============================================
   18. ANIMATIONS & TRANSITIONS
   ============================================ */

/* Smooth transitions for interactive elements */
a, button, .btn, .panel, .well, .service-card {
    transition: all 0.2s ease;
}

/* Slide in animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Wave slide animation */
@keyframes wave-slide {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Shine animation */
@keyframes shine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* Glow pulse animation */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 -2px 10px rgba(41, 184, 133, 0.4);
    }
    50% {
        box-shadow: 0 -2px 15px rgba(30, 158, 116, 0.5);
    }
}

/* Subtle pulse animation */
@keyframes subtle-pulse {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(34, 197, 94, 0.25);
    }
    50% {
        box-shadow: 0 2px 12px rgba(62, 210, 160, 0.4);
    }
}

/* Breathe animation */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Rotation animation */
@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loader */
.loader {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-bottom-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
}

/* Notification dot */
.notification-dot {
    width: 8px;
    height: 8px;
    background: #EF4444;
    border-radius: 50%;
    position: absolute;
    top: -2px;
    right: -2px;
    animation: breathe 2s ease-in-out infinite;
}

/* Floating Action Button */
.btn-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-floating:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

/* ============================================
   19. DARK THEME OVERRIDES
   ============================================ */

/* Forms in dark mode */
[data-theme="dark"] .form-control,
[data-theme="dark"] textarea.form-control,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="datetime-local"],
[data-theme="dark"] select.form-control {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .form-control:focus:not([readonly]),
[data-theme="dark"] textarea.form-control:focus:not([readonly]),
[data-theme="dark"] input:focus:not([readonly]),
[data-theme="dark"] select.form-control:focus:not([readonly]) {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(37, 178, 125, 0.25);
}

/* Dark mode readonly inputs */
[data-theme="dark"] .form-control[readonly],
[data-theme="dark"] textarea.form-control[readonly],
[data-theme="dark"] input[readonly],
[data-theme="dark"] select.form-control[readonly] {
    background-color: var(--bg-tertiary);
    opacity: 0.7;
}

/* Fix service description text in dark mode */
[data-theme="dark"] .border-rounded,
[data-theme="dark"] .border-solid.border-rounded {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .form-control[readonly]:focus,
[data-theme="dark"] textarea.form-control[readonly]:focus,
[data-theme="dark"] input[readonly]:focus,
[data-theme="dark"] select.form-control[readonly]:focus {
    border-color: var(--border-color);
    box-shadow: none;
}

/* Select2 in dark mode */
[data-theme="dark"] .select2-container--default .select2-selection--single {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary);
}

[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--text-tertiary);
}

[data-theme="dark"] .select2-dropdown {
    background-color: #1a1d23 !important; /* Fully opaque dark background */
    background: #1a1d23 !important;
    border-color: var(--border-color);
    opacity: 1 !important;
}

[data-theme="dark"] .select2-search--dropdown {
    background-color: #1a1d23 !important; /* Fully opaque dark */
}

[data-theme="dark"] .select2-search--dropdown .select2-search__field {
    background-color: #252830 !important; /* Fully opaque dark field */
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .select2-results {
    background-color: #1a1d23 !important; /* Fully opaque dark */
    background: #1a1d23 !important;
    color: var(--text-primary);
}

[data-theme="dark"] .select2-results__option {
    color: var(--text-primary);
}

[data-theme="dark"] .select2-results__option[aria-selected="true"] {
    background-color: var(--bg-tertiary);
}

[data-theme="dark"] .select2-results__option--highlighted {
    background-color: var(--bg-tertiary);
}

/* Dropdowns in dark mode */
[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-primary);
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: var(--bg-tertiary);
}

/* Search in dark mode */
[data-theme="dark"] .searchbar,
[data-theme="dark"] .search-container,
[data-theme="dark"] .search-box {
    background-color: var(--bg-tertiary);
}

[data-theme="dark"] .searchbar input,
[data-theme="dark"] .search-container input,
[data-theme="dark"] .search-box input {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Scrollbar in dark mode */
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--border-color);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ============================================
   20. RESPONSIVE/MEDIA QUERIES
   ============================================ */

@media (max-width: 768px) {
    /* Mobile navbar */
    .navbar-nav {
        background: var(--bg-card);
        border-radius: 12px;
        margin-top: 1rem;
        padding: 0.5rem;
    }
    
    .navbar-default .navbar-nav > li {
        height: auto;
    }
    
    .navbar-default .navbar-nav > li > a {
        padding: 10px 15px;
        height: auto;
    }
    
    /* Mobile theme toggle */
    .theme-toggle {
        margin: 1rem auto;
        display: flex;
        width: fit-content;
    }
    
    .navbar-nav .theme-toggle-wrapper {
        padding: 8px 15px;
    }
    
    .navbar-nav .theme-toggle-wrapper .theme-toggle {
        margin: 0;
        width: auto;
        display: inline-flex;
    }
    
    /* Mobile buttons */
    .btn-floating {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
    }
    
    /* Mobile panels */
    .panel {
        margin-bottom: 15px;
    }
    
    /* Mobile forms */
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 576px) {
    /* Extra small devices */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .panel-body {
        padding: 12px;
    }
}

/* ============================================
   21. RTL SUPPORT
   ============================================ */

.rtl-navbar {
    direction: rtl;
}

.rtl-navbar .navbar-brand {
    padding-right: 0;
    padding-left: 20px;
}

.rtl-navbar .navbar-nav {
    float: right;
}

.rtl-form {
    direction: rtl;
    text-align: right;
}

.rtl-form .form-control {
    direction: rtl;
    text-align: right;
}

.rtl-alert {
    direction: rtl;
    text-align: right;
}

.rtl-content {
    direction: rtl;
    text-align: right;
}

/* RTL dark mode support */
[data-theme="dark"] .rtl-navbar,
[data-theme="dark"] .rtl-form,
[data-theme="dark"] .rtl-alert,
[data-theme="dark"] .rtl-content {
    direction: rtl;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-dark);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-dark) var(--bg-secondary);
}

/* ============================================
   END OF STYLESHEET
   ============================================ */