@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800&display=swap');

:root {
  /* Dynamic Light Theme Colors */
  --primary: #1E3A8A;
  --secondary: #3B82F6;
  --accent: #D97706;
  --accent-hover: #B45309;
  --background: #F0F9FF;
  --surface: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #475569;
  --border: #E2E8F0;
  
  --radius: 12px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(30, 58, 138, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(30, 58, 138, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  /* Dynamic Dark Theme Colors */
  --primary: #60A5FA;
  --secondary: #2563EB;
  --accent: #F59E0B;
  --accent-hover: #FBBF24;
  --background: #0B1121;
  --surface: #172554;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --border: #1E3A8A;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Cairo', sans-serif;
}

html {
  scroll-behavior: smooth;
  direction: rtl;
}

body {
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: var(--transition);
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Navbar */
header {
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  min-height: 80px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  color: var(--accent);
}

.logo img {
  object-fit: contain;
  border-radius: 8px;
  height: 85px !important;
  transition: all 0.3s ease;
}

footer .logo img {
  background: rgba(255, 255, 255, 0.95);
  padding: 6px;
  border-radius: 10px;
  height: 100px !important;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-weight: 600;
  color: var(--text-main);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary);
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--primary);
  color: white !important;
}

.btn-primary:hover {
  background-color: var(--secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background-color: var(--accent);
  color: white !important;
}

.btn-accent:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary);
  color: var(--primary) !important;
}

.btn-outline:hover {
  background-color: var(--primary);
  color: white !important;
}

/* Sections */
.section {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  display: inline-block;
  position: relative;
  padding-bottom: 0.5rem;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background-color: var(--accent);
  border-radius: 2px;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0, 43, 91, 0.9), rgba(0, 43, 91, 0.4));
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 600px;
  color: white;
}

.hero-content h1 {
  color: white;
  margin-bottom: 1.5rem;
}

.hero-content p {
  color: #E2E8F0;
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
}

/* Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  transition: all 0.7s ease;
  z-index: 1;
  pointer-events: none;
}

.card:hover::before {
  left: 200%;
}

.card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: var(--accent);
}

.card-icon {
  width: 60px;
  height: 60px;
  background: rgba(212, 175, 55, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Footer */
footer {
  background-color: var(--primary);
  color: white;
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h3 {
  color: white;
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-col h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40px;
  height: 2px;
  background-color: var(--accent);
}

.footer-col p, .footer-col li {
  color: #cbd5e1;
  margin-bottom: 0.75rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col a {
  color: #cbd5e1;
}

.footer-col a:hover {
  color: var(--accent);
  padding-right: 5px;
}

.contact-info li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.contact-info i {
  color: var(--accent);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 0.875rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: var(--transition);
  background-color: var(--background);
  color: var(--text-main);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 43, 91, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* Calculator Specific */
.calculator-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.calculator-header {
  background: var(--primary);
  color: white;
  padding: 1.5rem;
  text-align: center;
}

.calculator-header h3 {
  color: white;
  margin: 0;
}

.calculator-body {
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .calculator-body {
    grid-template-columns: 3fr 2fr;
  }
}

.calc-results {
  background: var(--background);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.result-item {
  margin-bottom: 1.5rem;
}

.result-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.result-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.result-value.highlight {
  color: var(--accent);
  font-size: 2rem;
}

.disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    position: relative;
  }

  .logo img {
    height: 65px !important;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--surface);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    gap: 1rem;
    z-index: 40;
    border-top: 1px solid var(--border);
  }

  .nav-links.active {
    display: flex;
  }

  .menu-btn {
    display: block;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .grid[style*="1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  
  .calculator-body {
    padding: 1.5rem 1rem;
  }
}

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

.animate-fade-in {
  animation: fadeIn 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

/* Contact Specific */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr 2fr;
  }
}

.contact-info-card {
  background: var(--primary);
  color: white;
  padding: 2rem;
  border-radius: var(--radius);
  height: 100%;
}

.contact-info-card h3 {
  color: white;
}

.contact-info-card p, .contact-info-card a {
  color: rgba(255, 255, 255, 0.8);
}

.info-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.info-icon {
  font-size: 1.5rem;
  color: var(--accent);
}

/* Timeline RTL Fix */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 2px;
  background-color: var(--accent);
  top: 0;
  bottom: 0;
  right: 50%;
  margin-right: -1px;
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  background-color: inherit;
  width: 50%;
}

.timeline-item::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: var(--surface);
  border: 4px solid var(--accent);
  top: 15px;
  border-radius: 50%;
  z-index: 1;
}

.right {
  right: 0;
}

.left {
  right: 50%;
}

.right::after {
  left: -10px;
}

.left::after {
  right: -10px;
}

.timeline-content {
  padding: 20px 30px;
  background-color: var(--surface);
  position: relative;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

@media screen and (max-width: 600px) {
  .timeline::after {
    right: 31px;
  }
  
  .timeline-item {
    width: 100%;
    padding-right: 70px;
    padding-left: 25px;
  }
  
  .left::after, .right::after {
    right: 21px;
    left: auto;
  }
  
  .right, .left {
    right: 0;
  }
}

/* WhatsApp Floating Icon */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  left: 30px;
  background-color: #25d366;
  color: #FFF !important;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 35px;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
  z-index: 100;
  transition: all 0.3s ease;
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 2px 2px 15px rgba(37,211,102,0.4);
}

.wa-tooltip {
  position: absolute;
  left: 75px;
  background: var(--surface);
  color: var(--text-main);
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  white-space: normal;
  width: 220px;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  direction: rtl;
}

.wa-tooltip::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -6px;
  transform: translateY(-50%);
  border-width: 6px 0 6px 6px;
  border-style: solid;
  border-color: transparent transparent transparent var(--surface);
}

.wa-tooltip.show {
  opacity: 1;
  visibility: visible;
}

/* 3D and Modern Enhancements */
.glass-3d {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  transform: perspective(1000px) rotateX(2deg) rotateY(0deg);
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.glass-3d:hover {
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateY(-5px);
  box-shadow: 0 35px 60px -15px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .glass-3d {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.input-3d .form-control {
  background-color: var(--background);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.input-3d .form-control:focus {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

.btn-3d {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.btn-3d:active {
  transform: translateY(2px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.decorative-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  z-index: 1;
  opacity: 0.6;
  animation: float-slow 10s infinite alternate ease-in-out;
  pointer-events: none;
}

.sphere-1 {
  width: 300px;
  height: 300px;
  background: var(--accent);
  top: -50px;
  right: -100px;
  animation-duration: 12s;
}

.sphere-2 {
  width: 250px;
  height: 250px;
  background: var(--primary);
  bottom: -50px;
  left: -50px;
  animation-duration: 15s;
  animation-delay: 2s;
}

@keyframes float-slow {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20px, 30px) scale(1.05); }
  100% { transform: translate(10px, -20px) scale(0.95); }
}
