/* ============================================================
   قالب شرکتی پرستیژ - استایل‌های سفارشی
   ============================================================
   این فایل شامل انیمیشن‌ها، افکت‌ها و استایل‌های اضافی است.
   رنگ‌های اصلی در tailwind.config داخل هر HTML تنظیم شده‌اند.
   ============================================================ */

/* --- فونت وزیرمتن (فونت اصلی فارسی) --- */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* --- متغیرهای CSS (برای ویرایش سریع رنگ‌ها) --- */
:root {
  --color-primary: #6366f1;       /* رنگ اصلی - بنفش/نیلی */
  --color-primary-dark: #4f46e5;
  --color-accent: #f59e0b;        /* رنگ تاکید - طلایی/نارنجی */
  --color-accent-light: #fbbf24;
  --color-dark: #0f172a;          /* پس‌زمینه تیره */
  --color-dark-light: #1e293b;
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  --gradient-dark: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* --- تنظیمات پایه --- */
* {
  scroll-behavior: smooth;
}

body {
  font-family: 'Vazirmatn', sans-serif;
  overflow-x: hidden;
}

/* --- اسکرول‌بار سفارشی --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-dark);
}

/* ============================================================
   انیمیشن‌های کلیدی (KEYFRAMES)
   ============================================================ */

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(2deg); }
}

@keyframes float-reverse {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(15px); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.4); }
  50% { box-shadow: 0 0 60px rgba(99, 102, 241, 0.8); }
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-right {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes blob {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes count-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   کلاس‌های انیمیشن (ANIMATION CLASSES)
   ============================================================ */

.animate-float { animation: float 6s ease-in-out infinite; }
.animate-float-reverse { animation: float-reverse 5s ease-in-out infinite; }
.animate-float-delay { animation: float 6s ease-in-out 2s infinite; }
.animate-pulse-glow { animation: pulse-glow 3s ease-in-out infinite; }
.animate-gradient { 
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
}
.animate-spin-slow { animation: spin-slow 20s linear infinite; }
.animate-blob { animation: blob 8s ease-in-out infinite; }

/* --- انیمیشن ورود با اسکرول (AOS fallback) --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}

/* ============================================================
   افکت‌های بصری (VISUAL EFFECTS)
   ============================================================ */

/* --- گرادیان متحرک --- */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- شیشه‌ای (Glass Morphism) --- */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-light {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* --- کارت با هاور --- */
.card-hover {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-glow);
}

/* --- دکمه درخشان --- */
.btn-shine {
  position: relative;
  overflow: hidden;
}
.btn-shine::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}
.btn-shine:hover::after {
  left: 100%;
}

/* --- خط زیر منو --- */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* --- پس‌زمینه شبکه (Grid Pattern) --- */
.bg-grid {
  background-image: 
    linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
}

.bg-grid-dark {
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* --- Blob #blob shapes --- */
.blob-shape {
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
}

/* --- تصویر با overlay گرادیان --- */
.img-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.8), transparent);
  border-radius: inherit;
}

/* --- شمارنده (Counter) --- */
.counter-number {
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   هدر — منوی همیشه وسط (GRID LAYOUT)
   ============================================================ */
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.header-brand { justify-self: start; }
.header-nav { justify-self: center; }
.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* دکمه تغییر تم */
.theme-toggle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: #e0e7ff;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.theme-toggle .icon-sun {
  display: none;
  color: #f59e0b;
}
.theme-toggle .icon-moon {
  display: block;
  color: #334155;
}
html.dark .theme-toggle .icon-sun { display: block; }
html.dark .theme-toggle .icon-moon { display: none; }

html.dark .theme-toggle {
  border-color: #475569;
  background: #1e293b;
}
html.dark .theme-toggle:hover {
  background: #334155;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* هدر شفاف روی Hero تیره (صفحه اصلی — بالای صفحه) */
#main-header:not(.header-scrolled):not(.inner-page-header) .theme-toggle {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
}
#main-header:not(.header-scrolled):not(.inner-page-header) .theme-toggle .icon-moon {
  color: #ffffff;
}
#main-header:not(.header-scrolled):not(.inner-page-header) .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

/* دکمه تم در منوی موبایل */
.mobile-menu .theme-toggle {
  width: 100%;
  height: auto;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
  font-weight: 500;
}
.mobile-menu .theme-toggle:hover {
  background: #e0e7ff;
}
html.dark .mobile-menu .theme-toggle {
  background: #0f172a;
  border-color: #475569;
  color: #e2e8f0;
}
html.dark .mobile-menu .theme-toggle .icon-moon {
  color: #e2e8f0;
}

/* ============================================================
   هدر ثابت (STICKY HEADER)
   ============================================================ */
.header-scrolled {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

.header-scrolled .nav-link {
  color: #334155 !important;
}

.header-scrolled .logo-text {
  color: #1e293b !important;
}

.header-scrolled #mobile-menu-btn span {
  background: #334155 !important;
}

.header-scrolled .theme-toggle {
  border-color: #cbd5e1;
  background: #f1f5f9;
}
.header-scrolled .theme-toggle .icon-moon {
  color: #334155;
}
.header-scrolled .theme-toggle:hover {
  background: #e0e7ff;
  border-color: #6366f1;
}

