/* ==========================================================================
   فال و شال (Fal w Shal) - Core Design & Theme System (Light & Dark)
   Aesthetic: Luxury, Minimalist, Earthy Sudanese Heritage, Animated Fluidity
   ========================================================================== */

/* Define Global Constants and Theme Variables */
:root {
  --color-sand: #F0F5F8; /* Pale elegant light-blue-tinted sand */
  --color-alabaster: #FFFDFB;
  --color-terracotta: #2CFFDB; /* Vibrant Brand Turquoise/Teal in dark mode */
  --color-terracotta-hover: #1DDFBE;
  --color-gold: #2CFFDB; /* Primary Accent matches vibrant turquoise in dark mode */
  --color-gold-bright: #5BFFE3;
  --color-charcoal: #030D1C; /* Luxurious deep Midnight Navy */
  --color-charcoal-light: #06152B; /* Slightly lighter luxurious dark navy for cards */
  --color-henna: #010610; /* Ultra deep dark navy black */
  --color-text-dark: #021D4C; /* Deep Brand Navy for maximum readability in light mode */
  --color-text-light: #E0EDF6; /* Soft blue-tinted white for dark mode */
  
  --font-serif: 'Cormorant Garamond', 'Amiri', serif;
  --font-sans: 'Alexandria', 'Tajawal', sans-serif;
  --font-display: 'El Messiri', cursive;
  
  --transition-luxury: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Dark Theme Variables (Default) */
body, body.dark {
  --bg-color: var(--color-charcoal);
  --bg-card: rgba(10, 30, 62, 0.45); /* Elegant translucent midnight blue glassmorphism */
  --text-main: var(--color-text-light);
  --border-card: rgba(44, 255, 219, 0.12); /* Vibrant brand cyan border */
  --border-card-hover: rgba(44, 255, 219, 0.35);
  
  --orb-opacity: 0.22; /* Breathtaking animated ambient glows */
  --noise-opacity: 0.02;
  --svg-opacity: 0.15;
  --text-shadow-glow: rgba(44, 255, 219, 0.25);
  
  --color-accent-gold: var(--color-gold-bright);
}

/* Light Theme Variables */
body.light {
  --bg-color: var(--color-sand);
  --bg-card: rgba(255, 255, 255, 0.75); /* Clean dynamic white glass */
  --text-main: var(--color-text-dark);
  --border-card: rgba(2, 29, 76, 0.14); /* Refined navy border */
  --border-card-hover: rgba(2, 29, 76, 0.35);
  
  --orb-opacity: 0.08;
  --noise-opacity: 0.038;
  --svg-opacity: 0.24;
  --text-shadow-glow: rgba(2, 29, 76, 0.08);
  
  --color-accent-gold: var(--color-text-dark); /* Contrast-accurate primary brand navy */
}

/* Transition background and colors during theme swaps */
body {
  transition: background-color 0.8s cubic-bezier(0.16, 1, 0.3, 1), color 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
  transition: background-color 0.8s ease;
}
::-webkit-scrollbar-thumb {
  background: var(--border-card-hover);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-terracotta);
}

/* Custom Selection Highlight */
::selection {
  background: var(--color-terracotta);
  color: var(--color-alabaster);
}

/* Base Body & HTML Configuration */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   LOGO DISPLAY LOGIC (INVERTED TO MATCH NAMING CONVENTIONS)
   ========================================================================== */
.logo-light-theme,
.logo-dark-theme {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* logo_dark_theme.svg: contains white text -> use in Dark Mode */
body.dark .logo-light-theme {
  display: none !important;
}
body.dark .logo-dark-theme {
  display: block !important;
}

/* logo_light_theme.svg: contains dark text -> use in Light Mode */
body.light .logo-light-theme {
  display: block !important;
}
body.light .logo-dark-theme {
  display: none !important;
}

/* ==========================================================================
   LUXURY INTERACTIVE CURSOR
   ========================================================================== */
/* By default, hide custom cursor elements to prevent any layout interference on mobile and touch screens */
.custom-cursor-dot,
.custom-cursor-outline {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  body {
    cursor: none;
  }
  a, button, input, select, textarea, [role="button"], .theme-toggle-btn {
    cursor: none;
  }
  
  .custom-cursor-dot {
    display: block;
    width: 6px;
    height: 6px;
    background-color: var(--color-terracotta);
    border-radius: 50%;
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease;
  }
  
  .custom-cursor-outline {
    display: block;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-card-hover);
    border-radius: 50%;
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9998;
    transition: border 0.3s ease, width 0.3s ease, height 0.3s ease, background-color 0.3s ease;
  }
  
  /* Cursor States */
  .custom-cursor-outline.hovered {
    width: 60px;
    height: 60px;
    background-color: var(--bg-card);
    border-color: var(--color-accent-gold);
  }
  .custom-cursor-dot.hovered {
    width: 10px;
    height: 10px;
    background-color: var(--color-terracotta);
  }
  
  .custom-cursor-outline.focus-input {
    width: 50px;
    height: 50px;
    border-style: dashed;
    border-color: var(--color-accent-gold);
    animation: rotateCursor 10s linear infinite;
  }
  
  .custom-cursor-outline.clicked {
    width: 30px;
    height: 30px;
    background-color: var(--border-card-hover);
    border-color: var(--color-terracotta);
  }
}

