/* ==========================================
   Hotel Management System - Style.css
   نظام تصميم لإدارة الفنادق
   ========================================== */

/* Offline Standalone Mode Enabled */
/* System Fonts & Local Fallbacks */

/* ---- CSS Custom Properties ---- */
:root {
  --primary: hsl(220, 85%, 57%);
  --primary-light: hsl(220, 85%, 67%);
  --primary-dark: hsl(220, 85%, 47%);
  --primary-glow: hsla(220, 85%, 57%, 0.35);

  --accent: hsl(45, 95%, 60%);
  --accent-light: hsl(45, 95%, 70%);
  --accent-glow: hsla(45, 95%, 60%, 0.3);

  --success: hsl(145, 65%, 50%);
  --success-light: hsl(145, 65%, 60%);
  --success-glow: hsla(145, 65%, 50%, 0.3);

  --danger: hsl(0, 75%, 58%);
  --danger-light: hsl(0, 75%, 68%);
  --danger-glow: hsla(0, 75%, 58%, 0.3);

  --warning: hsl(35, 90%, 58%);
  --warning-light: hsl(35, 90%, 68%);
  --warning-glow: hsla(35, 90%, 58%, 0.3);

  --info: hsl(190, 80%, 52%);
  --info-light: hsl(190, 80%, 62%);
  --info-glow: hsla(190, 80%, 52%, 0.3);

  /* Background layers */
  --bg-base: hsl(222, 28%, 7%);
  --bg-surface: hsl(222, 25%, 11%);
  --bg-elevated: hsl(222, 22%, 15%);
  --bg-overlay: hsl(222, 20%, 19%);

  /* Glass effect */
  --glass-bg: hsla(222, 30%, 100%, 0.04);
  --glass-border: hsla(222, 30%, 100%, 0.1);
  --glass-hover: hsla(222, 30%, 100%, 0.07);

  /* Text */
  --text-primary: hsl(220, 20%, 94%);
  --text-secondary: hsl(220, 15%, 65%);
  --text-muted: hsl(220, 12%, 45%);
  --text-inverse: hsl(222, 28%, 8%);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, hsl(220, 85%, 50%), hsl(260, 80%, 60%));
  --gradient-accent: linear-gradient(135deg, hsl(45, 95%, 55%), hsl(30, 95%, 60%));
  --gradient-success: linear-gradient(135deg, hsl(145, 65%, 45%), hsl(165, 65%, 50%));
  --gradient-danger: linear-gradient(135deg, hsl(0, 75%, 52%), hsl(340, 75%, 58%));
  --gradient-bg: linear-gradient(135deg, hsl(222, 28%, 7%), hsl(235, 30%, 9%));

  /* Shadows */
  --shadow-sm: 0 2px 8px hsla(222, 28%, 0%, 0.4);
  --shadow-md: 0 4px 20px hsla(222, 28%, 0%, 0.5);
  --shadow-lg: 0 8px 40px hsla(222, 28%, 0%, 0.6);
  --shadow-xl: 0 16px 60px hsla(222, 28%, 0%, 0.7);
  --shadow-primary: 0 4px 20px var(--primary-glow);
  --shadow-accent: 0 4px 20px var(--accent-glow);
  --shadow-success: 0 4px 20px var(--success-glow);

  /* Borders */
  --border-subtle: 1px solid var(--glass-border);
  --border-primary: 1px solid hsla(220, 85%, 57%, 0.4);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Sidebar */
  --sidebar-width: 260px;
  --header-height: 70px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', 'Inter', sans-serif;
  background: var(--gradient-bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ---- Layout ---- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-left: var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition-base);
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-primary);
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 8px 12px 4px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: right;
}

.nav-item:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
  transform: translateX(-2px);
}

.nav-item.active {
  background: hsla(220, 85%, 57%, 0.15);
  color: var(--primary-light);
  border-right: 3px solid var(--primary);
}

.nav-item .nav-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px;
  border-top: var(--border-subtle);
}

.sidebar-footer-info {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  margin-right: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Top Header ---- */
.top-header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}

.header-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.header-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- Page Content ---- */
.page-content {
  padding: 28px;
  flex: 1;
}

/* ---- Cards ---- */
.card {
  background: var(--glass-bg);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(10px);
  transition: all var(--transition-base);
}

.card:hover {
  background: var(--glass-hover);
  border-color: hsla(220, 85%, 57%, 0.2);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- Stat Cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--glass-bg);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.primary::before { background: var(--gradient-primary); }
