/* ============================================================
   Studio Basma — Custom Luxury Styles
   Premium Agency Website Stylesheet
   ============================================================ */

/* ─────────────────────────────────────────
   CSS Custom Properties
   ───────────────────────────────────────── */
:root {
  --color-primary: #0D0F12;
  --color-primary-light: #1A1D23;
  --color-secondary: #F5F0EB;
  --color-accent: #C5A880;
  --color-accent-hover: #D4AF37;
  --color-dark: #1A1A1A;
  --color-white: #FFFFFF;
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Inter', sans-serif;
  --font-arabic: 'Tajawal', sans-serif;
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─────────────────────────────────────────
   Base & Reset
   ───────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Arabic font applied when lang is AR */
html[lang="ar"] body {
  font-family: var(--font-arabic);
}

html[lang="fr"] body,
html[lang="en"] body {
  font-family: var(--font-sans);
}

/* Serif headings */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4 {
  font-family: var(--font-arabic);
  font-weight: 800;
}

::selection {
  background-color: var(--color-accent);
  color: var(--color-primary);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-hover);
}

/* ─────────────────────────────────────────
   Navigation
   ───────────────────────────────────────── */
#navbar {
  background: transparent;
}

#navbar.scrolled {
  background: rgba(13, 15, 18, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
  position: relative;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  padding: 0.5rem 0;
  transition: color 0.3s ease;
  text-decoration: none;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.3s var(--transition-smooth);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-white);
}

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

/* Language dropdown open state */
#langDropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#langDropdown {
  transform: translateY(-8px);
}

#langChevron.open {
  transform: rotate(180deg);
}

/* Mobile menu open state */
#mobileMenu.open {
  opacity: 1;
  visibility: visible;
}

/* Hamburger animation */
.hamburger-active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger-active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-active .hamburger-line:nth-child(3) {
  width: 1.5rem;
  transform: translateY(-8px) rotate(-45deg);
}

/* ─────────────────────────────────────────
   Hero Section
   ───────────────────────────────────────── */
.hero-gradient {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(197, 168, 128, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(197, 168, 128, 0.04) 0%, transparent 50%),
    linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-light) 50%, var(--color-primary) 100%);
}

/* Hero Content Smooth Entry (Pure CSS - Independent of JS) */
@keyframes heroFadeInUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-fade-in {
  opacity: 0;
  animation: heroFadeInUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: opacity, transform;
}

/* Floating animations */
.floating-slow {
  animation: float 8s ease-in-out infinite;
}

