@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@300;400;500;600;700&family=Noto+Sans+Arabic:wght@300;400;500;600;700&display=swap');

:root {
  /* Color Palette */
  --primary-black: #000000;
  --secondary-black: #1a1a1a;
  --tertiary-black: #333333;
  --logo-champagne: #c4a57b;
  --logo-light: #d4c4a8;
  --logo-dark: #b8956f;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #999999;
  
  /* Typography */
  font-family: 'Inter', 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Base styles */
  line-height: 1.6;
  font-weight: 400;
  color: var(--text-primary);
  background-color: var(--primary-black);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--primary-black);
  color: var(--text-primary);
  scroll-behavior: smooth;
}

#root {
  margin: 0;
  min-height: 100vh;
  background-color: var(--primary-black);
}

/* Custom scrollbar */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--secondary-black);
}

::-webkit-scrollbar-thumb {
  background: var(--logo-champagne);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--logo-light);
}

/* Selection styles */

::selection {
  background-color: var(--logo-champagne);
  color: var(--primary-black);
}

::-moz-selection {
  background-color: var(--logo-champagne);
  color: var(--primary-black);
}

/* Focus styles for accessibility */

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--logo-champagne);
  outline-offset: 2px;
}

/* Enhanced smooth transitions for interactive elements */

a, button {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Enhanced hover effects for links */

a {
  position: relative;
}

a:hover {
  transform: translateY(-1px);
}

/* Smooth scroll behavior */

html {
  scroll-behavior: smooth;
}

/* Enhanced scroll animations */

@keyframes slideInUpLarge {
  from {
    opacity: 0;
    transform: translateY(60px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0px);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
    filter: blur(1px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0px);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(196, 165, 123, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(196, 165, 123, 0.6), 0 0 30px rgba(196, 165, 123, 0.4);
  }
}

/* Enhanced focus styles with animation */

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--logo-champagne);
  outline-offset: 2px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% {
    outline-color: var(--logo-champagne);
  }
  50% {
    outline-color: var(--logo-light);
  }
}

/* Link styles */

a {
  color: var(--logo-champagne);
  text-decoration: none;
}

a:hover {
  color: var(--logo-light);
}

/* Ensure proper contrast for form elements */

input, textarea, select {
  background-color: var(--secondary-black);
  color: var(--text-primary);
  border: 1px solid var(--tertiary-black);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--logo-champagne);
  outline: none;
}

/* Enhanced animations */

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

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.slide-in-up {
  animation: slideInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-in-left {
  animation: slideInLeft 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-in-right {
  animation: slideInRight 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Utility classes */

.text-gradient {
  background: linear-gradient(135deg, var(--logo-champagne) 0%, var(--logo-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shimmer-text {
  position: relative;
  overflow: hidden;
}

.shimmer-text::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(196, 165, 123, 0.4), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Enhanced gradient animations */

.animated-gradient {
  background: linear-gradient(45deg, var(--logo-champagne), var(--logo-light), var(--logo-champagne));
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Mobile-first responsive utilities */

@media (max-width: 599px) {
  .MuiContainer-root {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  
  .MuiTypography-h1 {
    word-break: break-word;
    hyphens: auto;
  }
  
  .MuiCard-root {
    margin-bottom: 16px;
  }
}

@media (max-width: 899px) {
  .MuiStack-root[data-direction="row"] {
    flex-direction: column !important;
    gap: 16px !important;
  }
}

/* Prevent horizontal overflow */

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

#root {
  overflow-x: hidden;
  max-width: 100vw;
}

/* RTL Support */

[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .MuiStack-root {
  flex-direction: row-reverse;
}

[dir="rtl"] .MuiButton-root {
  flex-direction: row-reverse;
}

/* Arabic font optimization */

html[lang="ar"] {
  font-family: 'Noto Sans Arabic', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html[lang="ar"] * {
  font-family: 'Noto Sans Arabic', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}