/* ==============================================================================
   منظومة «صيانة بلس» (Home Maintenance Pro) - نظام التصميم الأساسي المطور للهواتف
   مطور بالكامل بـ Vanilla CSS بدون أي إطارات عمل خارجية (No Tailwind, No Bootstrap)
============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* ألوان الهوية البصرية الرسمية */
  --primary: #FF5F00;
  --primary-hover: #E65300;
  --primary-dark: #A63B00;
  --primary-light: #FFF4ED;
  --primary-glow: rgba(255, 95, 0, 0.28);
  --on-primary: #FFFFFF;

  --secondary: #1E252D;
  --secondary-hover: #2C3642;
  --secondary-muted: #585F68;
  --on-secondary: #FFFFFF;

  --tertiary: #FFA100;
  --tertiary-dark: #865300;
  --tertiary-light: #FFF9ED;

  /* الخلفيات والأسطح */
  --bg-app: #F8F9FA;
  --surface-card: #FFFFFF;
  --surface-dim: #F1F3F5;
  --surface-hover: #F8F9FA;
  --surface-glass: rgba(255, 255, 255, 0.94);

  /* النصوص */
  --text-main: #1E252D;
  --text-muted: #6C757D;
  --text-subtle: #8E98A4;
  --text-inverted: #FFFFFF;

  /* الحدود والظلال */
  --border-subtle: rgba(30, 37, 45, 0.08);
  --border-focus: #FF5F00;
  --shadow-ambient: 0 2px 8px -2px rgba(30, 37, 45, 0.06), 0 1px 3px -1px rgba(30, 37, 45, 0.04);
  --shadow-elevated: 0 8px 24px -4px rgba(30, 37, 45, 0.08), 0 4px 8px -2px rgba(30, 37, 45, 0.04);
  --shadow-glow: 0 8px 20px -4px var(--primary-glow);
  --shadow-glow-tertiary: 0 6px 16px -3px rgba(255, 161, 0, 0.35);

  /* حالات التحقق والأمان */
  --success: #10B981;
  --success-light: #ECFDF5;
  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --danger: #EF4444;
  --danger-light: #FEF2F2;

  /* الحواف والزوايا (Border Radius) */
  --radius-xs: 0.25rem;
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-pill: 9999px;

  /* المسافات والخطوط */
  --font-family: 'Cairo', 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* تهيئة أساسية وتحسينات الهواتف اللمسية */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

body {
  font-family: var(--font-family);
  background-color: #E9ECEF;
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* شريط التنقل العلوي السريع بين الأدوار والشاشات */
.persona-bar {
  background: var(--secondary);
  color: #FFF;
  padding: 8px 12px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.persona-bar-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: #FFA100;
  font-size: 0.82rem;
}

.persona-bar-links {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.persona-bar-links::-webkit-scrollbar {
  display: none;
}

.persona-btn {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.75rem;
  color: #E2E8F0;
  background: rgba(255, 255, 255, 0.08);
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.persona-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #FFF;
}

.persona-btn.active {
  background: var(--primary);
  color: #FFF;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* الحاوية الرئيسية للتطبيق - منسقة 100% للهاتف */
.app-container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-app);
  position: relative;
  box-shadow: 0 0 35px rgba(30, 37, 45, 0.12);
  display: flex;
  flex-direction: column;
  padding-bottom: calc(85px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 480px) {
  body {
    background-color: var(--bg-app);
  }
  .app-container {
    max-width: 100%;
    box-shadow: none;
  }
}

/* الرأس العلوي للهاتف (App Header) */
.app-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-top: max(10px, env(safe-area-inset-top, 10px));
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--secondary);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 5px;
}

.brand-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 95, 0, 0.2);
}

.brand-location {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
  text-decoration: none;
}

.icon-btn:active {
  transform: scale(0.92);
  background: var(--surface-dim);
}

.icon-btn .badge-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  border: 2px solid #FFF;
}

/* شريط البحث المباشر في الهاتف */
.search-bar-container {
  padding: 10px 14px;
}

.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
  background: #FFF;
  border: 1.5px solid rgba(30, 37, 45, 0.12);
  border-radius: var(--radius-md);
  padding: 3px 6px 3px 12px;
  box-shadow: var(--shadow-ambient);
  transition: var(--transition-fast);
}

.search-input-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 95, 0, 0.15);
}

.search-input-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 9px 6px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-main);
  text-align: right;
}

.search-btn {
  background: var(--primary);
  color: #FFF;
  border: none;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition-fast);
  min-height: 38px;
}

.search-btn:active {
  transform: scale(0.95);
  background: var(--primary-hover);
}

/* شبكة أقسام الصيانة منسقة للهاتف (4 أعمدة متوازنة) */
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 6px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--secondary);
}

.section-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: -3px;
}