.floating-medium {
  animation: float 6s ease-in-out infinite;
  animation-delay: -3s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

/* Icon direction flip for LTR */
html[dir="ltr"] .rtl-flip-icon {
  transform: scaleX(-1);
}

html[dir="ltr"] .group:hover .rtl-flip-icon {
  transform: scaleX(-1) translateX(-4px);
}

/* ─────────────────────────────────────────
   Service Cards
   ───────────────────────────────────────── */
.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(197, 168, 128, 0.05) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.service-card:hover::before {
  opacity: 1;
}

.service-card::after {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
  border-radius: 1rem 1rem 0 0;
  transition: width 0.5s var(--transition-smooth);
}

.service-card:hover::after {
  width: 100%;
}

/* ─────────────────────────────────────────
   Portfolio Section
   ───────────────────────────────────────── */
.filter-btn {
  background: transparent;
  color: var(--color-dark);
  border: 1px solid rgba(26, 26, 26, 0.15);
  cursor: pointer;
}

.filter-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.filter-btn.active {
  background: var(--color-accent);
  color: var(--color-primary);
  border-color: var(--color-accent);
}

/* Portfolio Gradient Placeholders */
.portfolio-gradient-1 {
  background: linear-gradient(135deg, #2c1810 0%, #4a2c17 30%, #1a1a2e 70%, #0d0f12 100%);
}

.portfolio-gradient-2 {
  background: linear-gradient(135deg, #0d0f12 0%, #1a1d23 30%, #2d1b4e 70%, #1a0a2e 100%);
}

.portfolio-gradient-3 {
  background: linear-gradient(135deg, #1a2332 0%, #0d2137 30%, #1a3a4a 70%, #0d1f2d 100%);
}

.portfolio-gradient-4 {
  background: linear-gradient(135deg, #2a1f14 0%, #3d2e1f 30%, #1f1a14 70%, #0d0f12 100%);
}

.portfolio-gradient-5 {
  background: linear-gradient(135deg, #0f1a0f 0%, #1a2d1a 30%, #0d1f1a 70%, #0d0f12 100%);
}

.portfolio-gradient-6 {
  background: linear-gradient(135deg, #1a1428 0%, #2d1f3d 30%, #1f1432 70%, #0d0f12 100%);
}

/* Portfolio item transitions for filtering */
.portfolio-item {
  transition: all 0.5s var(--transition-smooth);
}

.portfolio-item.hidden-item {
  opacity: 0;
  transform: scale(0.8);
  position: absolute;
  pointer-events: none;
}

.portfolio-item.visible-item {
  opacity: 1;
  transform: scale(1);
  position: relative;
  pointer-events: auto;
}

/* ─────────────────────────────────────────
   Statistics Counter
   ───────────────────────────────────────── */
.counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ─────────────────────────────────────────
   Contact Form
   ───────────────────────────────────────── */
.form-input {
  font-size: 0.9375rem;
}

.form-input:focus {
  box-shadow: 0 0 0 3px rgba(197, 168, 128, 0.15);
}

html[lang="ar"] .form-input {
  font-family: var(--font-arabic);
}

html[lang="ar"] select.form-input {
  background-position: left 1rem center;
}

html[lang="fr"] select.form-input,
html[lang="en"] select.form-input {
  background-position: right 1rem center;
}

select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23C5A880' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 12px;
}

/* ─────────────────────────────────────────
   WhatsApp Button
   ───────────────────────────────────────── */
#whatsappFloat {
  animation: whatsapp-pulse 2s ease-in-out infinite;
}

@keyframes whatsapp-pulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3); }
  50% { box-shadow: 0 4px 30px rgba(37, 211, 102, 0.5); }
}

/* ─────────────────────────────────────────
   Lightbox Modal
   ───────────────────────────────────────── */
#lightboxModal.open {
  opacity: 1;
  visibility: visible;
}

/* ─────────────────────────────────────────
   Responsive Adjustments
   ───────────────────────────────────────── */
@media (max-width: 768px) {
  #home {
    min-height: 100svh;
  }

  .service-card {
    text-align: center;
  }

  .service-card .absolute.bottom-6 {
    display: none;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 2rem !important;
    line-height: 1.3 !important;
  }

  h2 {
    font-size: 1.75rem !important;
  }
}

/* ─────────────────────────────────────────
   Base Visibility Guarantee
   ───────────────────────────────────────── */
body {
  opacity: 1 !important;
}

section {
  position: relative;
  opacity: 1 !important;
}

/* ─────────────────────────────────────────
   Utility Animations
   ───────────────────────────────────────── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(90deg, transparent 25%, rgba(197, 168, 128, 0.1) 50%, transparent 75%);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

/* Smooth section transitions */
section {
  position: relative;
}

/* Ensure proper text alignment per direction */
html[dir="rtl"] {
  text-align: right;
}

html[dir="ltr"] {
  text-align: left;
}

html[dir="rtl"] .text-center,
html[dir="ltr"] .text-center {
  text-align: center;
}

/* Gold line accent animation */
.gold-line {
  position: relative;
  overflow: hidden;
}

.gold-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(197, 168, 128, 0.3), transparent);
  animation: gold-sweep 3s ease-in-out infinite;
}

@keyframes gold-sweep {
  0% { left: -100%; }
  100% { left: 100%; }
}
