:root {
  --primary:        #2563EB;   /* أزرق رئيسي */
  --primary-hover:  #1D4ED8;
  --accent:         #10B981;   /* أخضر */
  --bg-base:        #FFFFFF;
  --bg-surface:     #F8FAFC;   /* خلفية الكاردات */
  --bg-hover:       #F1F5F9;
  --border:         #E2E8F0;
  --text-primary:   #0F172A;
  --text-secondary: #64748B;
  --text-muted:     #94A3B8;
  
  /* Status colors */
  --status-pending: #F59E0B;
  --status-approved:#10B981;
  --status-rejected:#EF4444;
  --status-progress:#3B82F6;
}

[data-theme='dark'] {
  --bg-base:        #0F172A;
  --bg-surface:     #1E293B;
  --bg-hover:       #334155;
  --border:         #334155;
  --text-primary:   #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted:     #64748B;
}

/* Base Body Styles */
body {
    background-color: var(--bg-base);
    color: var(--text-primary);
}

/* Custom Scrollbar for a premium feel */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* RTL Layout & Mobile Fixes */
.rtl-font {
    font-family: 'Cairo', sans-serif !important;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .section-padding {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .mobile-snap-x {
        scroll-snap-type: x mandatory;
        overflow-x: auto;
    }
    
    .mobile-snap-center {
        scroll-snap-align: center;
    }
    
    /* Improve button touch areas */
    button, a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Smooth Transitions */
.transition-all {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animation Utilities */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Touch targets and mobile padding refinements */
@media (max-width: 640px) {
    .p-10 { padding: 1.5rem !important; }
    .p-16 { padding: 2rem !important; }
    .text-5xl { font-size: 2.25rem !important; line-height: 2.5rem !important; }
    .max-h-\[240px\] { max-height: 180px !important; }
    
    /* Ensure chat bubbles look good on mobile */
    .msg-bubble { 
        max-width: 90% !important; 
        padding-right: 1rem !important;
        padding-left: 1rem !important;
    }
}
/* Premium Card & Layout Refinements */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
}

[data-theme='dark'] .glass-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.nav-arrow:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateX(-3px);
}

/* Notification Toast System */
.notification-toast {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 500;
    max-width: 400px;
    background: var(--bg-surface);
    border-right: 4px solid var(--primary);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    border-radius: 1.5rem;
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    animation: slideInLeft 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    backdrop-filter: blur(10px);
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.sidebar-active {
    background-color: var(--primary) !important;
    color: #FFFFFF !important;
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
}

/* Mobile Polish V3 */
@media (max-width: 768px) {
    .p-6 { padding: 1.25rem !important; }
    .p-10 { padding: 1.5rem !important; }
    .text-3xl { font-size: 1.75rem !important; }
    .sidebar-active { transform: none !important; }
    
    /* Ensure the sidebar doesn't overlap content on small height screens */
    #main-sidebar { height: 100vh; overflow-y: auto; }
}

/* Custom Checkbox/Radio Polish */
.custom-check {
    accent-color: var(--primary);
}

/* AI Chat Message Bubbles */
.ai-bubble {
    border-radius: 1.5rem;
    padding: 1rem 1.25rem;
    max-width: 85%;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.ai-bubble-bot {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-top-right-radius: 0.25rem;
}

.ai-bubble-user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-top-left-radius: 0.25rem;
}
