@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  background: linear-gradient(135deg, #121212, #2c2c2c);
  color: #d4af37;
  direction: rtl;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* کانتینر */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

header {
  background: linear-gradient(90deg, #5a4600, #bfa32b, #5a4600);
  padding: 1.2rem 0;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px; /* ارتفاع کمتر */
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  box-shadow: 0 3px 15px rgba(212, 175, 55, 0.6),
    inset 0 -3px 10px rgba(255, 215, 0, 0.7);
  user-select: none;
  z-index: -1; /* میره زیر همه باکس‌ها */
  font-family: "Montserrat", sans-serif;
  color: #000000;
  text-shadow: 0 0 8px #d4af37, 0 0 15px #bfa32b;
  animation: goldGlow 5s ease-in-out infinite alternate;
  transition: background 0.4s ease;
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 4px;
  pointer-events: none;
  user-select: none;
  text-transform: uppercase;
  text-shadow: 0 0 5px #fffbe6, 0 0 10px #d4af37;
}

/* main بالا میاد به اندازه هدر که محتوا زیر هدر نباشه */
main {
  padding-top: 70px; /* کمی بیشتر از ارتفاع هدر */
}

/* انیمیشن نوری طلایی */
@keyframes goldGlow {
  0% {
    filter: drop-shadow(0 0 10px #d4af37);
    background-position: 0% 50%;
  }
  50% {
    filter: drop-shadow(0 0 30px #f7e67a);
    background-position: 100% 50%;
  }
  100% {
    filter: drop-shadow(0 0 10px #d4af37);
    background-position: 0% 50%;
  }
}

/* اصلی */
main {
  flex-grow: 1;
  padding: 4rem 0 5rem; /* بیشتر فاصله از هدر */
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3rem;
}

/* کارت خدمات */
.service-card {
  margin-top: 30%;
  background: linear-gradient(145deg, #3e3e3e, #282828);
  border-radius: 20px;
  padding: 2.5rem 2.2rem;
  box-shadow: 0 15px 30px rgba(212, 175, 55, 0.2),
    inset 0 0 15px rgba(212, 175, 55, 0.3);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
  outline-offset: 4px;
  position: relative;
  user-select: none;
}

.service-card:focus,
.service-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 25px 45px rgba(212, 175, 55, 0.5),
    inset 0 0 30px rgba(212, 175, 55, 0.6);
}

/* تیتر */
.service-card h2 {
  margin-top: 0;
  font-size: 2.2rem;
  border-bottom: 3px solid #d4af37;
  padding-bottom: 0.6rem;
  user-select: text;
}

/* توضیح */
.service-card p {
  margin: 1.2rem 0 0;
  color: #c8c8c8;
  font-size: 1.15rem;
  line-height: 1.6;
  user-select: text;
}

/* دکمه قیمت */
.btn-price {
  margin-top: 2rem;
  background: transparent;
  border: 2px solid #d4af37;
  color: #d4af37;
  padding: 0.7rem 1.6rem;
  font-weight: 700;
  font-size: 1.15rem;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 0 10px #d4af37;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  user-select: none;
}

.btn-price:hover,
.btn-price:focus {
  background-color: #d4af37;
  color: #2a2a2a;
  box-shadow: 0 0 20px #f7e67a;
  outline: none;
}

/* تولتیپ قیمت */
/* قرار می‌دهیم داخل کارت و مطمئنیم بالای همه */
.price-tooltip {
  position: absolute;
  top: -50px;
  right: 1.8rem;
  background: #d4af37;
  color: #2a2a2a;
  padding: 0.45rem 1rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
  box-shadow: 0 0 15px #d4af37;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 100; /* بالاتر از همه */
  user-select: none;
}

.price-tooltip.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* فوتر */
footer {
  background: linear-gradient(270deg, #bfa32b, #5a4600);
  color: #1f1f1f;
  text-align: center;
  padding: 1.5rem 1rem;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 2px;
  box-shadow: inset 0 0 25px #f7e67a, 0 0 40px 10px rgba(191, 163, 43, 0.8);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  user-select: none;
  position: relative;
  overflow: hidden;
  z-index: 100;
  animation: footerGlow 6s ease-in-out infinite alternate;
}
footer p {
  margin: 0;
  text-shadow: 0 0 5px #fffbe6, 0 0 10px #d4af37;
}
/* واکنشگرایی */
/* CSS */
.glass-gold-button {
  position: fixed;
  top: 80px;
  right: 16px;
  padding: 10px 28px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  font-family: "Vazirmatn", "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition: transform 0.3s ease, background 0.3s ease;
}

/* افکت نور طلایی در هاور */
.glass-gold-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 150%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.3), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  z-index: 0;
}

.glass-gold-button:hover::before {
  left: 100%;
}

.glass-gold-button:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.04);
}

/* افکت کلیک: نبض طلایی */
.glass-gold-button:active {
  animation: goldenPulse 0.4s ease;
}

@keyframes goldenPulse {
  0% {
    box-shadow: 0 0 0 rgba(212, 175, 55, 0);
  }
  50% {
    box-shadow: 0 0 22px rgba(212, 175, 55, 0.5);
  }
  100% {
    box-shadow: 0 0 0 rgba(212, 175, 55, 0);
  }
}

/* موبایل کوچک */
@media (max-width: 480px) {
  header {
    padding: 3rem 0 2rem;
    top: 0%;
  }

  header h1 {
    font-size: 1.5rem;
    letter-spacing: 3px;
  }

  .service-card {
    padding: 2rem 1.8rem;
  }

  .service-card h2 {
    font-size: 1.7rem;
  }

  .service-card p {
    font-size: 1rem;
  }

  .btn-price {
    font-size: 1rem;
    padding: 0.6rem 1.2rem;
  }

  .price-tooltip {
    font-size: 1rem;
    top: -40px;
    right: 1rem;
  }
}

/* موبایل متوسط */
@media (max-width: 768px) {
  main {
    padding: 3rem 0 4rem;
  }

  .services-grid {
    gap: 2rem;
  }
}
#content {
  opacity: 0;
  filter: blur(12px);
  transition: opacity 1.2s ease, filter 1.2s ease;
  padding: 20px;
}

/* وقتی لودینگ تموم شد */
#content.show {
  opacity: 1;
  filter: blur(0);
}

