/**
 * css/style.css
 * التنسيقات المخصصة والهوية البصرية لموقع «عدة عبد القادر»
 * الألوان المعتمدة:
 * الخلفية الرئيسية: #07111F
 * الخلفية الثانوية: #0E1B2B
 * الذهبي: #D6A84B
 * الأخضر الداكن: #176B5B
 * الأبيض الدافئ: #F5F1E8
 * النص الثانوي: #AAB4C2
 */

@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@300;400;500;600;700;800&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

:root {
  --bg-main: #07111F;
  --bg-secondary: #0E1B2B;
  --bg-card: #122135;
  --bg-card-hover: #162840;
  --color-gold: #D6A84B;
  --color-gold-light: #E8C16D;
  --color-gold-subtle: rgba(214, 168, 75, 0.25);
  --color-teal: #176B5B;
  --color-teal-light: #238A75;
  --color-teal-subtle: rgba(23, 107, 91, 0.25);
  --text-main: #F5F1E8;
  --text-secondary: #AAB4C2;
  --text-muted: #748396;
  --nav-height: 80px;
}

/* Base and Typography */
body {
  font-family: 'Alexandria', 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
  position: relative;
}

/* Sections scroll offset */
section {
  scroll-margin-top: var(--nav-height);
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  right: 1.5rem;
  background: var(--color-gold);
  color: #07111F;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  border-radius: 0 0 0.5rem 0.5rem;
  z-index: 10000;
  transition: top 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}
.skip-link:focus {
  top: 0;
  outline: 3px solid var(--text-main);
}

/* Accessible Focus Ring */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #1c2e46;
  border-radius: 5px;
  border: 2px solid var(--bg-main);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold);
}

/* Glassmorphism & Cards */
.glass-card {
  background: rgba(18, 33, 53, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.glass-card:hover {
  border-color: rgba(214, 168, 75, 0.35);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45), 0 0 15px rgba(214, 168, 75, 0.1);
}

.gold-glow {
  box-shadow: 0 0 25px rgba(214, 168, 75, 0.2);
}
.teal-glow {
  box-shadow: 0 0 25px rgba(23, 107, 91, 0.25);
}

/* Navigation Bar */
.site-nav {
  height: var(--nav-height);
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  border-bottom: 1px solid transparent;
}
.site-nav.scrolled {
  background-color: rgba(7, 17, 31, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: rgba(214, 168, 75, 0.18);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Nav Link Hover & Active */
.nav-link {
  position: relative;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  padding: 0.5rem 0.25rem;
}
.nav-link:hover,
.nav-link.active {
  color: var(--color-gold);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-gold);
  transition: width 0.3s ease;
  border-radius: 2px;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hero Section */
.hero-bg-glow {
  position: absolute;
  top: 15%;
  right: 10%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(214, 168, 75, 0.12) 0%, rgba(23, 107, 91, 0.08) 50%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.hero-img-wrapper {
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(214, 168, 75, 0.3);
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 6s cubic-bezier(0.25, 1, 0.5, 1);
}
.hero-img-wrapper:hover .hero-img {
  transform: scale(1.03);
}

/* Gradient Overlay for Hero */
.hero-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 17, 31, 0) 50%, rgba(7, 17, 31, 0.7) 100%);
  pointer-events: none;
}

/* Scroll Indicator */
.scroll-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 52px;
  border: 2px solid rgba(214, 168, 75, 0.4);
  border-radius: 20px;
  position: relative;
}
.scroll-indicator::before {
  content: '';
  width: 6px;
  height: 10px;
  background-color: var(--color-gold);
  border-radius: 3px;
  position: absolute;
  top: 8px;
  animation: scrollDown 2s infinite ease-in-out;
}

