/* ==========================================================================
   ALM.care Design System & Global Styles
   Brand: ALM.care ("Because We Care.")
   Luxury UAE Marketplace Aesthetic: Gold & Obsidian Dark
   ========================================================================== */

:root {
  /* Color Palette - Luxury Gold */
  --gold-primary: #E5A93C;
  --gold-light: #FFD480;
  --gold-bright: #FFC857;
  --gold-dark: #B37D1E;
  --gold-glow: rgba(229, 169, 60, 0.28);
  --gold-gradient: linear-gradient(135deg, #FFE194 0%, #FFC857 30%, #E5A93C 70%, #B37D1E 100%);
  --gold-surface: rgba(229, 169, 60, 0.08);

  /* Surfaces & Darks */
  --bg-main: #080B11;
  --bg-surface: #0E1522;
  --bg-surface-elevated: #151F32;
  --bg-surface-hover: #1C2A44;
  --bg-input: #111A2B;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(229, 169, 60, 0.35);
  --border-gold-strong: #E5A93C;

  /* Typography */
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --text-gold: #FFC857;

  /* Accents */
  --emerald-verified: #10B981;
  --emerald-surface: rgba(16, 185, 129, 0.2);
  --whatsapp-green: #25D366;
  --whatsapp-surface: rgba(37, 211, 102, 0.2);
  --urgent-red: #EF4444;
  --urgent-surface: rgba(239, 68, 68, 0.2);
  --blue-badge: #3B82F6;

  /* Elevation Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-gold: 0 0 25px rgba(229, 169, 60, 0.25);
  --shadow-gold-lg: 0 0 40px rgba(229, 169, 60, 0.35);

  /* Layout & Sizing */
  --container-max: 1320px;
  --header-height: 74px;
  --bottom-nav-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #1E293B;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dark);
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

p {
  color: var(--text-secondary);
}

img {
  max-width: 100%;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  border: none;
  outline: none;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* App Main Wrapper */
#app-root {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding-top: var(--header-height);
  padding-bottom: 60px;
}

@media (max-width: 768px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }
  .main-content {
    padding-top: 62px;
    padding-bottom: calc(var(--bottom-nav-height) + 40px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }
}


/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background: var(--gold-gradient);
  color: #080B11;
  box-shadow: var(--shadow-gold);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold-lg);
  filter: brightness(1.05);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-gold);
  color: var(--gold-bright);
}

.btn-gold-outline {
  background: transparent;
  color: var(--gold-bright);
  border: 1.5px solid var(--gold-primary);
}
.btn-gold-outline:hover {
  background: var(--gold-surface);
  border-color: var(--gold-bright);
  color: #FFF;
}

.btn-whatsapp {
  background: var(--whatsapp-green);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}
.btn-whatsapp:hover {
  background: #20BA5A;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}

.btn-danger {
  background: var(--urgent-surface);
  color: var(--urgent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: var(--urgent-red);
  color: #FFF;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-featured {
  background: var(--gold-gradient);
  color: #080B11;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(229, 169, 60, 0.45);
}

.badge-urgent {
  background: rgba(239, 68, 68, 0.22);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.55);
  font-weight: 800;
}

.badge-verified {
  background: rgba(16, 185, 129, 0.22);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.55);
  font-weight: 800;
}

.badge-gold-shield {
  background: rgba(229, 169, 60, 0.22);
  color: #FFD480;
  border: 1px solid rgba(229, 169, 60, 0.55);
  font-weight: 800;
}

.badge-business {
  background: rgba(59, 130, 246, 0.22);
  color: #93C5FD;
  border: 1px solid rgba(59, 130, 246, 0.55);
  font-weight: 800;
}

/* Cards Base */
.alm-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
}
.alm-card:hover {
  border-color: rgba(229, 169, 60, 0.4);
  box-shadow: var(--shadow-md);
}

/* Form Inputs */
.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(229, 169, 60, 0.15);
  background: var(--bg-surface-elevated);
}

.form-textarea {
  resize: vertical;
  min-height: 110px;
}

/* Price Display */
.price-aed {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold-bright);
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.price-aed .currency {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

/* Toast Container */
#toast-container {
  position: fixed;
  top: 85px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 420px;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.toast.success { border-color: var(--emerald-verified); }
.toast.error { border-color: var(--urgent-red); }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 12, 0.82);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-gold-lg);
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}
.modal-overlay.active .modal-box {
  transform: scale(1);
}
.modal-header {
  padding: 22px 26px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body {
  padding: 26px;
}
.modal-footer {
  padding: 18px 26px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