@keyframes rotateCursor {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ==========================================================================
   BACKGROUND & TEXTURES
   ========================================================================== */
.bg-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: var(--orb-opacity);
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: screen;
  will-change: transform;
  transition: opacity 0.8s ease;
}

body.light .bg-glow-orb {
  mix-blend-mode: multiply;
}

.orb-terracotta {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--color-terracotta) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  animation: floatOrb1 25s ease-in-out infinite alternate;
}

.orb-gold {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--color-gold) 0%, transparent 70%);
  bottom: -200px;
  left: -200px;
  animation: floatOrb2 30s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-80px, 80px) scale(1.15); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(100px, -60px) scale(0.9); }
}

.grain-overlay {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 10;
  opacity: var(--noise-opacity);
  transition: opacity 0.8s ease;
}

/* ==========================================================================
   TYPOGRAPHY & INPUTS
   ========================================================================== */
.text-luxury-headline {
  font-family: var(--font-display);
  background: linear-gradient(135deg, var(--text-main) 30%, var(--color-accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.4;
}

.brand-description {
  color: var(--text-main);
  opacity: 0.75;
  transition: var(--transition-luxury);
}

.brand-copyright {
  color: var(--text-main);
  opacity: 0.45;
  transition: var(--transition-luxury);
}

.premium-input-wrapper {
  position: relative;
}

.premium-input {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-card) !important;
  color: var(--text-main) !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.premium-input:focus {
  outline: none !important;
  border-color: var(--color-accent-gold) !important;
  box-shadow: 0 0 25px var(--text-shadow-glow);
}

.premium-input::placeholder {
  color: rgba(255, 253, 251, 0.3) !important;
}

body.light .premium-input::placeholder {
  color: rgba(46, 34, 27, 0.45) !important;
}

.premium-input-line {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent-gold), transparent);
  transition: var(--transition-luxury);
  transform: translateX(-50%);
}

.premium-input:focus ~ .premium-input-line {
  width: 100%;
}

/* Premium Button - High End Luxury Redesign */
.premium-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-family: var(--font-sans);
  outline: none;
}

/* Dark Theme Premium Button */
body.dark .premium-btn {
  background: linear-gradient(135deg, var(--color-terracotta) 0%, var(--color-gold-bright) 100%);
  color: var(--color-charcoal) !important;
  box-shadow: 0 8px 24px rgba(44, 255, 219, 0.2);
  border-color: rgba(44, 255, 219, 0.3);
}

body.dark .premium-btn .btn-arrow-icon {
  stroke: var(--color-charcoal);
}

body.dark .premium-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 32px rgba(44, 255, 219, 0.45);
  border-color: var(--color-gold-bright);
  background: linear-gradient(135deg, var(--color-gold-bright) 0%, var(--color-terracotta) 100%);
}

/* Light Theme Premium Button */
body.light .premium-btn {
  background: var(--color-text-dark);
  color: var(--color-alabaster) !important;
  box-shadow: 0 8px 24px rgba(2, 29, 76, 0.15);
  border-color: rgba(2, 29, 76, 0.1);
}

body.light .premium-btn .btn-arrow-icon {
  stroke: var(--color-alabaster);
}

body.light .premium-btn:hover {
  transform: translateY(-2px) scale(1.02);
  background: var(--color-charcoal);
  box-shadow: 0 12px 32px rgba(2, 29, 76, 0.25);
  border-color: var(--color-text-dark);
}

/* Common Interactive & Shine Effects */
.premium-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.25),
    transparent
  );
  transition: 0.5s;
}

body.dark .premium-btn::before {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
}

.premium-btn:hover::before {
  left: 100%;
  transition: 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.premium-btn:active {
  transform: translateY(1px) scale(0.98);
}

/* Arrow Slide Micro-interaction (RTL directional) */
.premium-btn .btn-arrow-icon {
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.premium-btn:hover .btn-arrow-icon {
  transform: translateX(-5px);
}

/* ==========================================================================
   HERITAGE IMAGE CARD
   ========================================================================== */
.heritage-card-container {
  perspective: 1000px;
}

.heritage-card {
  position: relative;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.8s ease, border-color 0.8s ease;
  transform-style: preserve-3d;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.heritage-card:hover {
  transform: rotateY(5deg) rotateX(2deg) translateY(-8px);
  border-color: var(--border-card-hover);
}

.heritage-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, var(--border-card-hover), transparent 50%, var(--border-card));
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
}

.heritage-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(3, 13, 28, 0.6) 0%, transparent 60%);
  z-index: 10;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

body.light .heritage-card-overlay {
  background: linear-gradient(to top, rgba(240, 245, 248, 0.8) 0%, transparent 65%);
}

.heritage-card:hover .heritage-card-overlay {
  opacity: 0.45;
}