.stat-card.success::before { background: var(--gradient-success); }
.stat-card.warning::before { background: var(--gradient-accent); }
.stat-card.danger::before { background: var(--gradient-danger); }
.stat-card.info::before { background: linear-gradient(90deg, var(--info), var(--info-light)); }

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.primary { background: hsla(220, 85%, 57%, 0.15); }
.stat-icon.success { background: hsla(145, 65%, 50%, 0.15); }
.stat-icon.warning { background: hsla(45, 95%, 60%, 0.15); }
.stat-icon.danger { background: hsla(0, 75%, 58%, 0.15); }
.stat-icon.info { background: hsla(190, 80%, 52%, 0.15); }

.stat-info { flex: 1; }
.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card.primary .stat-value { color: var(--primary-light); }
.stat-card.success .stat-value { color: var(--success-light); }
.stat-card.warning .stat-value { color: var(--accent-light); }
.stat-card.danger .stat-value { color: var(--danger-light); }
.stat-card.info .stat-value { color: var(--info-light); }

.stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- Progress Bar ---- */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.success { background: var(--gradient-success); }
.progress-fill.warning { background: var(--gradient-accent); }
.progress-fill.danger { background: var(--gradient-danger); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::after { opacity: 0.07; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--gradient-success);
  color: white;
  box-shadow: var(--shadow-success);
}

.btn-danger {
  background: var(--gradient-danger);
  color: white;
}

.btn-warning {
  background: var(--gradient-accent);
  color: var(--text-inverse);
}

.btn-ghost {
  background: var(--glass-bg);
  color: var(--text-secondary);
  border: var(--border-subtle);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* ---- Form Elements ---- */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: 'Cairo', sans-serif;
  transition: all var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-overlay);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- Tables ---- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: var(--border-subtle);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--bg-elevated);
}

th {
  padding: 13px 16px;
  text-align: right;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border-bottom: var(--border-subtle);
}

td {
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--text-primary);
  border-bottom: 1px solid hsla(222, 30%, 100%, 0.05);
  vertical-align: middle;
}

tbody tr {
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: var(--glass-hover);
}

tbody tr:last-child td { border-bottom: none; }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-primary { background: hsla(220, 85%, 57%, 0.2); color: var(--primary-light); }
.badge-success { background: hsla(145, 65%, 50%, 0.2); color: var(--success-light); }
.badge-warning { background: hsla(45, 95%, 60%, 0.2); color: var(--accent-light); }
.badge-danger { background: hsla(0, 75%, 58%, 0.2); color: var(--danger-light); }
.badge-info { background: hsla(190, 80%, 52%, 0.2); color: var(--info-light); }
.badge-muted { background: hsla(220, 15%, 65%, 0.15); color: var(--text-secondary); }

/* ---- Alert Box ---- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-success {
  background: hsla(145, 65%, 50%, 0.1);
  border-color: hsla(145, 65%, 50%, 0.3);
  color: var(--success-light);
}

.alert-danger {
  background: hsla(0, 75%, 58%, 0.1);
  border-color: hsla(0, 75%, 58%, 0.3);
  color: var(--danger-light);
}

.alert-warning {
  background: hsla(45, 95%, 60%, 0.1);
  border-color: hsla(45, 95%, 60%, 0.3);
  color: var(--accent-light);
}

.alert-info {
  background: hsla(190, 80%, 52%, 0.1);
  border-color: hsla(190, 80%, 52%, 0.3);
  color: var(--info-light);
}

/* ---- Notification Cards ---- */
.notification-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: var(--border-subtle);
  transition: all var(--transition-fast);
}

.notification-item:hover {
  border-color: hsla(220, 85%, 57%, 0.3);
  background: var(--bg-overlay);
}

.notif-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.notif-dot.checkin { background: var(--success); box-shadow: 0 0 8px var(--success-glow); }
.notif-dot.checkout { background: var(--danger); box-shadow: 0 0 8px var(--danger-glow); }
.notif-dot.upcoming { background: var(--warning); box-shadow: 0 0 8px var(--warning-glow); }

.notif-content { flex: 1; }
.notif-title { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.notif-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.notif-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: hsla(222, 28%, 0%, 0.75);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 24px 28px 20px;
  border-bottom: var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body { padding: 24px 28px; }
.modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

/* ---- Hotel Cards (in hotels page) ---- */
.hotels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.hotel-card {
  background: var(--glass-bg);
  border: var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.hotel-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: var(--gradient-primary);
  opacity: 0.05;
  border-radius: 50%;
  pointer-events: none;
}

.hotel-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: hsla(220, 85%, 57%, 0.3);
}

.hotel-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.hotel-avatar {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-primary);
}

.hotel-actions { display: flex; gap: 6px; }

