/* =========================================
   Mechanic Shop App — Main Stylesheet
   ========================================= */

:root {
  --shop-primary: #1a56db;
  --shop-secondary: #374151;
  --shop-accent: #f97316;
  --shop-bg: #f8fafc;
  --shop-card: #ffffff;
}

body {
  background: var(--shop-bg);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--shop-secondary);
}

/* ---- Navbar ---- */
.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.3px;
}

.navbar {
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* ---- Cards ---- */
.card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.card-header {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 12px 12px 0 0 !important;
}

/* ---- Calendar (admin schedule) ---- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  min-height: 80px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
  background: #fff;
}

.calendar-day:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  transform: translateY(-1px);
  border-color: var(--shop-primary);
}

.calendar-day.today {
  border: 2px solid var(--shop-primary);
  background: #eff6ff;
}

.calendar-day.closed {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: default;
}

.calendar-day.holiday {
  background: #fff7ed;
  border-color: #fb923c;
}

.calendar-day.has-appts {
  background: #f0fdf4;
  border-color: #22c55e;
}

.calendar-day.other-month {
  opacity: 0.4;
}

.calendar-day-num {
  font-weight: 700;
  font-size: 1rem;
}

.calendar-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: #e5e7eb;
  margin-top: 2px;
}

.calendar-day-header {
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
  color: #6b7280;
  padding: 4px 0;
}

/* ---- Capacity bars ---- */
.capacity-bar {
  height: 8px;
  border-radius: 4px;
  background: #e5e7eb;
  overflow: hidden;
}

.capacity-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ---- Service cards (customer booking) ---- */
.service-card {
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border-radius: 10px;
}

.service-card:hover {
  background: #f8fafc;
  border-color: var(--shop-primary) !important;
}

/* ---- Slot buttons ---- */
.slot-btn {
  min-width: 74px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.15s;
}

/* ---- Customer hero section ---- */
.customer-hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a56db 100%);
  color: white;
}

.customer-hero h1,
.customer-hero p {
  color: white !important;
}

.customer-hero .text-muted {
  color: rgba(255,255,255,0.75) !important;
}

/* ---- Buttons ---- */
.btn-xs {
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  border-radius: 5px;
}

.cursor-pointer {
  cursor: pointer;
}

/* ---- Status badges ---- */
.badge {
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ---- Font monospace plates ---- */
.font-monospace {
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 1px;
}

.letter-spacing-2 {
  letter-spacing: 2px;
}

/* ---- Print schedule ---- */
@media print {
  .navbar, .btn, .modal, footer { display: none !important; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; }
}

/* ---- Mobile responsiveness ---- */
@media (max-width: 576px) {
  .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
  }

  .calendar-day {
    min-height: 54px;
    padding: 4px 4px;
    font-size: 0.72rem;
  }

  .calendar-day-num {
    font-size: 0.85rem;
  }

  .calendar-badge {
    display: none;
  }

  h1.h3 {
    font-size: 1.2rem;
  }
}

/* ---- Flash alerts ---- */
.alert {
  border-radius: 10px;
}

/* ---- Table improvements ---- */
.table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  font-weight: 600;
}

.table-hover tbody tr:hover {
  background: #f0f7ff;
}

/* ---- Progress bars ---- */
.progress {
  border-radius: 99px;
  background: #e5e7eb;
}

/* ---- Form improvements ---- */
.form-control:focus,
.form-select:focus {
  border-color: var(--shop-primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.15);
}

/* ---- Loading spinner overlay ---- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* ---- Sidebar / nav active states ---- */
.nav-link.active {
  color: white !important;
  background: rgba(255,255,255,0.15);
  border-radius: 6px;
}

/* =========================================
   RTL / Language Support
   ========================================= */

/* RTL arrow direction fixes */
[dir="rtl"] .bi-arrow-left::before { content: "\f138"; } /* arrow-right icon */
[dir="rtl"] .bi-arrow-right::before { content: "\f12f"; } /* arrow-left icon */

/* RTL border-start → visual left, border-end → visual right */
[dir="rtl"] .border-start { border-start: none !important; border-end: 4px solid var(--bs-border-color) !important; }

/* Calendar RTL */
[dir="rtl"] .calendar-grid { direction: rtl; }

/* Dropdown menus in RTL */
[dir="rtl"] .dropdown-menu { text-align: right; }

/* Language switcher flag spacing */
.lang-flag { font-size: 1rem; line-height: 1; }

/* Arabic font improvement */
:lang(ar) { font-family: 'Segoe UI', Tahoma, 'Arabic Typesetting', sans-serif; }

/* Russian font */
:lang(ru) { font-family: 'Segoe UI', system-ui, sans-serif; }

/* Hebrew font */
:lang(he) { font-family: 'Segoe UI', 'Arial Hebrew', sans-serif; }