/* کل صفحه لودینگ */
#loader {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 18, 0.85); /* مشکی مات و نیمه شفاف */
  backdrop-filter: blur(12px); /* بلور */
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
  user-select: none;
  transition: opacity 0.8s ease;
}

/* پنهان کردن با fadeout */
#loader.hide {
  opacity: 0;
  pointer-events: none;
}

/* حلقه‌ها */
.rings {
  position: relative;
  width: 120px;
  height: 120px;
}

.ring {
  position: absolute;
  border: 6px solid transparent;
  border-top-color: #d4af37;
  border-radius: 50%;
  animation-timing-function: cubic-bezier(0.68, 0.55, 0.265, 1.55);
  box-shadow: 0 0 8px #d4af37, 0 0 15px #d4af37;
}

.ring1 {
  width: 120px;
  height: 120px;
  top: 0;
  left: 0;
  animation: spinClockwise 1.8s linear infinite;
}

.ring2 {
  width: 90px;
  height: 90px;
  top: 15px;
  left: 15px;
  border-top-color: #bbb;
  box-shadow: 0 0 6px #bbb, 0 0 12px #bbb;
  animation: spinCounter 1.2s linear infinite;
}

.ring3 {
  width: 60px;
  height: 60px;
  top: 30px;
  left: 30px;
  animation: spinClockwise 1s linear infinite;
}

@keyframes spinClockwise {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes spinCounter {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}

/* متن بارگذاری */
#loader-text {
  margin-top: 30px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #d4af37;
  letter-spacing: 0.15em;
  text-shadow: 0 0 8px #d4af37, 0 0 20px #d4af37;
  animation: glowText 2.5s ease-in-out infinite;
}

@keyframes glowText {
  0%,
  100% {
    text-shadow: 0 0 8px #d4af37, 0 0 20px #d4af37, 0 0 30px #d4af37;
    color: #d4af37;
  }
  50% {
    text-shadow: 0 0 4px #fff, 0 0 15px #fff, 0 0 25px #d4af37;
    color: #fff;
  }
}