.section-link {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 2px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 6px 14px 14px;
}

@media (max-width: 360px) {
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.category-card {
  background: #FFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 4px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-ambient);
}

.category-card:active {
  transform: scale(0.95);
  border-color: var(--primary);
  background: var(--primary-light);
}

.category-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition-fast);
}

.category-name {
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.2;
}

/* بطاقات الفنيين في الهاتف */
.tech-card {
  background: #FFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 0 14px 10px;
  box-shadow: var(--shadow-ambient);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition-fast);
}

.tech-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tech-avatar-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.tech-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid #FFF;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.tech-verified-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  background: var(--success);
  color: #FFF;
  font-size: 0.6rem;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tech-meta {
  flex: 1;
}

.tech-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tech-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--secondary);
}

.tech-badge-title {
  background: var(--tertiary-light);
  color: var(--tertiary-dark);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

.tech-specialty {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.tech-stats-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.rating-pill {
  color: var(--tertiary);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 2px;
}

.tech-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--border-subtle);
  padding-top: 8px;
}

.tech-price-wrap {
  display: flex;
  flex-direction: column;
}

.price-label {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.price-value {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--secondary);
}

.price-currency {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  margin-inline-start: 2px;
}

/* الأزرار الموحدة */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.18s ease;
  min-height: 44px;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: rgba(30, 37, 45, 0.07);
  color: var(--secondary);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(30, 37, 45, 0.15);
  color: var(--secondary);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
  min-height: 36px;
  border-radius: var(--radius-sm);
}

/* باقات الصيانة الدورية في الهاتف */
.package-card {
  background: #FFF;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin: 0 14px 12px;
  box-shadow: var(--shadow-ambient);
  position: relative;
}

.package-card.highlight {
  border-color: var(--primary);
  background: linear-gradient(180deg, #FFF9F5 0%, #FFFFFF 40%);
}

.package-badge-popular {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary);
  color: #FFF;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.package-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.package-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.package-title {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--secondary);
}

.package-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.package-features {
  list-style: none;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.package-feature-item {
  font-size: 0.74rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.package-feature-item i {
  color: var(--success);
  font-size: 0.8rem;
}

.package-pricing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  margin-top: 6px;
}

/* شريط التنقل السفلي الثابت للهواتف (Bottom Navigation Bar) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 440px;
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
}

@media (max-width: 480px) {
  .bottom-nav {
    max-width: 100%;
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  position: relative;
  min-width: 60px;
}

.nav-item i {
  font-size: 1.15rem;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 900;
}

.nav-item.active::after {
  content: '';
  position: absolute;
  top: -6px;
  width: 20px;
  height: 3px;
  background: var(--primary);
  border-radius: var(--radius-pill);
}

/* بانر الطوارئ في الهاتف */
.emergency-banner {
  background: linear-gradient(135deg, #B91C1C 0%, #FF5F00 100%);
  color: #FFF;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(185, 28, 28, 0.22);
}

.emergency-info h4 {
  font-size: 0.88rem;
  font-weight: 900;
}

.emergency-info p {
  font-size: 0.7rem;
  opacity: 0.9;
}

.emergency-call-btn {
  background: #FFF;
  color: #B91C1C;
  font-weight: 900;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-size: 0.78rem;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* النوافذ المنبثقة السفلية الناتجة عن اللمس (Native Mobile Bottom Sheets) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 37, 45, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.26s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  background: #FFF;
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 24px 24px 0 0;
  padding: 12px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 35px rgba(0,0,0,0.25);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-overflow-scrolling: touch;
}

.sheet-drag-handle {
  width: 40px;
  height: 5px;
  background: #CBD5E1;
  border-radius: var(--radius-pill);
  margin: 0 auto 12px;
}

.modal-overlay.active .bottom-sheet {
  transform: translateY(0);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.sheet-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--secondary);
}

.sheet-close-btn {
  background: var(--surface-dim);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* خطوات معالج الحجز في الهاتف */
.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  position: relative;
}

.wizard-steps::before {
  content: '';
  position: absolute;
  top: 14px;
  right: 12px;
  left: 12px;
  height: 2px;
  background: var(--border-subtle);
  z-index: 1;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
  z-index: 2;
}

.step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-dim);
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFF;
  transition: var(--transition-fast);
}

.step-item.active .step-circle {
  background: var(--primary);
  color: #FFF;
  box-shadow: var(--shadow-glow);
}

.step-item.completed .step-circle {
  background: var(--success);
  color: #FFF;
}

.step-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.step-item.active .step-label {
  color: var(--primary);
}

/* حقول الإدخال والاختيارات في الهاتف */
.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  height: 46px;
  border: 1.5px solid rgba(30, 37, 45, 0.12);
  border-radius: 12px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-main);
  background: #FFF;
  transition: var(--transition-fast);
  text-align: right;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 95, 0, 0.15);
}

