@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

/* Main Design System */
:root {
  /* Colors */
  --primary: #FF5722;
  /* Vibrant Orange for restaurant theme */
  --primary-dark: #E64A19;
  --secondary: #607D8B;
  --success: #4CAF50;
  --danger: #F44336;
  --warning: #FFC107;
  --info: #2196F3;

  --bg-light: #F5F5F5;
  --bg-card: #FFFFFF;
  --text-main: #333333;
  --text-muted: #757575;
  --border-color: #E0E0E0;

  /* Dark Mode Variables - filtered by class .dark-mode */
  --dark-bg: #121212;
  --dark-card: #1E1E1E;
  --dark-text: #E0E0E0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Cairo', 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-main);
  line-height: 1.6;
  direction: rtl;
  /* Global RTL */
  text-align: right;
  /* Default text align right */
}

body.dark-mode {
  background-color: var(--dark-bg);
  color: var(--dark-text);
}

body.dark-mode .card,
body.dark-mode header,
body.dark-mode nav {
  background-color: var(--dark-card);
  color: var(--dark-text);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  font-size: 1rem;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-success {
  background-color: var(--success);
  color: white;
}

.card {
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
}

/* Grid System */
.grid {
  display: grid;
  gap: 1rem;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

/* Form Elements */
input,
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 1rem;
  text-align: right;
  /* Inputs aligned right for Arabic */
}

input:focus,
select:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

/* RTL Helpers */
.mr-1 {
  margin-left: 0.25rem;
}

/* In RTL, margin-right logic flips, but utility classes might be confusing. Better use logical properties if browser support allows, but simple swap for now *// *   T o a s t   C o n t a i n e r   f o r   n i c e   s t a c k i n g   * /  
 . t o a s t - c o n t a i n e r   {  
         p o s i t i o n :   f i x e d ;  
         b o t t o m :   2 r e m ;  
         l e f t :   2 r e m ;  
         / *   M o v e   t o   l e f t   f o r   R T L   a p p r o p r i a t e n e s s   o r   k e e p   r i g h t ?   L e t ' s   u s e   l e f t   f o r   v i s i b i l i t y   i f   s i d e b a r   i s   r i g h t   * /  
         / *   L e t ' s   s t i c k   t o   u s e r ' s   p r e v i o u s   r i g h t ,   b u t   u s u a l l y   R T L   p r o m p t s   a r e   o n   t h e   r i g h t ?   * /  
         / *   W a i t ,   t h e   c u r r e n t   c o d e   w a s   r i g h t :   2 0 p x .   I n   R T L ,   r i g h t   i s   t h e   " s t a r t "   o f   t h e   p a g e .   * /  
         / *   L e t ' s   p u t   i t   o n   t h e   L E F T   t o   n o t   c o v e r   t h e   s i d e b a r   o r   m a i n   a c t i o n s   u s u a l l y   o n   t h e   r i g h t   i n   R T L   l a y o u t s .   * /  
         r i g h t :   a u t o ;  
         l e f t :   2 0 p x ;  
         z - i n d e x :   9 9 9 9 ;  
         d i s p l a y :   f l e x ;  
         f l e x - d i r e c t i o n :   c o l u m n ;  
         g a p :   1 0 p x ;  
         p o i n t e r - e v e n t s :   n o n e ;  
         / *   L e t   c l i c k s   p a s s   t h r o u g h   c o n t a i n e r   * /  
 }  
  
 / *   B a s e   T o a s t   S t y l e   * /  
 . t o a s t   {  
         p o i n t e r - e v e n t s :   a u t o ;  
         m i n - w i d t h :   3 0 0 p x ;  
         b a c k g r o u n d :   v a r ( - - b g - c a r d ) ;  
         c o l o r :   v a r ( - - t e x t - m a i n ) ;  
         p a d d i n g :   1 r e m   1 . 5 r e m ;  
         b o r d e r - r a d i u s :   1 2 p x ;  
         b o x - s h a d o w :   0   8 p x   2 4 p x   r g b a ( 0 ,   0 ,   0 ,   0 . 1 2 ) ;  
         d i s p l a y :   f l e x ;  
         a l i g n - i t e m s :   c e n t e r ;  
         g a p :   1 2 p x ;  
         f o n t - w e i g h t :   6 0 0 ;  
         b o r d e r - r i g h t :   5 p x   s o l i d   t r a n s p a r e n t ;  
         / *   A c c e n t   b o r d e r   o n   t h e   r i g h t   f o r   R T L   * /  
         t r a n s f o r m - o r i g i n :   b o t t o m   c e n t e r ;  
         d i r e c t i o n :   r t l ;  
  
         / *   G l a s s m o r p h i s m   s u p p o r t   ( o p t i o n a l )   * /  
         b a c k g r o u n d :   r g b a ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   0 . 9 5 ) ;  
         b a c k d r o p - f i l t e r :   b l u r ( 1 0 p x ) ;  
  
         o p a c i t y :   0 ;  
         t r a n s f o r m :   t r a n s l a t e Y ( 2 0 p x )   s c a l e ( 0 . 9 5 ) ;  
         a n i m a t i o n :   t o a s t E n t e r   0 . 4 s   c u b i c - b e z i e r ( 0 . 1 7 5 ,   0 . 8 8 5 ,   0 . 3 2 ,   1 . 2 7 5 )   f o r w a r d s ;  
 }  
  
 / *   A n i m a t i o n s   * /  
 @ k e y f r a m e s   t o a s t E n t e r   {  
         t o   {  
                 o p a c i t y :   1 ;  
                 t r a n s f o r m :   t r a n s l a t e Y ( 0 )   s c a l e ( 1 ) ;  
         }  
 }  
  
 @ k e y f r a m e s   t o a s t E x i t   {  
         t o   {  
                 o p a c i t y :   0 ;  
                 t r a n s f o r m :   t r a n s l a t e X ( - 5 0 p x ) ;  
                 / *   E x i t   t o   l e f t   * /  
         }  
 }  
  
 . t o a s t . e x i t i n g   {  
         a n i m a t i o n :   t o a s t E x i t   0 . 3 s   e a s e   f o r w a r d s ;  
 }  
  
 / *   T y p e   M o d i f i e r s   * /  
 . t o a s t - s u c c e s s   {  
         b o r d e r - r i g h t - c o l o r :   v a r ( - - s u c c e s s ) ;  
 }  
  
 . t o a s t - s u c c e s s : : b e f o r e   {  
         c o n t e n t :   '  S& ' ;  
         f o n t - s i z e :   1 . 2 r e m ;  
 }  
  
 . t o a s t - e r r o r   {  
         b o r d e r - r i g h t - c o l o r :   v a r ( - - d a n g e r ) ;  
 }  
  
 . t o a s t - e r r o r : : b e f o r e   {  
         c o n t e n t :   '   R' ;  
         f o n t - s i z e :   1 . 2 r e m ;  
 }  
  
 . t o a s t - w a r n i n g   {  
         b o r d e r - r i g h t - c o l o r :   v a r ( - - w a r n i n g ) ;  
 }  
  
 . t o a s t - w a r n i n g : : b e f o r e   {  
         c o n t e n t :   '  a    ' ;  
         f o n t - s i z e :   1 . 2 r e m ;  
 }  
  
 . t o a s t - i n f o   {  
         b o r d e r - r i g h t - c o l o r :   v a r ( - - i n f o ) ;  
 }  
  
 . t o a s t - i n f o : : b e f o r e   {  
         c o n t e n t :   '       ' ;  
         f o n t - s i z e :   1 . 2 r e m ;  
 }  
  
 / *   D a r k   M o d e   S u p p o r t   * /  
 b o d y . d a r k - m o d e   . t o a s t   {  
         b a c k g r o u n d :   r g b a ( 3 0 ,   3 0 ,   3 0 ,   0 . 9 5 ) ;  
         c o l o r :   v a r ( - - d a r k - t e x t ) ;  
         b o x - s h a d o w :   0   8 p x   2 4 p x   r g b a ( 0 ,   0 ,   0 ,   0 . 4 ) ;  
 }  
 / *   M o d a l   O v e r l a y   * /  
 . m o d a l - o v e r l a y   {  
         p o s i t i o n :   f i x e d ;  
         t o p :   0 ;  
         l e f t :   0 ;  
         w i d t h :   1 0 0 % ;  
         h e i g h t :   1 0 0 % ;  
         b a c k g r o u n d :   r g b a ( 0 ,   0 ,   0 ,   0 . 5 ) ;  
         / *   S e m i - t r a n s p a r e n t   b a c k d r o p   * /  
         b a c k d r o p - f i l t e r :   b l u r ( 4 p x ) ;  
         / *   B l u r   e f f e c t   * /  
         z - i n d e x :   2 0 0 0 ;  
         / *   H i g h e r   t h a n   t o a s t s ?   M a y b e   l o w e r   t h a n   t o a s t s   ( 9 9 9 9 )   b u t   h i g h e r   t h a n   e v e r y t h i n g   e l s e   * /  
         d i s p l a y :   n o n e ;  
         a l i g n - i t e m s :   c e n t e r ;  
         j u s t i f y - c o n t e n t :   c e n t e r ;  
         o p a c i t y :   0 ;  
         t r a n s i t i o n :   o p a c i t y   0 . 3 s   e a s e ;  
 }  
  
 . m o d a l - o v e r l a y . o p e n   {  
         d i s p l a y :   f l e x ;  
         o p a c i t y :   1 ;  
 }  
  
 / *   M o d a l   C o n t e n t   C a r d   * /  
 . m o d a l - c o n t e n t   {  
         b a c k g r o u n d :   v a r ( - - b g - c a r d ) ;  
         c o l o r :   v a r ( - - t e x t - m a i n ) ;  
         w i d t h :   9 0 % ;  
         m a x - w i d t h :   4 0 0 p x ;  
         p a d d i n g :   2 r e m ;  
         b o r d e r - r a d i u s :   1 6 p x ;  
         b o x - s h a d o w :   0   1 0 p x   3 0 p x   r g b a ( 0 ,   0 ,   0 ,   0 . 2 ) ;  
         t e x t - a l i g n :   c e n t e r ;  
         t r a n s f o r m :   s c a l e ( 0 . 9 ) ;  
         t r a n s i t i o n :   t r a n s f o r m   0 . 3 s   c u b i c - b e z i e r ( 0 . 1 7 5 ,   0 . 8 8 5 ,   0 . 3 2 ,   1 . 2 7 5 ) ;  
         b o r d e r :   1 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ;  
 }  
  
 . m o d a l - o v e r l a y . o p e n   . m o d a l - c o n t e n t   {  
         t r a n s f o r m :   s c a l e ( 1 ) ;  
 }  
  
 . m o d a l - c o n t e n t   h 3   {  
         m a r g i n - b o t t o m :   1 . 5 r e m ;  
         f o n t - s i z e :   1 . 2 r e m ;  
         c o l o r :   v a r ( - - t e x t - m a i n ) ;  
 }  
  
 . m o d a l - i n p u t   {  
         w i d t h :   1 0 0 % ;  
         p a d d i n g :   0 . 8 r e m   1 r e m ;  
         b o r d e r :   2 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ;  
         b o r d e r - r a d i u s :   8 p x ;  
         f o n t - s i z e :   1 . 1 r e m ;  
         m a r g i n - b o t t o m :   1 . 5 r e m ;  
         t e x t - a l i g n :   c e n t e r ;  
         t r a n s i t i o n :   b o r d e r - c o l o r   0 . 2 s ;  
 }  
  
 . m o d a l - i n p u t : f o c u s   {  
         b o r d e r - c o l o r :   v a r ( - - p r i m a r y ) ;  
         o u t l i n e :   n o n e ;  
 }  
  
 . m o d a l - a c t i o n s   {  
         d i s p l a y :   f l e x ;  
         g a p :   1 r e m ;  
         j u s t i f y - c o n t e n t :   c e n t e r ;  
 }  
  
 . m o d a l - a c t i o n s   . b t n   {  
         f l e x :   1 ;  
 }  
  
 / *   D a r k   M o d e   O v e r r i d e s   * /  
 b o d y . d a r k - m o d e   . m o d a l - c o n t e n t   {  
         b a c k g r o u n d :   v a r ( - - d a r k - c a r d ) ;  
         c o l o r :   v a r ( - - d a r k - t e x t ) ;  
         b o r d e r - c o l o r :   # 3 3 3 ;  
 }  
  
 b o d y . d a r k - m o d e   . m o d a l - i n p u t   {  
         b a c k g r o u n d :   # 2 d 2 d 2 d ;  
         b o r d e r - c o l o r :   # 4 4 4 ;  
         c o l o r :   w h i t e ;  
 }  
 
/* --- FIX MODALS & TOASTS --- */
.modal-overlay { display: none !important; align-items: center; justify-content: center; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 9999; }
.modal-overlay.open { display: flex !important; }
.toast-container { top: 20px !important; bottom: auto !important; left: 50% !important; transform: translateX(-50%) !important; right: auto !important; flex-direction: column-reverse !important; }
.toast { margin-top: 10px; }
