/*
 * iOS 18 Design System & Mobile First Stylesheet
 * Dubai Luxury Real Estate Platform (RERA & DLD Compliant)
 */

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

:root {
  --ios-bg: #f2f2f7;
  --ios-card: #ffffff;
  --ios-card-glass: rgba(255, 255, 255, 0.85);
  --ios-blue: #007aff;
  --ios-blue-rgb: 0, 122, 255;
  --ios-gold: #c5a059;
  --ios-gold-dark: #997738;
  --ios-emerald: #34c759;
  --ios-gray-text: #8e8e93;
  --ios-gray-dark: #3a3a3c;
  --ios-border: rgba(60, 60, 67, 0.12);
  --ios-nav-bg: rgba(255, 255, 255, 0.85);
  --ios-tab-bg: rgba(255, 255, 255, 0.90);
  --ios-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --ios-shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.08);
  --ios-radius: 20px;
  --ios-radius-sm: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 24px);
  --font-en: -apple-system, BlinkMacSystemFont, "Plus Jakarta Sans", "SF Pro Display", sans-serif;
  --font-ar: "Cairo", -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="dark"] {
  --ios-bg: #000000;
  --ios-card: #1c1c1e;
  --ios-card-glass: rgba(28, 28, 30, 0.88);
  --ios-blue: #0a84ff;
  --ios-blue-rgb: 10, 132, 255;
  --ios-gray-text: #98989d;
  --ios-gray-dark: #e5e5ea;
  --ios-border: rgba(255, 255, 255, 0.12);
  --ios-nav-bg: rgba(28, 28, 30, 0.85);
  --ios-tab-bg: rgba(28, 28, 30, 0.92);
  --ios-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --ios-shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-en);
  background-color: var(--ios-bg);
  color: #1c1c1e;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(88px + var(--safe-bottom));
  padding-top: calc(64px + var(--safe-top));
  overflow-x: hidden;
  user-select: none;
}

[data-theme="dark"] body {
  color: #f2f2f7;
}

/* RTL Typography */
[dir="rtl"] {
  font-family: var(--font-ar);
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .ios-chevron {
  transform: rotate(180deg);
}

/* Container */
.ios-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 1024px) {
  .ios-container {
    max-width: 980px;
  }
}

/* iOS Top Navigation Bar */
.ios-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(62px + var(--safe-top));
  padding-top: var(--safe-top);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.12);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 14px;
  padding-right: 14px;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.ios-brand-img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(13, 71, 44, 0.18);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
}

.ios-brand-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.ios-brand-text {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1c1c1e;
}

.ios-brand-sub {
  font-size: 10px;
  color: #c5a059;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

.ios-nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Luxury iOS Hero Card (Unified Cupertino Palette) */
.ios-hero-luxury {
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid rgba(197, 160, 89, 0.25);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
  padding: 22px 18px;
  position: relative;
  overflow: hidden;
  margin-top: 8px;
  margin-bottom: 20px;
}

.ios-hero-luxury::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0d472c 0%, #c5a059 50%, #0d472c 100%);
}

.ios-hero-price-card {
  background: rgba(197, 160, 89, 0.06);
  border: 1px solid rgba(197, 160, 89, 0.28);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 16px 0;
}

