/* ============================================
   MOHSEN YOUSRI SALEM - LEGAL WEBSITE
   Professional CSS with Theme System
   ============================================ */

/* ---- Theme Variables ---- */
:root {
  /* Gold Classic Theme (Default) */
  --accent: #B08D57;
  --accent-light: #D4AF37;
  --accent-dark: #8B6914;
  --accent-rgb: 176, 141, 87;
  --dark-bg: #0A0F1C;
  --dark-bg-2: #0D1424;
  --dark-bg-3: #111827;
  --network-color: 176, 141, 87;
}

[data-theme="blue"] {
  --accent: #2563EB;
  --accent-light: #60A5FA;
  --accent-dark: #1E40AF;
  --accent-rgb: 37, 99, 235;
  --dark-bg: #0A0F1C;
  --dark-bg-2: #0D1424;
  --dark-bg-3: #111827;
  --network-color: 37, 99, 235;
}

[data-theme="emerald"] {
  --accent: #10B981;
  --accent-light: #34D399;
  --accent-dark: #065F46;
  --accent-rgb: 16, 185, 129;
  --dark-bg: #0A1A14;
  --dark-bg-2: #0D1F18;
  --dark-bg-3: #111F1A;
  --network-color: 16, 185, 129;
}

/* ---- Base Styles ---- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  background-color: var(--dark-bg);
  color: #E5E7EB;
  overflow-x: hidden;
  transition: background-color 0.5s ease;
}

/* ---- Network Canvas ---- */
#networkCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---- Floating Law Icons ---- */
#floatingIcons {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.floating-icon {
  position: absolute;
  color: rgba(var(--accent-rgb), 0.08);
  font-size: 1.5rem;
  animation: floatIcon 20s ease-in-out infinite;
  pointer-events: none;
  transition: color 0.5s ease;
}

@keyframes floatIcon {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.4;
  }
  25% {
    transform: translateY(-30px) rotate(5deg);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-15px) rotate(-3deg);
    opacity: 0.5;
  }
  75% {
    transform: translateY(-40px) rotate(8deg);
    opacity: 0.8;
  }
}

/* ---- Navigation ---- */
#navbar {
  background: transparent;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.nav-link {
  color: rgba(255, 255, 255, 0.7);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
}

.mobile-nav-link {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.mobile-nav-link:hover {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
}

.control-btn {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.control-btn:hover {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.15);
  border-color: rgba(var(--accent-rgb), 0.3);
}

/* ---- Theme Dropdown ---- */
.theme-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 20, 36, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.5rem;
  min-width: 180px;
  z-index: 100;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

[dir="ltr"] .theme-dropdown {
  left: auto;
  right: 0;
  transform: none;
}

[dir="rtl"] .theme-dropdown {
  right: auto;
  left: 0;
  transform: none;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: inherit;
}

.theme-option:hover {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent);
}

.theme-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

/* ---- Hero Section ---- */
.hero-section {
  background: var(--dark-bg);
  position: relative;
  z-index: 2;
}

.hero-bg-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(var(--accent-rgb), 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(var(--accent-rgb), 0.05) 0%, transparent 50%),
    linear-gradient(180deg, var(--dark-bg) 0%, var(--dark-bg-2) 100%);
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 70%, var(--dark-bg) 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
}

/* ---- Hero Image ---- */
.hero-image-wrapper {
  position: relative;
  z-index: 3;
}

.hero-image-glow {
  position: absolute;
  inset: -20px;
  border-radius: 2rem;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb), 0.15) 0%, transparent 70%);
  filter: blur(30px);
  animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

.hero-image-container {
  position: relative;
  width: 380px;
  height: 480px;
  border-radius: 1.5rem;
  overflow: hidden;
  border: 2px solid rgba(var(--accent-rgb), 0.2);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(var(--accent-rgb), 0.1);
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.6s ease;
}

.hero-image-container:hover .hero-image {
  transform: scale(1.05);
}

.hero-image-badge {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(10, 15, 28, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 1rem;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(var(--accent-rgb), 0.4);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  text-decoration: none;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(var(--accent-rgb), 0.4);
  transform: translateY(-2px);
}

/* ---- Stats ---- */
.stat-item {
  text-align: center;
  padding: 1rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: white;
  display: inline;
}

.stat-label {
  font-size: 0.8rem;
  color: #9CA3AF;
  margin-top: 0.25rem;
}

/* ---- Section Themes ---- */
.section-light {
  background: #FAFBFC;
  position: relative;
  z-index: 2;
}

.section-light-alt {
  background: #F1F5F9;
  position: relative;
  z-index: 2;
}

.section-mid {
  background: #FAFBFC;
  position: relative;
  z-index: 2;
}

.section-dark {
  background: var(--dark-bg-2);
  position: relative;
  z-index: 2;
}

.section-footer {
  background: var(--dark-bg);
  position: relative;
  z-index: 2;
}

.contact-bg-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 70%, rgba(var(--accent-rgb), 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 30%, rgba(var(--accent-rgb), 0.04) 0%, transparent 50%);
  z-index: 0;
}

/* ---- About Section ---- */
.about-image-frame {
  width: 100%;
  height: 450px;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 3px solid rgba(var(--accent-rgb), 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  transition: all 0.5s ease;
}

.about-image-frame:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.15);
}

.about-experience-badge {
  position: absolute;
  bottom: -15px;
  right: -15px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: 3px solid rgba(var(--accent-rgb), 0.3);
}

[dir="ltr"] .about-experience-badge {
  right: auto;
  left: -15px;
}

.about-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background: white;
  border: 1px solid #E5E7EB;
  transition: all 0.3s ease;
}