textarea.form-control {
  height: auto;
  min-height: 75px;
  padding: 10px 12px;
}

/* بطاقات الاختيار الراديو المخصصة للمس */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.choice-chip {
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1.5px solid rgba(30, 37, 45, 0.12);
  background: #FFF;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
}

.choice-chip:active, .choice-chip.active, .choice-chip:has(input:checked) {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.choice-chip input {
  display: none;
}

/* مسجل الصوت التفاعلي في الهاتف */
.voice-recorder-box {
  background: var(--surface-dim);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px dashed var(--border-subtle);
}

.record-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFF;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.record-btn.recording {
  background: var(--danger);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.06); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.audio-waveform {
  flex: 1;
  height: 22px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.wave-bar {
  width: 3px;
  height: 6px;
  background: #CBD5E1;
  border-radius: 2px;
}

.record-btn.recording ~ .audio-waveform .wave-bar {
  background: var(--primary);
  animation: soundWave 0.8s ease-in-out infinite alternate;
}

@keyframes soundWave {
  0% { height: 4px; }
  100% { height: 20px; }
}

/* التنبيهات المنبثقة (Toast Alerts) في الهاتف */
.toast-container {
  position: fixed;
  top: max(45px, env(safe-area-inset-top, 45px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 92%;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  background: var(--secondary);
  color: #FFF;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  pointer-events: auto;
  animation: slideDown 0.28s ease;
}

.toast.success { border-right: 4px solid var(--success); }
.toast.danger { border-right: 4px solid var(--danger); }
.toast.info { border-right: 4px solid var(--primary); }

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

/* ==============================================================================
   تطوير نظام تصفية الفنيين وبروفايل الفني والشات التفاعلي - أمان بيتك
============================================================================== */

/* بطاقة القسم عند التحديد */
.category-card {
  cursor: pointer;
  position: relative;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1.5px solid transparent;
}

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

.category-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 4px 14px var(--primary-glow);
  transform: translateY(-2px);
}

.category-card.active .category-icon-box {
  background: var(--primary);
  color: #FFF;
  box-shadow: var(--shadow-glow);
}

.category-card.active .category-name {
  color: var(--primary-dark);
  font-weight: 800;
}

/* شريط تصفية الفنيين حسب الأقسام (Category Filter Bar) */
.tech-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 14px 14px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap !important;
  width: 100%;
}

.tech-filter-bar::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.tech-filter-pill {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  border: 1.5px solid var(--border-subtle) !important;
  background: #FFFFFF !important;
  color: var(--text-main) !important;
  padding: 7px 14px !important;
  border-radius: var(--radius-pill) !important;
  font-family: inherit;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  outline: none !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-filter-pill i {
  color: var(--primary);
  font-size: 0.82rem;
  transition: color 0.2s ease;
}

.tech-filter-pill:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  transform: translateY(-1px);
}

.tech-filter-pill.active {
  background: var(--secondary) !important;
  color: #FFFFFF !important;
  border-color: var(--secondary) !important;
  box-shadow: 0 4px 14px rgba(30, 37, 45, 0.25) !important;
}

.tech-filter-pill.active i {
  color: var(--tertiary);
}

.tech-filter-pill.active .pill-count {
  background: var(--primary) !important;
  color: #FFFFFF !important;
}

.pill-count {
  background: var(--surface-dim);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

/* مؤشر القسم المختار أعلى قائمة الفنيين */
.active-category-banner {
  background: linear-gradient(135deg, var(--primary-light) 0%, #FFF 100%);
  border: 1px solid rgba(255, 95, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin: 0 14px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
}

.active-cat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: var(--primary-dark);
}

.active-cat-reset {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* تحسين بطاقة الفني */
.tech-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tech-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}

.tech-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-chat-tech {
  background: var(--surface-dim);
  color: var(--secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  min-height: 36px;
}

.btn-chat-tech:hover {
  background: #E2E8F0;
  color: var(--primary);
}

.btn-profile-tech {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
}

.btn-profile-tech:hover {
  color: var(--secondary);
  border-color: var(--secondary);
}

/* بانر التسعير العادل والشفاف (Fair Pricing Guarantee Banner) */
.pricing-guarantee-card {
  background: linear-gradient(135deg, #1E252D 0%, #2A3844 100%);
  color: #FFF;
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 0 14px 18px;
  box-shadow: var(--shadow-elevated);
  position: relative;
  overflow: hidden;
}

.pricing-guarantee-card::before {
  content: '';
  position: absolute;
  top: -40px;
  left: -40px;
  width: 120px;
  height: 120px;
  background: var(--primary);
  opacity: 0.15;
  border-radius: 50%;
  filter: blur(30px);
}

.pricing-guarantee-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pricing-guarantee-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 95, 0, 0.18);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.pricing-guarantee-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #FFF;
}

.pricing-guarantee-desc {
  font-size: 0.76rem;
  color: #CBD5E1;
  line-height: 1.5;
}

.pricing-steps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pricing-step-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}

.pricing-step-num {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--tertiary);
  margin-bottom: 2px;
}

.pricing-step-text {
  font-size: 0.7rem;
  font-weight: 700;
  color: #FFF;
  line-height: 1.3;
}

/* نافذة بروفايل الفني الشامل (Technician Profile Modal) */
.tech-profile-sheet {
  background: #FFF;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -8px 30px rgba(0,0,0,0.25);
}

.tech-profile-cover {
  background: linear-gradient(135deg, #1E252D 0%, #394857 100%);
  padding: 24px 18px 16px;
  position: relative;
  color: #FFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tech-profile-avatar-box {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 10px;
}

.tech-profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 22px;
  object-fit: cover;
  border: 3px solid #FFF;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.tech-profile-badges-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.tech-profile-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tech-detail-box {
  background: var(--surface-dim);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tech-detail-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tech-detail-text {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tech-kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.tech-kpi-box {
  background: #FFF;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}

.tech-kpi-val {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--secondary);
}

.tech-kpi-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* نافذة الشات التفاعلية المباشرة (Technician Chat Modal) */
.chat-window-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1300;
  align-items: flex-end;
  justify-content: center;
}

.chat-window-modal.active {
  display: flex;
}

.chat-box-container {
  background: #FFF;
  width: 100%;
  max-width: 500px;
  height: 85vh;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.3);
  animation: slideUp 0.28s ease;
}

.chat-header {
  background: var(--secondary);
  color: #FFF;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-tech-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-tech-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.chat-tech-name {
  font-size: 0.9rem;
  font-weight: 800;
}

.chat-online-status {
  font-size: 0.68rem;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-body-thread {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  background: #F8FAFC;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.82rem;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
}

.chat-msg.incoming {
  align-self: flex-start;
  background: #FFF;
  color: var(--secondary);
  border: 1px solid var(--border-subtle);
  border-bottom-right-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.chat-msg.outgoing {
  align-self: flex-end;
  background: var(--primary);
  color: #FFF;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-glow);
}

.chat-msg-time {
  font-size: 0.62rem;
  opacity: 0.75;
  margin-top: 4px;
  display: block;
  text-align: left;
}

.chat-quick-replies {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: #FFF;
  border-top: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}

.chat-quick-replies::-webkit-scrollbar {
  display: none;
}

.quick-reply-chip {
  background: var(--surface-dim);
  color: var(--secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-reply-chip:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #FFF;
  border-top: 1px solid var(--border-subtle);
}

.chat-input-field {
  flex: 1;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
  background: var(--surface-dim);
}

.chat-input-field:focus {
  border-color: var(--primary);
  background: #FFF;
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  box-shadow: var(--shadow-glow);
  transition: transform 0.15s ease;
}

.chat-send-btn:active {
  transform: scale(0.92);
}

.chat-action-icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-action-icon-btn:hover {
  color: var(--primary);
  background: var(--surface-dim);
}

/* ==============================================================================
   بانر التسعير العادل والشفاف (Fair Pricing Guarantee Card)
============================================================================== */
.pricing-guarantee-card {
  background: linear-gradient(135deg, #1E252D 0%, #2A3844 100%) !important;
  color: #FFFFFF !important;
  border-radius: var(--radius-lg) !important;
  padding: 16px 18px !important;
  margin: 0 14px 18px !important;
  box-shadow: 0 8px 24px -4px rgba(30, 37, 45, 0.18) !important;
  position: relative !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.pricing-guarantee-header {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
}

.pricing-guarantee-icon {
  width: 42px !important;
  height: 42px !important;
  border-radius: 12px !important;
  background: rgba(255, 95, 0, 0.22) !important;
  color: #FF5F00 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.25rem !important;
  flex-shrink: 0 !important;
}

.pricing-guarantee-title {
  font-size: 0.98rem !important;
  font-weight: 800 !important;
  color: #FFFFFF !important;
  margin: 0 0 3px !important;
}

.pricing-guarantee-desc {
  font-size: 0.76rem !important;
  color: #CBD5E1 !important;
  line-height: 1.45 !important;
  margin: 0 !important;
}

.pricing-steps-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px !important;
  margin-top: 12px !important;
  padding-top: 12px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.pricing-step-item {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 12px !important;
  padding: 10px 8px !important;
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

.pricing-step-num {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  color: #FFA100 !important;
  margin-bottom: 4px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
}

.pricing-step-text {
  font-size: 0.73rem !important;
  font-weight: 700 !important;
  color: #FFFFFF !important;
  line-height: 1.35 !important;
}

