/* ========== ریست و پایه ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazir.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #5EEAD4;
  --secondary: #3B82F6;
  --dark-bg: #08111F;
  --card-bg: #13223A;
  --border: #2D4468;
  --text-light: #E5E7EB;
  --text-muted: #9CA3AF;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 30px rgba(94, 234, 212, 0.3);
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

body {
  margin: 0;
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
  direction: rtl;
  background: linear-gradient(135deg, #08111F 0%, #0f1923 50%, #08111F 100%);
  color: var(--text-light);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== اسکرول‌بار سفارشی ========== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 10px;
  transition: var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--secondary), var(--primary));
}

/* ========== انیمیشن‌های عمومی ========== */
@keyframes float {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg); 
  }
  50% { 
    transform: translateY(-15px) rotate(2deg); 
  }
}

@keyframes pulseGlow {
  0%, 100% { 
    box-shadow: 0 0 10px rgba(94, 234, 212, 0.3),
                0 0 20px rgba(94, 234, 212, 0.2),
                0 0 30px rgba(94, 234, 212, 0.1);
  }
  50% { 
    box-shadow: 0 0 20px rgba(94, 234, 212, 0.6),
                0 0 40px rgba(94, 234, 212, 0.4),
                0 0 60px rgba(94, 234, 212, 0.2);
  }
}

@keyframes fadeInUp {
  from { 
    opacity: 0; 
    transform: translateY(40px) scale(0.95); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

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

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes rotate360 {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ========== تایپوگرافی ========== */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

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

a {
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: var(--transition-base);
}

/* ========== هدر ========== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition-smooth);
}

header.sticky {
  backdrop-filter: blur(20px) saturate(180%);
  background: rgba(8, 17, 31, 0.85);
  border-bottom: 1px solid rgba(94, 234, 212, 0.1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* لینک‌های ناوبری */
nav a {
  position: relative;
  padding: 0.5rem 1rem;
  transition: var(--transition-base);
  font-weight: 500;
}

nav a::before {
  content: '';
  position: absolute;
  bottom: 0;
  right: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: var(--transition-smooth);
  transform: translateX(50%);
}

nav a.active::before,
nav a:hover::before {
  width: 80%;
}

nav a.active, 
nav a:hover {
  color: var(--primary);
  text-shadow: 0 0 20px rgba(94, 234, 212, 0.5);
}

/* منوی موبایل */
#mobile-menu {
  transition: max-height var(--transition-smooth), 
              opacity var(--transition-base),
              transform var(--transition-smooth);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-10px);
}

#mobile-menu.show {
  max-height: 400px;
  opacity: 1;
  transform: translateY(0);
}

/* ========== کارت‌ها ========== */
article, .rank-card, .blog-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: transform var(--transition-smooth), 
              border-color var(--transition-base), 
              box-shadow var(--transition-smooth);
  backface-visibility: hidden;
  overflow: hidden;
}

article::before,
.rank-card::before,
.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity var(--transition-base);
  animation: shimmer 3s linear infinite;
}

article:hover::before,
.rank-card:hover::before,
.blog-card:hover::before {
  opacity: 1;
}

article:hover, 
.rank-card:hover, 
.blog-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(94, 234, 212, 0.2),
              0 0 60px rgba(94, 234, 212, 0.1);
}

/* ========== دکمه‌ها ========== */
.btn-primary {
  position: relative;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--dark-bg);
  padding: 0.875rem 2.5rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  display: inline-block;
  transition: var(--transition-smooth);
  border: none;
  cursor: pointer;
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 4px 15px rgba(94, 234, 212, 0.3);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 30px rgba(94, 234, 212, 0.5),
              0 0 40px rgba(94, 234, 212, 0.3);
}

.btn-primary:active {
  transform: translateY(-1px) scale(1.02);
}

/* ========== انیمیشن اسکرول AOS ========== */
[data-aos] {
  transition-property: opacity, transform;
  transition-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
}

/* ========== تصاویر بلاگ ========== */
.blog-card {
  overflow: hidden;
}

.blog-card img {
  transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1),
              filter var(--transition-base);
  border-radius: 12px;
}

.blog-card:hover img {
  transform: scale(1.1) rotate(2deg);
  filter: brightness(1.1) contrast(1.05);
}

/* ========== فروشگاه رنک‌ها ========== */
.rank-grid a {
  position: relative;
  overflow: hidden;
  display: block;
  border-radius: 16px;
}

.rank-grid a::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94,234,212,0.3) 0%, transparent 70%);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  transform: translate(-50%, -50%);
}

.rank-grid a:hover::after {
  width: 300%;
  height: 300%;
  opacity: 1;
}

/* ========== فرم‌ها ========== */
input, textarea, select {
  background-color: var(--card-bg);
  border: 2px solid var(--border);
  color: var(--text-light);
  padding: 0.875rem 1.25rem;
  border-radius: 12px;
  width: 100%;
  transition: border var(--transition-base), 
              box-shadow var(--transition-base),
              transform var(--transition-fast);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 1rem;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.15),
              0 4px 12px rgba(94, 234, 212, 0.2);
  transform: translateY(-2px);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

/* ========== فوتر ========== */
footer {
  background: linear-gradient(180deg, transparent, rgba(8, 17, 31, 0.8));
  border-top: 1px solid rgba(94, 234, 212, 0.1);
}

footer a {
  transition: var(--transition-base);
  position: relative;
}

footer a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 0;
  height: 1px;
  background: var(--primary);
  transition: width var(--transition-base);
}

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

footer a:hover::after {
  width: 100%;
}

/* ========== پنل ادمین ========== */
.admin-sidebar {
  background: linear-gradient(180deg, var(--dark-bg), #0a1420);
  border-left: 1px solid var(--border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

.admin-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.admin-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(94, 234, 212, 0.05), transparent);
  transition: left 0.6s;
}

.admin-card:hover::before {
  left: 100%;
}

.admin-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(94, 234, 212, 0.15);
  transform: translateX(-4px);
}

/* ========== اعلان‌ها ========== */
.notification-dot {
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, var(--danger), #dc2626);
  border-radius: 50%;
  display: inline-block;
  margin-left: 6px;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  box-shadow: 0 0 10px var(--danger);
  position: relative;
}

.notification-dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--danger);
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

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

@keyframes ping {
  75%, 100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

/* ========== بارگذاری ========== */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: rotate360 0.8s linear infinite;
}

/* ========== بج‌ها ========== */
.badge {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--dark-bg);
  box-shadow: 0 2px 8px rgba(94, 234, 212, 0.3);
}

/* ========== ریسپانسیو ========== */
@media (max-width: 768px) {
  :root {
    font-size: 14px;
  }
  
  .admin-card {
    padding: 1.25rem;
  }
  
  .btn-primary {
    padding: 0.75rem 2rem;
  }
}

/* ========== افکت‌های اضافی ========== */
.glass-effect {
  background: rgba(19, 34, 58, 0.6);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(94, 234, 212, 0.1);
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hover-lift {
  transition: transform var(--transition-smooth);
}

.hover-lift:hover {
  transform: translateY(-4px);
}