.ios-btn-emerald {
  background: linear-gradient(135deg, #0d472c 0%, #15623e 100%);
  color: #ffffff;
  border: none;
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(13, 71, 44, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.ios-btn-emerald:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.ios-btn-luxury-outline {
  background: rgba(118, 118, 128, 0.06);
  color: #1c1c1e;
  border: 1px solid rgba(60, 60, 67, 0.15);
  padding: 13px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-btn-luxury-outline:active {
  background: rgba(118, 118, 128, 0.12);
  transform: scale(0.97);
}

.ios-hero-stat-pill {
  background: rgba(118, 118, 128, 0.04);
  border: 0.5px solid rgba(60, 60, 67, 0.08);
  border-radius: 14px;
  padding: 10px 6px;
  text-align: center;
}

/* iOS Pill Button */
.ios-pill-btn {
  background: rgba(var(--ios-blue-rgb), 0.1);
  color: var(--ios-blue);
  border: none;
  padding: 6px 12px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-pill-btn:active {
  transform: scale(0.95);
  opacity: 0.8;
}

.ios-pill-btn.gold {
  background: linear-gradient(135deg, #c5a059, #997738);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(197, 160, 89, 0.3);
}

.ios-pill-btn.outline {
  background: transparent;
  border: 1px solid var(--ios-border);
  color: inherit;
}

/* iOS Segmented Controls */
.ios-segmented-control {
  display: flex;
  background: rgba(118, 118, 128, 0.12);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  position: relative;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.ios-segmented-control::-webkit-scrollbar {
  display: none;
}

.ios-segment-item {
  flex: 1;
  white-space: nowrap;
  text-align: center;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ios-gray-text);
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-segment-item.active {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .ios-segment-item.active {
  background: #636366;
  color: #ffffff;
}

/* iOS Floating Bottom Tab Bar */
.ios-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(64px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--ios-tab-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 0.5px solid var(--ios-border);
  z-index: 1000;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.ios-tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ios-gray-text);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  height: 100%;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-tab-item:active {
  transform: scale(0.92);
}

.ios-tab-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  position: relative;
}

.ios-tab-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.ios-tab-item.active {
  color: var(--ios-blue);
}

.ios-tab-item.active .ios-tab-label {
  font-weight: 700;
}

/* Highlighting the VIP Offer tab */
.ios-tab-item.vip-tab .ios-tab-icon {
  background: linear-gradient(135deg, #c5a059, #8d6b2c);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(197, 160, 89, 0.4);
  transform: translateY(-8px);
}

.ios-tab-item.vip-tab {
  color: var(--ios-gold);
}

/* iOS Cards */
.ios-card {
  background: var(--ios-card);
  border-radius: var(--ios-radius);
  border: 0.5px solid var(--ios-border);
  box-shadow: var(--ios-shadow);
  overflow: hidden;
  margin-bottom: 20px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.ios-card:hover {
  box-shadow: var(--ios-shadow-lg);
}

.ios-card:active {
  transform: scale(0.99);
}

.ios-card-glass {
  background: var(--ios-card-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Badges */
.ios-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 980px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ios-badge-gold {
  background: rgba(197, 160, 89, 0.15);
  color: #c5a059;
  border: 1px solid rgba(197, 160, 89, 0.3);
}

.ios-badge-blue {
  background: rgba(0, 122, 255, 0.12);
  color: var(--ios-blue);
}

.ios-badge-green {
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
}

/* Developer Scroll Carousel */
.dev-scroll-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 4px 16px 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.dev-scroll-container::-webkit-scrollbar {
  display: none;
}

.dev-card-mini {
  flex: 0 0 140px;
  background: var(--ios-card);
  border: 0.5px solid var(--ios-border);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.dev-card-mini:active {
  transform: scale(0.95);
}

.dev-card-mini.active {
  border-color: var(--ios-gold);
  background: rgba(197, 160, 89, 0.08);
  box-shadow: 0 4px 15px rgba(197, 160, 89, 0.25);
}

.dev-card-mini img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 8px;
  border: 0.5px solid var(--ios-border);
}

/* Multi-Step Wizard Cards (4 Steps) */
.ios-wizard-card {
  background: var(--ios-card);
  border-radius: 24px;
  padding: 24px 20px;
  border: 0.5px solid var(--ios-border);
  box-shadow: var(--ios-shadow-lg);
  position: relative;
  overflow: hidden;
}

.wizard-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}

.progress-bar-step {
  flex: 1;
  height: 5px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 980px;
  transition: background 0.3s ease;
}

[data-theme="dark"] .progress-bar-step {
  background: rgba(255, 255, 255, 0.15);
}

.progress-bar-step.active {
  background: linear-gradient(90deg, #0d472c, #c5a059);
}

/* Streamlined iOS Form Chips (Compact & Low-Text) */
.ios-form-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 16px;
}

.ios-form-chip {
  flex: 1 1 calc(50% - 6px);
  min-width: 120px;
  background: rgba(118, 118, 128, 0.05);
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 14px;
  padding: 10px 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: #1c1c1e;
  user-select: none;
}

.ios-form-chip:active {
  transform: scale(0.96);
}

.ios-form-chip.selected {
  background: rgba(13, 71, 44, 0.08);
  border-color: #0d472c;
  color: #0d472c;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(13, 71, 44, 0.12);
}

.ios-geo-badge {
  background: rgba(13, 71, 44, 0.05);
  border: 1px solid rgba(13, 71, 44, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  color: #0d472c;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

/* Option Cards in Wizard (Studio / 1BR / Purpose / etc) */
.wizard-option-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.wizard-option-card {
  border: 1.5px solid var(--ios-border);
  background: rgba(118, 118, 128, 0.04);
  border-radius: 16px;
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.wizard-option-card:active {
  transform: scale(0.96);
}

.wizard-option-card.selected {
  border-color: var(--ios-blue);
  background: rgba(var(--ios-blue-rgb), 0.08);
  box-shadow: 0 4px 14px rgba(var(--ios-blue-rgb), 0.15);
}

.wizard-option-card.gold-theme.selected {
  border-color: var(--ios-gold);
  background: rgba(197, 160, 89, 0.1);
  box-shadow: 0 4px 14px rgba(197, 160, 89, 0.2);
}

.option-icon {
  font-size: 26px;
}

.option-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.option-hint {
  font-size: 10px;
  color: var(--ios-gray-text);
  font-weight: 500;
}

/* iOS Form Inputs */
.ios-input-group {
  margin-bottom: 14px;
}

.ios-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
  color: var(--ios-gray-text);
}

.ios-input, .ios-select {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  border-radius: 14px;
  border: 1px solid var(--ios-border);
  background: rgba(118, 118, 128, 0.06);
  color: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.ios-input:focus, .ios-select:focus {
  border-color: var(--ios-blue);
  background: var(--ios-card);
  box-shadow: 0 0 0 4px rgba(var(--ios-blue-rgb), 0.15);
}

/* iOS Primary Button */
.ios-btn-primary {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #c5a059 0%, #a27b34 100%);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(197, 160, 89, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(197, 160, 89, 0.2);
}

.ios-btn-secondary {
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 14px;
  border: 1px solid var(--ios-border);
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ios-btn-secondary:active {
  background: rgba(118, 118, 128, 0.1);
}

/* 4-Step Process Section */
.process-step-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: rgba(118, 118, 128, 0.04);
  border-radius: 16px;
  margin-bottom: 10px;
  border: 0.5px solid var(--ios-border);
}

.process-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c5a059, #8d6b2c);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 15px;
  flex-shrink: 0;
}

/* FAQ Collapsible Accordions */
.ios-faq-item {
  border-bottom: 0.5px solid var(--ios-border);
  padding: 14px 0;
}

.ios-faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  gap: 10px;
}

.ios-faq-answer {
  display: none;
  font-size: 13px;
  color: var(--ios-gray-text);
  line-height: 1.5;
  margin-top: 8px;
  padding-right: 10px;
}

[dir="rtl"] .ios-faq-answer {
  padding-right: 0;
  padding-left: 10px;
}

.ios-faq-item.open .ios-faq-answer {
  display: block;
}

.ios-faq-item.open .ios-faq-icon {
  transform: rotate(180deg);
}

.ios-faq-icon {
  transition: transform 0.2s ease;
  font-size: 12px;
  color: var(--ios-gray-text);
}

/* Floating WhatsApp / Action Button */
.floating-action-bar {
  position: fixed;
  bottom: calc(74px + var(--safe-bottom));
  right: 16px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

[dir="rtl"] .floating-action-bar {
  right: auto;
  left: 16px;
}

.floating-circle-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  font-size: 24px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-circle-btn:active {
  transform: scale(0.9);
}

.floating-whatsapp {
  background: #25D366;
}

.floating-phone {
  background: var(--ios-blue);
}

/* Animations */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.anim-slide-up {
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.anim-fade-in {
  animation: fadeIn 0.25s ease forwards;
}

/* Print proposal styles */
@media print {
  .ios-navbar, .ios-tab-bar, .floating-action-bar, .no-print {
    display: none !important;
  }
  body {
    padding: 0;
    background: white;
    color: black;
  }
  .ios-container {
    max-width: 100%;
    padding: 0;
  }
  .ios-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