/* هدر صفحات داخلی (بدون Hero تیره) */
.inner-page-header {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}
.inner-page-header .logo-text { color: #1e293b !important; }
.inner-page-header .nav-link { color: #475569 !important; }
.inner-page-header .nav-link:hover { color: #6366f1 !important; }
.inner-page-header #mobile-menu-btn span { background: #334155 !important; }

/* بنر صفحات داخلی */
.page-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
}

/* ============================================================
   منوی موبایل (MOBILE MENU)
   ============================================================ */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-menu.open {
  transform: translateX(0);
}

.mobile-overlay {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ============================================================
   اسلایدر نظرات (TESTIMONIAL SLIDER)
   ============================================================ */
.testimonial-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   FAQ آکاردئون
   ============================================================ */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}
.faq-item.active .faq-answer {
  max-height: 500px;
}
.faq-item.active .faq-icon {
  transform: rotate(45deg);
}
.faq-icon {
  transition: transform 0.3s ease;
}

/* ============================================================
   فرم تماس (CONTACT FORM)
   ============================================================ */
.form-input {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
}

/* ============================================================
   Preloader (لودر اولیه)
   ============================================================ */
.preloader {
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

/* ============================================================
   دکمه بازگشت به بالا (BACK TO TOP)
   ============================================================ */
.back-to-top {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ============================================================
   صفحه 404
   ============================================================ */
.error-glow {
  text-shadow: 0 0 80px rgba(99, 102, 241, 0.5);
}

/* ============================================================
   تایم‌لاین (Timeline - صفحه درباره ما)
   ============================================================ */
.timeline-line::before {
  content: '';
  position: absolute;
  right: 50%;
  transform: translateX(50%);
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-accent));
}

@media (max-width: 768px) {
  .timeline-line::before {
    right: 20px;
    transform: none;
  }
}

/* ============================================================
   افکت پارالاکس ملایم
   ============================================================ */
.parallax-bg {
  will-change: transform;
}

/* ============================================================
   Badge و Tag
   ============================================================ */
.badge-pulse::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: var(--gradient-primary);
  opacity: 0.3;
  animation: pulse-glow 2s ease-in-out infinite;
  z-index: -1;
}

/* ============================================================
   دارک مود (DARK MODE)
   برای فعال‌سازی: class="dark" روی تگ html
   ============================================================ */
html.dark { color-scheme: dark; }

html.dark body {
  background-color: #0f172a !important;
  color: #e2e8f0 !important;
}

html.dark ::-webkit-scrollbar-track { background: #1e293b; }

html.dark .bg-white { background-color: #1e293b !important; }
html.dark .bg-slate-50 { background-color: #0f172a !important; }
html.dark .bg-slate-100 { background-color: #334155 !important; }
html.dark .bg-indigo-50 { background-color: rgba(99, 102, 241, 0.15) !important; }
html.dark .bg-indigo-100 { background-color: rgba(99, 102, 241, 0.25) !important; }

html.dark .text-slate-900,
html.dark .text-slate-800 { color: #f1f5f9 !important; }
html.dark .text-slate-700,
html.dark .text-slate-600 { color: #cbd5e1 !important; }
html.dark .text-slate-500,
html.dark .text-slate-400 { color: #94a3b8 !important; }

html.dark .border-slate-100,
html.dark .border-slate-200 { border-color: #334155 !important; }

html.dark .header-scrolled,
html.dark .inner-page-header {
  background: rgba(15, 23, 42, 0.95) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

html.dark .header-scrolled .logo-text,
html.dark .header-scrolled .nav-link,
html.dark .inner-page-header .logo-text,
html.dark .inner-page-header .nav-link { color: #e2e8f0 !important; }

html.dark .header-scrolled .nav-link:hover,
html.dark .inner-page-header .nav-link:hover { color: #a5b4fc !important; }

html.dark .nav-link.active { color: #a5b4fc !important; }

html.dark #main-header:not(.inner-page-header):not(.header-scrolled) .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
}

html.dark #main-header:not(.inner-page-header):not(.header-scrolled) .theme-toggle {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

html.dark #main-header:not(.inner-page-header):not(.header-scrolled) .theme-toggle .icon-moon {
  color: #fff;
}

html.dark .mobile-menu { background: #1e293b !important; }
html.dark .mobile-menu a { color: #e2e8f0 !important; }
html.dark .mobile-menu a:hover { background: rgba(99, 102, 241, 0.15) !important; }

html.dark .card-hover.bg-white,
html.dark article.bg-white,
html.dark .faq-item.bg-white {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

html.dark .form-input,
html.dark input:not([type="submit"]),
html.dark textarea {
  background-color: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder { color: #64748b !important; }

html.dark .glass-light {
  background: rgba(30, 41, 59, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html.dark blockquote.bg-indigo-50 { background: rgba(99, 102, 241, 0.15) !important; }

html.dark .filter-btn {
  border-color: #475569 !important;
  color: #cbd5e1 !important;
}

html.dark .testimonial-dot.bg-gray-300 { background-color: #475569 !important; }

html.dark main > section:first-of-type svg path[fill="white"] { fill: #0f172a; }