.about-feature:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.08);
  transform: translateY(-2px);
}

.about-feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  background: rgba(var(--accent-rgb), 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---- Service Cards ---- */
.service-card {
  position: relative;
  padding: 2rem;
  background: white;
  border-radius: 1rem;
  border: 1px solid #E5E7EB;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.service-card:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  box-shadow: 0 20px 60px rgba(var(--accent-rgb), 0.1);
  transform: translateY(-5px);
}

.service-icon-wrapper {
  width: 60px;
  height: 60px;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.1) 0%, rgba(var(--accent-rgb), 0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 1.25rem;
  transition: all 0.3s ease;
}

.service-card:hover .service-icon-wrapper {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  transform: scale(1.1);
}

.service-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.service-card:hover .service-line {
  transform: scaleX(1);
}

/* ---- Timeline ---- */
.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 24px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(var(--accent-rgb), 0.1) 100%);
}

[dir="ltr"] .timeline-line {
  right: auto;
  left: 24px;
}

.timeline-item {
  position: relative;
  padding-right: 70px;
}

[dir="ltr"] .timeline-item {
  padding-right: 0;
  padding-left: 70px;
}

.timeline-dot {
  position: absolute;
  top: 5px;
  right: 16px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid white;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.2);
  z-index: 1;
}

[dir="ltr"] .timeline-dot {
  right: auto;
  left: 16px;
}

.timeline-content {
  background: white;
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid #E5E7EB;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.timeline-content:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  box-shadow: 0 8px 30px rgba(var(--accent-rgb), 0.08);
}

.timeline-year {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* ---- Achievement Cards ---- */
.achievement-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: white;
  border-radius: 1rem;
  border: 1px solid #E5E7EB;
  transition: all 0.4s ease;
}

.achievement-card:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  box-shadow: 0 10px 40px rgba(var(--accent-rgb), 0.1);
  transform: translateY(-3px);
}

.achievement-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--accent);
  font-size: 1.25rem;
}

.achievement-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.achievement-label {
  font-size: 0.85rem;
  color: #6B7280;
  margin-top: 0.5rem;
}

/* ---- Testimonials ---- */
.testimonial-card {
  position: relative;
  padding: 2rem;
  background: white;
  border-radius: 1rem;
  border: 1px solid #E5E7EB;
  transition: all 0.4s ease;
  overflow: hidden;
}

.testimonial-card:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  box-shadow: 0 10px 40px rgba(var(--accent-rgb), 0.08);
  transform: translateY(-3px);
}

.testimonial-quote {
  position: absolute;
  top: 1rem;
  left: 1rem;
}

[dir="ltr"] .testimonial-quote {
  left: auto;
  right: 1rem;
}

/* ---- Contact Form ---- */
.contact-form-wrapper {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  padding: 2rem;
  backdrop-filter: blur(10px);
}

.contact-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  color: white;
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  outline: none;
}

.contact-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
  background: rgba(255, 255, 255, 0.08);
}

.contact-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.contact-input option {
  background: var(--dark-bg-2);
  color: white;
}

.contact-info-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  transition: all 0.3s ease;
}

.contact-info-card:hover {
  background: rgba(var(--accent-rgb), 0.05);
  border-color: rgba(var(--accent-rgb), 0.2);
}

.contact-info-icon {
  width: 50px;
  height: 50px;
  border-radius: 0.75rem;
  background: rgba(var(--accent-rgb), 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.social-link {
  width: 44px;
  height: 44px;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
  text-decoration: none;
  font-size: 1.1rem;
}

.social-link:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

[dir="rtl"] @keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.animate-fade-in-right {
  opacity: 0;
  animation: fadeInRight 1s ease forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

.animate-pulse-slow {
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ---- Scroll Animations ---- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- LTR Adjustments ---- */
[dir="ltr"] body {
  font-family: 'Inter', 'Cairo', sans-serif;
}

[dir="ltr"] .rotate-on-ltr {
  transform: rotate(180deg);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero-image-container {
    width: 280px;
    height: 360px;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .about-image-frame {
    height: 350px;
  }

  .about-experience-badge {
    width: 80px;
    height: 80px;
    bottom: -10px;
    right: -10px;
  }

  .about-experience-badge span:first-child {
    font-size: 1.5rem;
  }

  .timeline-line {
    right: 18px;
  }

  [dir="ltr"] .timeline-line {
    left: 18px;
  }

  .timeline-item {
    padding-right: 55px;
  }

  [dir="ltr"] .timeline-item {
    padding-right: 0;
    padding-left: 55px;
  }

  .timeline-dot {
    right: 10px;
    width: 16px;
    height: 16px;
  }

  [dir="ltr"] .timeline-dot {
    right: auto;
    left: 10px;
  }

  .achievement-number {
    font-size: 2rem;
  }
}

@media (max-width: 640px) {
  .hero-section {
    min-height: auto;
    padding-top: 100px;
    padding-bottom: 40px;
  }

  .contact-form-wrapper {
    padding: 1.25rem;
  }
}

/* ---- Smooth Section Transitions ---- */
.section-light::before,
.section-light-alt::before,
.section-mid::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.02) 0%, transparent 100%);
  pointer-events: none;
}

/* ---- Form Success/Error States ---- */
.form-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10B981;
  padding: 1rem;
  border-radius: 0.75rem;
  text-align: center;
  font-weight: 500;
}

/* ---- Loading Animation ---- */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--dark-bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-icon {
  font-size: 3rem;
  color: var(--accent);
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ---- Selection ---- */
::selection {
  background: rgba(var(--accent-rgb), 0.3);
  color: white;
}

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

::-webkit-scrollbar-track {
  background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb), 0.5);
}
