/* ============================================
   Admin Theme System - Centralized Variables
   ============================================ */

/* Dark Theme (Default) */
:root[data-theme="dark"] {
    /* Primary Colors */
    --primary: #D97833;
    --primary-dark: #b56228;
    --primary-light: #FF8C42;
    --primary-hover: rgba(217, 120, 51, 0.1);

    /* Secondary Colors */
    --secondary: #2C3E50;
    --secondary-light: #34495e;

    /* Background Colors */
    --body-bg: #0a0a0a;
    --dark-bg: #0a0a0a;
    --card-bg: rgba(20, 20, 20, 0.95);
    --sidebar-bg: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
    --modal-bg: rgba(20, 20, 20, 0.98);
    --input-bg: rgba(255, 255, 255, 0.05);
    --hover-bg: rgba(255, 255, 255, 0.05);

    /* Text Colors */
    --text-primary: #f8f9fa;
    --text-light: #f8f9fa;
    --text-muted: #adb5bd;
    --text-secondary: #6c757d;

    /* Border Colors */
    --border-color: rgba(255, 255, 255, 0.05);
    --border-light: rgba(255, 255, 255, 0.1);

    /* Status Colors */
    --success: #2ecc71;
    --error: #e74c3c;
    --warning: #f1c40f;
    --info: #3498db;
    --danger: #e74c3c;

    /* Shadow */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-xl: 4px 0 20px rgba(0, 0, 0, 0.5);

    /* Glassmorphism */
    --glass-bg: rgba(20, 20, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --backdrop-blur: blur(10px);
}

/* Light Theme (White) */
:root[data-theme="light"] {
    /* Primary Colors - Keep same for consistency */
    --primary: #D97833;
    --primary-dark: #b56228;
    --primary-light: #FF8C42;
    --primary-hover: rgba(217, 120, 51, 0.08);

    /* Secondary Colors */
    --secondary: #2C3E50;
    --secondary-light: #34495e;

    /* Background Colors - Light palette */
    --body-bg: #f5f7fa;
    --dark-bg: #f5f7fa;
    --card-bg: #ffffff;
    --sidebar-bg: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    --modal-bg: #ffffff;
    --input-bg: #f8f9fa;
    --hover-bg: #f0f2f5;

    /* Text Colors - Dark text for light background */
    --text-primary: #1a1a1a;
    --text-light: #2d3748;
    --text-muted: #718096;
    --text-secondary: #a0aec0;

    /* Border Colors */
    --border-color: #e2e8f0;
    --border-light: #cbd5e0;

    /* Status Colors - Slightly adjusted for light theme */
    --success: #27ae60;
    --error: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --danger: #e74c3c;

    /* Shadow - Softer shadows for light theme */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
    --shadow-xl: 2px 0 15px rgba(0, 0, 0, 0.08);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.08);
    --backdrop-blur: blur(10px);
}

/* Layout Variables - Theme Independent */
:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
    --transition-speed: 0.3s;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
}

/* Enhanced Professional Theme Switcher */
.admin-theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    gap: 8px;
    animation: slideInFromRight 0.5s ease;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Glassmorphism Container */
.admin-theme-switcher {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 2px solid var(--glass-border);
    border-radius: 50px;
    padding: 6px;
    box-shadow: var(--shadow-xl),
                0 0 30px rgba(217, 120, 51, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-theme-switcher:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25),
                0 0 40px rgba(217, 120, 51, 0.25);
    border-color: rgba(217, 120, 51, 0.5);
}

/* Theme Switcher Buttons */
.theme-switcher-btn {
    padding: 12px 18px;
    border: none;
    border-radius: 25px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ripple Effect */
.theme-switcher-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(217, 120, 51, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.theme-switcher-btn:hover::before {
    width: 150%;
    height: 150%;
}

.theme-switcher-btn:hover {
    color: var(--primary-light);
    transform: scale(1.1) rotate(10deg);
}

/* Active State with Gradient */
.theme-switcher-btn.active {
    background: linear-gradient(135deg, #D97833, #FF8C42);
    color: white !important;
    box-shadow: 0 6px 20px rgba(217, 120, 51, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: scale(1);
}

.theme-switcher-btn.active::before {
    display: none;
}

.theme-switcher-btn.active:hover {
    transform: scale(1.08) rotate(-5deg);
    box-shadow: 0 8px 25px rgba(217, 120, 51, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Tooltip on Hover */
.theme-switcher-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: var(--modal-bg);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    z-index: 10001;
}

.theme-switcher-btn:hover[data-tooltip]::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    bottom: -45px;
}

/* Icon Animation */
.theme-switcher-btn i {
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.theme-switcher-btn:hover i {
    filter: drop-shadow(0 0 8px rgba(217, 120, 51, 0.6));
}

.theme-switcher-btn.active i {
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.8));
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* Responsive - Mobile positioning */
@media (max-width: 768px) {
    .admin-theme-switcher {
        top: 15px;
        right: 70px;
        padding: 4px;
        gap: 4px;
    }

    .theme-switcher-btn {
        padding: 10px 14px;
        font-size: 1rem;
        min-width: 42px;
    }

    .theme-switcher-btn[data-tooltip]::after {
        display: none;
    }
}

/* Smooth theme transition */
body,
.sidebar,
.main-content,
.nav-item,
.card,
.modal,
input,
select,
textarea,
button {
    transition: background-color 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease !important;
}