@keyframes scrollDown {
  0% { transform: translateY(0); opacity: 1; }
  60% { transform: translateY(18px); opacity: 0.1; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #D6A84B 0%, #B58B35 100%);
  color: #07111F;
  font-weight: 700;
  padding: 0.85rem 1.85rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 15px rgba(214, 168, 75, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  min-height: 44px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(214, 168, 75, 0.45);
  filter: brightness(1.05);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid rgba(214, 168, 75, 0.4);
  font-weight: 600;
  padding: 0.85rem 1.85rem;
  border-radius: 0.75rem;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  min-height: 44px;
}
.btn-secondary:hover {
  transform: translateY(-2px);
  background: rgba(214, 168, 75, 0.12);
  border-color: var(--color-gold);
  color: var(--color-gold-light);
}

.btn-outline-teal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(23, 107, 91, 0.15);
  color: #35B39A;
  border: 1px solid rgba(23, 107, 91, 0.5);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  min-height: 44px;
}
.btn-outline-teal:hover {
  background: var(--color-teal);
  color: #ffffff;
  border-color: var(--color-teal);
  box-shadow: 0 6px 20px rgba(23, 107, 91, 0.4);
}

/* Gallery Filter Buttons */
.filter-btn {
  padding: 0.6rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 9999px;
  background: rgba(18, 33, 53, 0.8);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.25s ease;
  min-height: 44px;
  min-width: 44px;
}
.filter-btn:hover {
  color: var(--text-main);
  border-color: rgba(214, 168, 75, 0.4);
  background: rgba(22, 40, 64, 0.9);
}
.filter-btn.active {
  background: var(--color-gold);
  color: #07111F;
  border-color: var(--color-gold);
  box-shadow: 0 4px 15px rgba(214, 168, 75, 0.35);
}

/* Gallery Items */
.gallery-card {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg-card);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.gallery-card:hover {
  transform: translateY(-4px);
  border-color: rgba(214, 168, 75, 0.5);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}
.gallery-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-card:hover img {
  transform: scale(1.05);
}
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(7, 17, 31, 0.92) 0%, rgba(7, 17, 31, 0.2) 60%, transparent 100%);
  opacity: 0.9;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
}
.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 12, 22, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.lightbox-modal.active {
  display: flex;
  opacity: 1;
}
.lightbox-content-box {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: zoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox-img {
  max-width: 85vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 0.75rem;
  border: 1px solid rgba(214, 168, 75, 0.3);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}
.lightbox-caption-box {
  margin-top: 1rem;
  text-align: center;
  color: var(--text-main);
  max-width: 600px;
}
.lightbox-counter {
  font-size: 0.875rem;
  color: var(--color-gold);
  margin-top: 0.25rem;
  font-weight: 600;
}
.lightbox-btn {
  background: rgba(18, 33, 53, 0.85);
  border: 1px solid rgba(214, 168, 75, 0.3);
  color: var(--text-main);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 44px;
  min-height: 44px;
}
.lightbox-btn:hover {
  background: var(--color-gold);
  color: #07111F;
  border-color: var(--color-gold);
  box-shadow: 0 0 15px rgba(214, 168, 75, 0.5);
}
.lightbox-close-btn {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 10002;
}
.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10002;
}
.lightbox-prev {
  right: 1.5rem;
}
.lightbox-next {
  left: 1.5rem;
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(85vw, 360px);
  height: 100vh;
  background: rgba(7, 17, 31, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid rgba(214, 168, 75, 0.2);
  z-index: 9999;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}
.mobile-nav-drawer.open {
  right: 0;
}
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.mobile-nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Timeline & Stage Cards */
.timeline-card {
  position: relative;
  border-right: 3px solid var(--color-gold);
  padding-right: 1.5rem;
  margin-right: 0.5rem;
}
.timeline-dot {
  position: absolute;
  top: 0.25rem;
  right: -0.65rem;
  width: 1rem;
  height: 1rem;
  background: var(--color-gold);
  border: 3px solid var(--bg-main);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(214, 168, 75, 0.5);
}

/* Fade In on Scroll Animations */
.fade-in-element {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-in-element.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Badges */
.badge-gold {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(214, 168, 75, 0.15);
  color: var(--color-gold-light);
  border: 1px solid rgba(214, 168, 75, 0.35);
}
.badge-teal {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(23, 107, 91, 0.2);
  color: #35B39A;
  border: 1px solid rgba(23, 107, 91, 0.4);
}

/* Reduced Motion Mode */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .scroll-indicator::before {
    animation: none;
  }
  .hero-img-wrapper:hover .hero-img {
    transform: none;
  }
  .fade-in-element {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Safe area for mobile with notches */
@supports (padding: max(0px)) {
  .site-nav {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