.heritage-card-tag {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 20;
  background-color: rgba(6, 21, 43, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(44, 255, 219, 0.2);
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.heritage-card-tag .tag-dot {
  display: inline-block;
  height: 8px;
  width: 8px;
  border-radius: 50%;
  background-color: var(--color-terracotta);
  animation: tagPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.heritage-card-tag .tag-text {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--color-accent-gold);
  font-weight: 300;
}

body.light .heritage-card-tag {
  background-color: rgba(255, 255, 255, 0.85);
  border-color: rgba(2, 29, 76, 0.15);
  box-shadow: 0 10px 25px rgba(2, 29, 76, 0.05);
}

body.light .heritage-card-tag .tag-dot {
  background-color: var(--color-text-dark);
  animation: none;
}

body.light .heritage-card-tag .tag-text {
  color: var(--color-text-dark);
}

@keyframes tagPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(1.15); }
}

/* ==========================================================================
   TRANSITIONS & REVEALS
   ========================================================================== */
.reveal-staggered {
  opacity: 0;
  transform: translateY(30px);
  animation: revealUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.reveal-staggered:nth-child(1) { animation-delay: 0.1s; }
.reveal-staggered:nth-child(2) { animation-delay: 0.25s; }
.reveal-staggered:nth-child(3) { animation-delay: 0.4s; }
.reveal-staggered:nth-child(4) { animation-delay: 0.55s; }
.reveal-staggered:nth-child(5) { animation-delay: 0.7s; }
.reveal-staggered:nth-child(6) { animation-delay: 0.85s; }

@keyframes revealUp {
  0% {
    opacity: 0;
    transform: translateY(35px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.organic-drift {
  animation: organicDrift 8s ease-in-out infinite alternate;
}

@keyframes organicDrift {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(0.5deg); }
  100% { transform: translateY(4px) rotate(-0.5deg); }
}

/* Countdown Visual Styling */
.countdown-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  min-width: 60px; /* Reduced min-width to prevent horizontal overflow on small mobile screens */
  position: relative;
  overflow: hidden;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.8s ease, border-color 0.8s ease;
}

@media (min-width: 768px) {
  .countdown-box {
    min-width: 75px; /* Restored size on tablet/desktop views */
  }
}

.countdown-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-card-hover), transparent);
}

.countdown-box:hover {
  border-color: var(--border-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px var(--text-shadow-glow);
}

.countdown-value {
  font-family: var(--font-serif);
  font-weight: 300;
  color: var(--color-accent-gold);
  text-shadow: 0 0 10px var(--text-shadow-glow);
  transition: color 0.8s ease;
}

.countdown-label {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-main);
  opacity: 0.65;
  font-weight: 300;
}

/* ==========================================================================
   FOOTER GLASS CIRCLES & SOCIALS (DELICATE MICRO SCALING)
   ========================================================================== */
.social-glass-circle {
  height: 34px;
  width: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-card);
  background-color: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent-gold);
  transition: var(--transition-luxury);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.social-glass-circle:hover {
  background-color: var(--color-terracotta);
  border-color: var(--color-terracotta);
  color: var(--color-alabaster) !important;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 15px var(--text-shadow-glow);
}

.social-glass-circle svg {
  height: 16px;
  width: 16px;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.social-glass-circle:hover svg {
  transform: scale(1.12);
}

/* Premium Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--color-accent-gold);
  border-radius: 12px;
  padding: 16px 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25), 0 0 20px var(--border-card-hover);
  z-index: 10000;
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
  pointer-events: none;
  color: var(--text-main);
}

/* Custom Interactive SVG Background Waves (Heritage lines) */
.heritage-lines-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden; /* Prevent overflowing paths with negative coordinates from triggering horizontal scrolling */
  z-index: 1;
  pointer-events: none;
  opacity: var(--svg-opacity);
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  animation: drawLines 10s ease-in-out forwards;
  transition: opacity 0.8s ease;
}

@keyframes drawLines {
  to {
    stroke-dashoffset: 0;
  }
}

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

.luxury-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(
    90deg,
    rgba(255, 253, 251, 0) 0%,
    rgba(255, 253, 251, 0.03) 20%,
    rgba(255, 253, 251, 0.08) 60%,
    rgba(255, 253, 251, 0) 100%
  );
  animation: shimmer 5s infinite;
}

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

/* System Control Controls */
.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--color-accent-gold);
  transition: var(--transition-luxury);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.theme-toggle-btn:hover {
  border-color: var(--color-accent-gold);
  background-color: var(--border-card);
  transform: scale(1.05);
}

/* Theme Switch Animations */
.theme-icon-sun {
  transition: transform 0.5s ease, opacity 0.5s ease;
}
.theme-icon-moon {
  transition: transform 0.5s ease, opacity 0.5s ease;
}

body.light .theme-icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0);
  position: absolute;
}
body.light .theme-icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

body.dark .theme-icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}
body.dark .theme-icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
  position: absolute;
}

/* Audio Switch Animations (Removed) */

/* Responsive Overrides */
@media (max-width: 768px) {
  .orb-terracotta {
    width: 300px;
    height: 300px;
  }
  .orb-gold {
    width: 350px;
    height: 350px;
  }
  .reveal-staggered {
    animation-duration: 0.9s;
  }
}
