/**
 * Modern Premium Theme - Dubai Real Estate
 * طراحی مینیمال و حرفه‌ای - املاک دبی
 * Inspired by Apple, Linear, and premium real estate platforms
 */

/* ============================================
   DESIGN SYSTEM - سیستم طراحی
   ============================================ */

:root {
  /* MODERN COLOR PALETTE - پالت رنگ مدرن */
  
  /* Primary Colors - رنگ‌های اصلی */
  --primary-50: #f5f3ff;
  --primary-100: #ede9fe;
  --primary-200: #ddd6fe;
  --primary-300: #c4b5fd;
  --primary-400: #a78bfa;
  --primary-500: #8b5cf6;
  --primary-600: #667eea;
  --primary-700: #764ba2;
  --primary-800: #6b21a8;
  --primary-900: #581c87;
  
  /* Neutral Colors - رنگ‌های خنثی */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Semantic Colors - رنگ‌های معنایی */
  --success-400: #34d399;
  --success-500: #10b981;
  --success-600: #059669;
  
  --warning-400: #fbbf24;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  
  --error-400: #f87171;
  --error-500: #ef4444;
  --error-600: #dc2626;
  
  --info-400: #60a5fa;
  --info-500: #3b82f6;
  --info-600: #2563eb;
}

/* Light Theme - تم روشن */

/* Dark Theme - تم تیره */
[data-theme="dark"] {
  --background: var(--gray-900);
  --foreground: var(--gray-50);
  --muted: var(--gray-800);
  --muted-foreground: var(--gray-400);
  --border: var(--gray-700);
  --input: var(--gray-800);
  
  --card: var(--gray-800);
  --card-foreground: var(--gray-50);
  
  --primary: var(--primary-500);
  --primary-foreground: #ffffff;
  --primary-hover: var(--primary-400);
  
  --secondary: var(--gray-800);
  --secondary-foreground: var(--gray-50);
  --secondary-hover: var(--gray-700);
  
  --accent: var(--gray-800);
  --accent-foreground: var(--gray-50);
  --accent-color: var(--primary-500);
  
  /* Additional Variables for Components */
  --text-primary: var(--foreground);
  --text-secondary: var(--muted-foreground);
  --border-light: var(--border);
  --primary-color: var(--primary);
  --primary-dark: var(--primary-600);
  
  --destructive: var(--error-500);
  --destructive-foreground: #ffffff;
  
  --ring: var(--primary-400);
  --focus-ring: 0 0 0 2px rgba(239, 68, 68, 0.3);
  
  /* Dark shadows with stronger contrast */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

/* ============================================
   TYPOGRAPHY SYSTEM - سیستم تایپوگرافی
   ============================================ */

/* Enhanced Font Loading */
@font-face {
  font-family: 'SF Pro Display';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: local('SF Pro Display');
}



/* ============================================
   SPACING SYSTEM - سیستم فاصله‌گذاری
   ============================================ */


/* ============================================
   BORDER RADIUS SYSTEM - سیستم گردی
   ============================================ */


/* ============================================
   ANIMATION SYSTEM - سیستم انیمیشن
   ============================================ */


/* ============================================
   GLOBAL STYLES - استایل‌های عمومی
   ============================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

html {
  box-sizing: border-box;
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--foreground);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 30%, #ffffff 60%, #ffffff 100%);
  background-attachment: fixed;
  min-height: 100vh;
  direction: rtl;
  text-align: right;
  
  /* Enhanced font rendering */
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Smooth transitions */
  transition: color var(--duration-200) var(--ease-out), 
              background var(--duration-300) var(--ease-out);
}

/* Dark mode background */
[data-theme="dark"] body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #1f2937 100%);
  background-attachment: fixed;
}

/* Selection styles */
::selection {
  background-color: rgba(220, 38, 38, 0.15);
  color: var(--primary-700);
}

/* Focus styles */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Remove focus outline for mouse users */
.js-focus-visible :focus:not(.focus-visible) {
  outline: none;
}

/* ============================================
   UTILITY CLASSES - کلاس‌های کاربردی
   ============================================ */

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Container System */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--spacing-4);
}

/* Responsive containers */
@media (min-width: 640px) {
  .container {
    max-width: 640px;
    padding: 0 var(--spacing-6);
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
    padding: 0 var(--spacing-8);
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

@media (min-width: 1536px) {
  .container {
    max-width: 1400px;
  }
}

/* Flex utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: var(--spacing-2);
}

.gap-4 {
  gap: var(--spacing-4);
}

.gap-6 {
  gap: var(--spacing-6);
}

/* Text utilities */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

/* Spacing utilities */
.mt-auto {
  margin-top: auto;
}

.mb-auto {
  margin-bottom: auto;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* Border utilities */
.rounded {
  border-radius: var(--radius);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-xl {
  border-radius: var(--radius-xl);
}

.rounded-full {
  border-radius: var(--radius-full);
}

/* Shadow utilities */
.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow {
  box-shadow: var(--shadow);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

.shadow-xl {
  box-shadow: var(--shadow-xl);
}

/* Transition utilities */
.transition {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
  transition-timing-function: var(--ease-in-out);
  transition-duration: var(--duration-150);
}

.transition-all {
  transition-property: all;
  transition-timing-function: var(--ease-in-out);
  transition-duration: var(--duration-150);
}

.transition-colors {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: var(--ease-in-out);
  transition-duration: var(--duration-150);
}

.transition-transform {
  transition-property: transform;
  transition-timing-function: var(--ease-in-out);
  transition-duration: var(--duration-150);
}

/* Hover effects */
.hover\:scale-105:hover {
  transform: scale(1.05);
}

.hover\:scale-110:hover {
  transform: scale(1.1);
}

.hover\:-translate-y-1:hover {
  transform: translateY(-0.25rem);
}

.hover\:-translate-y-2:hover {
  transform: translateY(-0.5rem);
}

/* Group hover effects */
.group:hover .group-hover\:scale-105 {
  transform: scale(1.05);
}

.group:hover .group-hover\:-translate-y-1 {
  transform: translateY(-0.25rem);
}

/* ============================================
   KEYFRAME ANIMATIONS - انیمیشن‌های کی‌فریم
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(-25%);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: none;
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

/* Animation classes */
.animate-fadeIn {
  animation: fadeIn var(--duration-500) var(--ease-out);
}

.animate-fadeInUp {
  animation: fadeInUp var(--duration-500) var(--ease-out);
}

.animate-fadeInDown {
  animation: fadeInDown var(--duration-500) var(--ease-out);
}

.animate-slideInRight {
  animation: slideInRight var(--duration-500) var(--ease-out);
}

.animate-slideInLeft {
  animation: slideInLeft var(--duration-500) var(--ease-out);
}

.animate-scaleIn {
  animation: scaleIn var(--duration-300) var(--ease-out);
}

.animate-pulse {
  animation: pulse 2s var(--ease-in-out) infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

/* Stagger animation delays */
.animate-delay-75 {
  animation-delay: var(--duration-75);
}

.animate-delay-100 {
  animation-delay: var(--duration-100);
}

.animate-delay-150 {
  animation-delay: var(--duration-150);
}

.animate-delay-200 {
  animation-delay: var(--duration-200);
}

.animate-delay-300 {
  animation-delay: var(--duration-300);
}

.animate-delay-500 {
  animation-delay: var(--duration-500);
}