/* === Global Resets === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  overflow-x: hidden;
  /* Kufi font tweak for better readability */
  word-spacing: 0.05em;
  letter-spacing: 0.02em;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.4;
  margin-block-end: 1rem;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
  border-radius: var(--radius-md); /* Default for images */
}

input, textarea, button, select {
  font-family: inherit;
  font-size: 1rem;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* === Utility Classes === */
.container {
  width: 90%;
  max-width: 1200px;
  margin-inline: auto;
}

.text-accent {
  color: var(--accent-primary);
}

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

.section {
  padding-block: var(--section-padding-y);
  position: relative;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
}

.eyebrow {
  display: inline-block;
  color: var(--accent-primary);
  font-weight: bold;
  font-size: 0.9rem;
  margin-block-end: 0.5rem;
  background: rgba(252, 19, 27, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-block-end: 3rem;
  text-align: center;
}

/* === Typography constraints === */
p {
  max-width: 75ch; /* Keep line length readable */
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-full);
  font-weight: bold;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(252, 19, 27, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(252, 19, 27, 0.5);
  background-color: #e00b12; /* slightly darker */
}

.btn-secondary {
  background-color: var(--bg-panel);
  color: var(--text-primary);
  border: 1px solid rgba(253, 253, 253, 0.1);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background-color: rgba(253, 253, 253, 0.1);
}

/* Ripple effect container */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple-anim 0.6s linear;
  background-color: rgba(255, 255, 255, 0.3);
}

@keyframes ripple-anim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Breathing pulse ring */
.pulse-ring {
  position: relative;
}
.pulse-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent-primary);
  animation: pulse-idle 3s infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes pulse-idle {
  0% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

/* === Navigation === */
.navbar {
  position: fixed;
  top: 1rem;
  inset-inline-start: 5%;
  inset-inline-end: 5%;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 1.5rem;
  border-radius: var(--radius-full);
  z-index: 1000;
  transition: all 0.4s ease;
  /* Transparent initially, JS will add .glass-panel class on scroll */
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  position: relative;
  font-weight: bold;
  padding-block: 0.5rem;
  transition: color 0.3s;
}

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

/* Draw line on hover */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  inset-inline-start: 0; /* RTL support */
  width: 0;
  height: 2px;
  background-color: var(--accent-primary);
  transition: width 0.3s ease;
}

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

.nav-toggle {
  display: none;
  color: var(--text-primary);
  font-size: 1.5rem;
}

/* === Hero Section === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding-top: var(--nav-height);
  transition: opacity 0.5s ease; /* For fade on scroll */
}

.hero-content {
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.hero h1 {
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 1.2;
}

.hero p {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--text-muted);
  max-width: 600px;
}

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

/* Ambient cursor glow */
.cursor-glow {
  position: fixed; /* Changed to fixed so it works across the whole page */
  top: 0;
  left: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(252,19,27,0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s ease;
  opacity: 0; /* JS enables it */
}

/* Ambient Blobs */
.bg-blobs {
  position: fixed; /* so it stays behind everything */
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
  opacity: 0.12;
  animation: blob-drift 20s infinite alternate ease-in-out;
}
.blob-1 {
  width: 50vw;
  height: 50vw;
  top: -10%;
  right: -10%; /* LTR right = RTL left visually, but fixed is fixed */
}
.blob-2 {
  width: 60vw;
  height: 60vw;
  bottom: -20%;
  left: -10%;
  animation-delay: -10s;
}

@keyframes blob-drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(10%, 5%) scale(1.1); }
  100% { transform: translate(-5%, 15%) scale(0.9); }
}

/* === Floating WhatsApp === */
.floating-whatsapp {
  position: fixed;
  bottom: 2rem;
  inset-inline-start: 2rem; /* RTL native - bottom left */
  background-color: #25D366;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  z-index: 1000;
  transition: transform 0.3s;
}

.floating-whatsapp:hover {
  transform: scale(1.1);
}

.floating-whatsapp .pulse-ring::before {
  border-color: #25D366;
}

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background-color: var(--accent-primary);
  z-index: 9999;
}

/* === Footer === */
.footer {
  background-color: var(--bg-panel);
  padding-block: 4rem 2rem;
  border-top-right-radius: var(--radius-lg);
  border-top-left-radius: var(--radius-lg);
  margin-top: 5rem;
}

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

.footer-col h3 {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.footer-links a {
  color: var(--text-muted);
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--accent-primary);
}

.social-icons {
  display: flex;
  gap: 1rem;
}
.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: rgba(255,255,255,0.05);
  transition: background 0.3s, color 0.3s;
}
.social-icons a:hover {
  background-color: var(--accent-primary);
  color: white;
}

.whatsapp-groups {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.wa-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: var(--glass-border);
  background: var(--glass-bg);
  transition: transform 0.3s;
}

.wa-card:hover {
  transform: translateY(-3px);
}

.wa-card .wa-icon {
  color: #25D366;
}

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

/* === Cards === */
.card {
  background-color: var(--bg-panel);
  border-radius: var(--radius-md);
  padding: 2rem;
  transition: transform 0.3s, box-shadow 0.3s;
  height: 100%;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(252, 19, 27, 0.05);
}

.card-img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  transition: transform 0.5s;
}

.card:hover .card-img {
  transform: scale(1.03); /* Subtle zoom */
}
.card-img-wrapper {
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}
.card-img-wrapper img {
  margin-bottom: 0;
}

/* Tilt Card Wrapper */
.tilt-card-wrapper {
  perspective: 1000px;
  height: 100%;
}
.tilt-card {
  transition: transform 0.1s ease-out; /* fast response for JS tilt */
  transform-style: preserve-3d;
}
.tilt-card > * {
  transform: translateZ(30px); /* push content up */
}

/* === Forms === */
.form-group {
  margin-bottom: 1.5rem;
}

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

.form-control {
  width: 100%;
  padding: 1rem 1.5rem;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: border-color 0.3s, background-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

/* === Responsive === */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    inset-inline-end: -100%; /* off-screen right (start in RTL is right) */
    width: 100%;
    height: calc(100vh - var(--nav-height));
    flex-direction: column;
    justify-content: center;
    background: var(--bg-primary);
    transition: inset-inline-end 0.4s ease;
    padding: 2rem;
  }

  .nav-links.active {
    inset-inline-end: 0; /* slide in */
  }

  .nav-toggle {
    display: block;
  }
}

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .bg-blobs {
    display: none;
  }
}
