/* ==========================================================================
   SPENCER & PARTNERS RABAT — Luxury Real Estate & Investment Advisory
   Design System: "Crimson Signature & Royal Obsidian" (Matching Official Logo)
   Brand Red: #E71B23 | Midnight Obsidian: #0A0F1D | Canvas: #F8FAFC
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Cairo:wght@300;400;500;600;700;800&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Official Brand Colors */
  --color-primary: #0A0F1D;
  --color-primary-light: #141B2D;
  --color-primary-surface: #1E293B;
  
  /* Signature Brand Red from logo.png */
  --color-brand-red: #E71B23;
  --color-brand-red-hover: #C8141B;
  --color-brand-red-light: #FEE2E2;
  --color-brand-red-muted: rgba(231, 27, 35, 0.12);
  
  /* Canvas & Neutral Palette */
  --color-canvas: #F8FAFC;
  --color-canvas-alt: #F1F5F9;
  --color-card-bg: #FFFFFF;
  --color-text-main: #0F172A;
  --color-text-muted: #64748B;
  --color-text-light: #94A3B8;
  --color-border: #E2E8F0;
  --color-border-subtle: #F1F5F9;

  /* Typography */
  --font-serif: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-arabic-heading: 'Cairo', 'Plus Jakarta Sans', sans-serif;
  --font-arabic-body: 'Cairo', 'Amiri', Tahoma, sans-serif;

  /* Layout & Motion */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-subtle: 0 4px 20px -2px rgba(10, 15, 29, 0.05);
  --shadow-card: 0 10px 30px -4px rgba(10, 15, 29, 0.08);
  --shadow-luxury: 0 20px 40px -6px rgba(10, 15, 29, 0.12), 0 0 20px rgba(231, 27, 35, 0.15);
  --transition-luxury: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-canvas);
  color: var(--color-text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

/* RTL Specific Rules for Arabic */
html[dir="rtl"] body {
  font-family: var(--font-arabic-body);
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] .font-serif,
html[dir="rtl"] .brand-font {
  font-family: var(--font-arabic-heading) !important;
  font-weight: 700;
  letter-spacing: 0 !important;
}

/* Utility Font Classes */
.font-serif {
  font-family: var(--font-serif);
}

.font-sans {
  font-family: var(--font-sans);
}

/* Brand Color Utilities */
.text-brand-red {
  color: var(--color-brand-red);
}

.bg-brand-red {
  background-color: var(--color-brand-red);
}

.border-brand-red {
  border-color: var(--color-brand-red);
}

.bg-obsidian {
  background-color: var(--color-primary);
}

.bg-obsidian-light {
  background-color: var(--color-primary-light);
}

.border-subtle {
  border-color: var(--color-border);
}

/* Glassmorphic Navbar & Cards */
.glass-obsidian {
  background: rgba(10, 15, 29, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(231, 27, 35, 0.2);
}

.glass-card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.glass-card-dark {
  background: rgba(20, 27, 45, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(231, 27, 35, 0.25);
}

/* Navigation Links */
.nav-link {
  position: relative;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #E2E8F0;
  transition: var(--transition-luxury);
  white-space: nowrap;
  padding: 0.5rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-brand-red), transparent);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover {
  color: #FFFFFF;
}

.nav-link:hover::after {
  width: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-canvas);
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-brand-red);
}

/* Buttons */
.btn-luxury {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-sm);
  transition: var(--transition-luxury);
  cursor: pointer;
  text-decoration: none;
}

.btn-brand-red {
  background: linear-gradient(135deg, var(--color-brand-red) 0%, #B91C1C 100%);
  color: #FFFFFF;
  border: 1px solid var(--color-brand-red);
  box-shadow: 0 4px 15px rgba(231, 27, 35, 0.25);
}
.btn-brand-red:hover {
  background: linear-gradient(135deg, #FF2E38 0%, var(--color-brand-red) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(231, 27, 35, 0.45);
}

.btn-outline-red {
  background: transparent;
  color: var(--color-brand-red);
  border: 1px solid var(--color-brand-red);
}
.btn-outline-red:hover {
  background: var(--color-brand-red);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(231, 27, 35, 0.3);
}

.btn-outline-white {
  background: transparent;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.btn-outline-white:hover {
  background: #FFFFFF;
  color: #0A0F1D;
  border-color: #FFFFFF;
  transform: translateY(-2px);
}

/* Animations & Micro-Interactions */
.animate-fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.animate-fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.property-card {
  transition: var(--transition-luxury);
  border: 1px solid var(--color-border);
  background-color: var(--color-card-bg);
}
.property-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-luxury);
  border-color: var(--color-brand-red);
}

.property-image-wrapper {
  overflow: hidden;
  position: relative;
}
.property-image-wrapper img {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.property-card:hover .property-image-wrapper img {
  transform: scale(1.06);
}

/* RTL Icon and Flex Flips */
html[dir="rtl"] .rtl-flip {
  transform: scaleX(-1);
}

/* Red Brand Signature Accent Line */
.brand-line {
  height: 2px;
  width: 54px;
  background: linear-gradient(90deg, var(--color-brand-red), transparent);
}
html[dir="rtl"] .brand-line {
  background: linear-gradient(-90deg, var(--color-brand-red), transparent);
}

/* Interactive Currency Selector */
.currency-pill {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-luxury);
}
.currency-pill.active {
  background-color: var(--color-brand-red);
  color: #FFFFFF;
}
.currency-pill:not(.active) {
  background-color: rgba(255, 255, 255, 0.08);
  color: #94A3B8;
}
.currency-pill:not(.active):hover {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.18);
}

/* Modal Backdrop */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  max-width: 900px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}
