/* ========================================
   Admin Panel Styles - مسجد الرحمة  
   Optimized & Separated CSS File
   ======================================== */

/* ========== Premium Design System Constants ========== */
:root {
    /* Theme: Ocean (Default) - Tailwind Cyan */
    --primary-50: 236 254 255;
    --primary-100: 207 250 254;
    --primary-200: 165 243 252;
    --primary-300: 103 232 249;
    --primary-400: 34 211 238;
    --primary-500: 6 182 212;
    --primary-600: 8 145 178;
    --primary-700: 14 116 144;
    --primary-800: 21 94 117;
    --primary-900: 22 78 99;

    /* Backgrounds */
    --bg-light: 243 244 246;
    /* gray-100 */
    --bg-dark: 15 23 42;
    /* slate-900 */
    --card-light: 255 255 255;
    /* white */
    --card-dark: 30 41 59;
    /* slate-800 */
}

[data-theme="emerald"] {
    /* Theme: Emerald - Tailwind Emerald */
    --primary-50: 236 253 245;
    --primary-100: 209 250 229;
    --primary-200: 167 243 208;
    --primary-300: 110 231 183;
    --primary-400: 52 211 153;
    --primary-500: 16 185 129;
    --primary-600: 5 150 105;
    --primary-700: 4 120 87;
    --primary-800: 6 95 70;
    --primary-900: 6 78 59;
}

[data-theme="royal"] {
    /* Theme: Royal - Tailwind Indigo */
    --primary-50: 238 242 255;
    --primary-100: 224 231 255;
    --primary-200: 199 210 254;
    --primary-300: 165 180 252;
    --primary-400: 129 140 248;
    --primary-500: 99 102 241;
    --primary-600: 79 70 229;
    --primary-700: 67 56 202;
    --primary-800: 55 48 163;
    --primary-900: 49 46 129;
}

/* ========== خلفيات مريحة للعين ========== */
body.bg-default {
    background-color: #f3f4f6;
}

body.bg-ocean {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 50%, #e0f2fe 100%);
}

body.bg-mint {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 50%, #ecfdf5 100%);
}

body.bg-lavender {
    background: linear-gradient(135deg, #f5f3ff 0%, #faf5ff 50%, #f5f3ff 100%);
}

body.bg-warm {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 50%, #fef3c7 100%);
}

body.bg-rose {
    background: linear-gradient(135deg, #ffe4e6 0%, #fff1f2 50%, #ffe4e6 100%);
}

body.bg-slate {
    background: linear-gradient(135deg, #f1f5f9 0%, #f8fafc 50%, #f1f5f9 100%);
}

body.bg-custom {
    background: var(--custom-bg, #f3f4f6);
}

body.bg-image {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* ========== Custom Scrollbar ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

/* ========== Glass Card Effect ========== */
.glass-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* ========== Navigation ========== */
.nav-item-active {
    background-color: #cffafe;
    color: #0e7490;
    font-weight: 700;
    border-right: 4px solid #0891b2;
}

.nav-item-inactive {
    color: #4b5563;
    font-weight: 500;
}

.nav-item-inactive:hover {
    background-color: #f9fafb;
    color: #111827;
}

/* ========== Buttons ========== */
.btn-primary {
    background-color: rgb(var(--primary-600));
    color: white;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: rgb(var(--primary-700));
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* ========== Animations ========== */
.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hover-underline {
    position: relative;
    display: inline-block;
    cursor: default;
}

.hover-underline::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 3px;
    bottom: -4px;
    left: 0;
    background-color: rgb(var(--primary-600));
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
    border-radius: 2px;
}

.hover-underline:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* ========== Loading Overlay ========== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* ========== Print Styles ========== */
@media print {
    body * {
        visibility: hidden;
    }

    #print-area,
    #print-area * {
        visibility: visible;
    }

    #print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .page-break {
        page-break-after: always;
    }
}

/* ========== Form Inputs ========== */
.test-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* ========== Dark Mode Styles ========== */
body.dark-mode {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f1f5f9;
}

body.dark-mode .glass-card {
    background: rgba(30, 41, 59, 0.8);
    border-color: #334155;
    backdrop-filter: blur(12px);
}

body.dark-mode .nav-item-active {
    background-color: rgba(var(--primary-700), 0.5);
    color: rgb(var(--primary-100));
}

body.dark-mode .nav-item-inactive {
    color: #cbd5e1;
}

body.dark-mode .nav-item-inactive:hover {
    background-color: #334155;
    color: #f1f5f9;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: #475569;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ========== Performance Optimizations ========== */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Will-change for better animation performance */
.btn-primary,
.nav-item-inactive,
.hover-underline::after {
    will-change: transform;
}

/* Reduce repaints during animations */
.fade-in {
    will-change: opacity, transform;
}