.hotel-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.hotel-code {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hotel-stats-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.hotel-stat {
  flex: 1;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-align: center;
}

.hotel-stat-val {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-light);
}

.hotel-stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- Occupancy Ring ---- */
.occupancy-ring {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.occupancy-ring svg {
  transform: rotate(-90deg);
}

.occupancy-ring .ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* ---- Date Display ---- */
.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-secondary);
  border: var(--border-subtle);
}

/* ---- Filter Bar ---- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-bar .form-control {
  max-width: 220px;
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 0.83rem;
}

/* ---- Toast Notifications ---- */
.toast-container {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 280px;
  animation: toastIn 0.3s ease forwards;
  pointer-events: all;
  backdrop-filter: blur(12px);
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--primary); }
.toast.warning { border-left: 3px solid var(--warning); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-20px); }
}

/* ---- Availability Indicator ---- */
.availability-check-box {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  font-weight: 600;
}

.availability-check-box.available {
  background: hsla(145, 65%, 50%, 0.1);
  border-color: hsla(145, 65%, 50%, 0.4);
  color: var(--success-light);
}

.availability-check-box.unavailable {
  background: hsla(0, 75%, 58%, 0.1);
  border-color: hsla(0, 75%, 58%, 0.4);
  color: var(--danger-light);
}

.availability-check-box.checking {
  background: hsla(220, 85%, 57%, 0.1);
  border-color: hsla(220, 85%, 57%, 0.4);
  color: var(--primary-light);
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.animate-in {
  animation: fadeInUp 0.4s ease forwards;
}

.animate-pulse {
  animation: pulse 1.5s ease infinite;
}

/* ---- Page Header ---- */
.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ---- Divider ---- */
.divider {
  border: none;
  border-top: var(--border-subtle);
  margin: 20px 0;
}

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
  width: fit-content;
}

.tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-right: 0;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
}

/* ---- Loading Spinner ---- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Misc Utilities ---- */
.text-primary { color: var(--primary-light) !important; }
.text-success { color: var(--success-light) !important; }
.text-danger { color: var(--danger-light) !important; }
.text-warning { color: var(--accent-light) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }

.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.w-100 { width: 100%; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 800px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---- Smooth Theme & Direction Transitions ---- */
html, body, .card, .stat-card, .sidebar, .header, table, th, td, input, select, button, .app-layout {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* Header Controls Widget (Language & Theme Switcher) */
.header-controls-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lang-theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 9999px;
  padding: 3px 6px;
}

.lang-select-btn, .theme-select-btn, .lang-switch-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.lang-select-btn:hover, .theme-select-btn:hover, .lang-switch-btn:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
}

.lang-select-btn.active, .theme-select-btn.active, .lang-switch-btn.active {
  background: var(--gradient-primary);
  color: #ffffff !important;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Lang switcher separator */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-inline-start: 4px;
  border-inline-start: 1px solid var(--glass-border);
  margin-inline-start: 4px;
}

/* ================================================================
   MOBILE & TABLET / IPAD RESPONSIVE ENHANCEMENTS (Touch-Optimized)
   ================================================================ */

/* Prevent iOS Zoom on Input Focus */
@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* Touch targets & Scrolling */
* {
  -webkit-tap-highlight-color: transparent;
}

.table-wrapper, .overflow-x-auto, .fp-grid, .sidebar-nav {
  -webkit-overflow-scrolling: touch;
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 990;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Floating Mobile Hamburger Button */
.mobile-nav-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--bg-elevated, #1e293b);
  border: 1px solid var(--glass-border, #334155);
  border-radius: var(--radius-md, 10px);
  color: var(--text-primary, #fff);
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mobile-nav-btn:hover {
  background: var(--glass-hover, #334155);
  color: var(--primary-light, #38bdf8);
}

@media (max-width: 900px) {
  .mobile-nav-btn {
    display: inline-flex;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    width: 280px;
    z-index: 1000;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  [dir="ltr"] .sidebar {
    right: auto;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.5);
  }

  .sidebar.open {
    transform: translateX(0) !important;
  }

  .top-header {
    padding: 12px 16px;
    gap: 12px;
  }

  .header-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* iPad & Tablet Grid Adjustments */
  .grid-2, .grid-3, .form-row {
    grid-template-columns: 1fr;
  }
}

/* LTR direction adjustments when English is active */
[dir="ltr"] .sidebar {
  right: auto;
  left: 0;
}
[dir="ltr"] .main-content {
  margin-right: 0;
  margin-left: 260px;
}
@media (max-width: 768px) {
  [dir="ltr"] .main-content {
    margin-left: 0;
  }
}

