
/* ================= متغیرهای اصلی ================= */
:root {
  --primary-yellow: #ffd54f;
  --primary-blue: #005e7c;
  --accent-green: #1e7d42;
  --danger-red: #ff5252;
  --text-dark: #333;
  --text-light: #fff;
  --shadow-light: 0 4px 12px rgba(0, 94, 124, 0.4);
  --shadow-medium: 0 6px 20px rgba(0, 0, 0, 0.2);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --z-index-header: 1000;
  --z-index-dashboard: 1001;
  --z-index-overlay: 1002;
}

/* ================= بخش دسکتاپ ================= */

/* ================= هدر با تصویر ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10000;
  width: 100%;
  padding: 1.5rem 1rem;
  background-image: url('/images/logoo.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: inset 0 -60px 60px rgba(0, 0, 0, 0.3),
              0 4px 12px rgba(0, 94, 124, 0.4);
  color: #fff;
  overflow: hidden;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  transition: var(--transition);
  font-family: inherit;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 0;
  border-radius: 0 0 12px 12px;
}

.site-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #ffd54f, #ffb300);
  border-radius: 0 0 12px 12px;
  z-index: 1;
}

.header-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  gap: 1rem;
  text-align: right;
  font-family: inherit;
}

/* ================= لوگو ================= */
.logo {
  width: 110px;
  height: auto;
  border-radius: var(--border-radius);
  flex-shrink: 0;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.logo:hover,
.logo:focus-visible {
  transform: scale(1.05);
  outline: 3px solid var(--primary-yellow);
  outline-offset: 6px;
}

.logo {
  aspect-ratio: 1;
}

video.logo {
  object-fit: cover;
  display: block;
  background: black;
}

/* ================= عنوان‌ها ================= */
.title-section h1,
.title-section h2 {
  font-family: "B Nazanin", "Poppins", "Nunito", system-ui, sans-serif;
}

.title-section h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-light);
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, color 0.3s ease;
}

.title-section h1:hover {
  transform: translateY(-2px);
  color: var(--primary-yellow);
}

.title-section h1:lang(en) {
  font-family: "Poppins", "Nunito", system-ui, sans-serif;
  font-size: clamp(1.3rem, 3.5vw, 2rem);
}

.title-section h2 {
  margin-top: 0.3rem;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 400;
  color: #cbe9f5;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

.title-section h2:lang(en) {
  font-family: "Poppins", "Nunito", system-ui, sans-serif;
  font-size: clamp(1rem, 2.8vw, 1.4rem);
}

/* ================= داشبورد و منوی همبرگر حرفه‌ای ================= */
.dashboard-wrapper {
  position: relative;
  z-index: 10001;
  font-family: 'B Nazanin', 'Poppins', 'Nunito', sans-serif;
}

.dashboard-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, rgba(255,213,79,0.35), rgba(30,144,255,0.35));
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  position: relative;
  z-index: 10003;
  animation: pulse 1.6s ease-in-out infinite alternate;
  transition: all 0.35s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 4px 15px rgba(0,0,0,0.15); }
  50% { transform: scale(1.04); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
  100% { transform: scale(1); box-shadow: 0 4px 15px rgba(0,0,0,0.15); }
}

.dashboard-toggle .hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
}

.dashboard-toggle .hamburger span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #fff;
  border-radius: 3px;
  transition: transform 0.35s ease, opacity 0.35s ease, background-color 0.35s ease;
}

.dashboard-toggle.active .hamburger span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.dashboard-toggle.active .hamburger span:nth-child(2) {
  opacity: 0;
}
.dashboard-toggle.active .hamburger span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.dashboard-toggle:hover,
.dashboard-toggle:focus-visible {
  background: linear-gradient(135deg, rgba(255,213,79,0.85), rgba(255,180,50,0.85));
  color: #002f6c;
  outline: none;
  transform: scale(1.07);
  box-shadow: 0 6px 22px rgba(0,0,0,0.25);
}

body.dashboard-open .dashboard-toggle {
  display: none;
}

.dashboard-panel {
  position: fixed;
  top: 0;
  left: -100%;
  width: 70%;
  max-width: 280px;
  height: 100%;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  border-radius: 0 14px 14px 0;
  box-shadow: 4px 0 25px rgba(0,0,0,0.28);
  overflow-y: auto;
  opacity: 0;
  transform: translateX(-20px);
  transition: left 0.55s cubic-bezier(0.68, -0.55, 0.27, 1.55),
              opacity 0.5s ease,
              transform 0.5s ease;
  z-index: 10002;
  border-right: 1px solid rgba(0,0,0,0.12);
}

.dashboard-panel.active {
  left: 0;
  opacity: 1;
  transform: translateX(0);
}

.dashboard-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.28);
  z-index: 10001;
  transition: opacity 0.4s ease;
}

body.dashboard-open .dashboard-overlay {
  display: block;
  opacity: 1;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.95);
}

.dashboard-header h3 {
  margin: 0;
  font-size: 1.15rem;
  color: #222;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.dashboard-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #444;
  transition: color 0.35s ease, transform 0.35s ease;
}

.dashboard-close:hover,
.dashboard-close:focus-visible {
  color: #4aa96c;
  transform: scale(1.1);
}

.dashboard-content {
  padding: 1rem 1.2rem;
}

.dashboard-content p {
  margin-top: 1.1rem;
  font-size: 1rem;
  color: #555;
  line-height: 1.5;
}

#auth-container {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 1rem;
}

#auth-container h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.05rem;
  color: #333;
  cursor: pointer;
  user-select: none;
}

#auth-container form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

#auth-container form.active {
  max-height: 520px;
  opacity: 1;
}

#auth-container input {
  padding: 0.5rem 0.8rem;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 8px;
  font-size: 0.975rem;
  transition: border 0.35s ease, box-shadow 0.35s ease;
}

#auth-container input:focus {
  outline: none;
  border-color: #ffd54f;
  box-shadow: 0 0 8px rgba(255,213,79,0.45);
}

#auth-container input {
  font-family: 'Poppins', 'B Nazanin', sans-serif;
  direction: rtl;
}

#auth-container input[dir="auto"] {
  font-family: 'Poppins', 'B Nazanin', sans-serif;
}

body.ltr #auth-container input,
#auth-container input:lang(en) {
  direction: ltr;
  text-align: left;
  font-family: 'Poppins', sans-serif;
}

#auth-container button {
  padding: 0.55rem 0.9rem;
  background: linear-gradient(135deg, #1e90ff, #ffd54f);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.35s ease;
  box-shadow: 0 3px 12px rgba(30,144,255,0.35);
}

#auth-container button:hover,
#auth-container button:focus-visible {
  background: linear-gradient(135deg, #4aa96c, #ffb74d);
  color: #002f6c;
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(30,144,255,0.45);
}

#logout-btn {
  padding: 0.5rem 0.9rem;
  background: linear-gradient(135deg, #ff5252, #ff9800);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.35s ease, box-shadow 0.35s ease;
  margin-top: 0.6rem;
  box-shadow: 0 3px 12px rgba(255,82,82,0.35);
}

#logout-btn:hover,
#logout-btn:focus-visible {
  background: linear-gradient(135deg, #ff1744, #ffb74d);
  color: #002f6c;
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(255,82,82,0.45);
}

.dashboard-panel .main-nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.dashboard-panel .main-nav a {
  color: #333;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.97rem;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  transition: all 0.35s ease, box-shadow 0.35s ease;
  display: block;
}

.dashboard-panel .main-nav a:hover,
.dashboard-panel .main-nav a:focus-visible {
  background: rgba(255, 213, 79, 0.9);
  color: #002f6c;
  box-shadow: 0 3px 12px rgba(255,213,79,0.25);
}

.dashboard-panel .main-nav a.disabled {
  background: rgba(200,200,200,0.3);
  color: #555;
  pointer-events: none;
}

.dashboard-panel .main-nav a.blog-link {
  background-image: 
    url('https://dr-rezvani-vet.ir/blog/media/favicon.webp'),
    linear-gradient(135deg, #1e7d42, #114d28);
  background-repeat: no-repeat, no-repeat;
  background-position: left 0.65rem center, 0 0;
  background-size: 20px 20px, cover;
  color: #fff;
  font-weight: 700;
  padding: 0.5rem 0.85rem 0.5rem 2.2rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  box-shadow: 0 3px 14px rgba(30,125,66,0.48);
  transition: all 0.35s ease, transform 0.35s ease;
}

.dashboard-panel .main-nav a.blog-link:hover,
.dashboard-panel .main-nav a.blog-link:focus-visible {
  background-image: 
    url('https://dr-rezvani-vet.ir/blog/media/favicon.webp'),
    linear-gradient(135deg, #2ea35c, #166b38);
  transform: translateY(-2px);
  box-shadow: 0 5px 18px rgba(30,125,66,0.55);
}

/* ================= NAV هدر افقی ================= */
.header-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0;
  margin: 0;
  align-items: center;
}

.header-nav a {
  text-decoration: none;
  font-weight: 600;
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: var(--transition);
  border: 2px solid transparent;
  min-height: 44px;
  display: flex;
  align-items: center;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.header-nav a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s ease;
  z-index: 1;
}

.header-nav a:hover::before,
.header-nav a:focus-visible::before {
  left: 100%;
}

.header-nav a:hover,
.header-nav a:focus-visible {
  background: rgba(255,213,79,0.9);
  color: #002f6c;
  box-shadow: 
    0 3px 12px rgba(255,213,79,0.25),
    0 0 0 1px rgba(255, 213, 79, 0.3);
  border-color: var(--primary-yellow);
  text-shadow: none;
  transform: translateY(-1px);
}

.header-nav a.blog-link {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.35rem 1rem 0.35rem 2.2rem;
  color: #005e7c;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-image: url('https://dr-rezvani-vet.ir/blog/media/favicon.webp');
  background-repeat: no-repeat;
  background-position: left 0.55rem center;
  background-size: 18px 18px;
  border-radius: 10px;
  box-shadow: 
    0 3px 12px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-font-smoothing: antialiased;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.header-nav a.blog-link::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  border-radius: 10px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.header-nav a.blog-link:hover::after,
.header-nav a.blog-link:focus-visible::after {
  opacity: 1;
}

.header-nav a.blog-link:hover,
.header-nav a.blog-link:focus-visible {
  transform: translateY(-2px) scale(1.02);
  color: #003d5c;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  background-image: url('https://dr-rezvani-vet.ir/blog/media/favicon.webp');
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.7);
  font-weight: 800;
  box-shadow: 
    0 6px 20px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 20px rgba(0, 94, 124, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ================= استایل برای صفحه غیرفعال (صفحه فعلی) ================= */
.header-nav a.disabled {
  background: linear-gradient(135deg, rgba(255, 213, 79, 0.25), rgba(255, 213, 79, 0.15)) !important;
  color: #002f6c !important;
  border: 2px solid #D4AF37 !important;
  box-shadow: 
    0 4px 15px rgba(255, 213, 79, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
  cursor: default;
  pointer-events: none;
  position: relative;
  overflow: hidden;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.header-nav a.disabled::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 3s infinite;
  z-index: 1;
}

.header-nav a.disabled:hover,
.header-nav a.disabled:focus-visible {
  background: linear-gradient(135deg, rgba(255, 213, 79, 0.25), rgba(255, 213, 79, 0.15)) !important;
  color: #002f6c !important;
  transform: none !important;
  box-shadow: 
    0 4px 15px rgba(255, 213, 79, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.header-nav a.blog-link.disabled {
  background: linear-gradient(135deg, rgba(255, 213, 79, 0.25), rgba(255, 213, 79, 0.15)) !important;
  color: #002f6c !important;
  border: 2px solid #D4AF37 !important;
  box-shadow: 
    0 4px 15px rgba(255, 213, 79, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
  background-image: url('https://dr-rezvani-vet.ir/blog/media/favicon.webp');
  backdrop-filter: none !important;
}

.header-nav a.blog-link.disabled::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 3s infinite;
  z-index: 1;
  border-radius: 10px;
}

.header-nav a.blog-link.disabled:hover,
.header-nav a.blog-link.disabled:focus-visible {
  background: linear-gradient(135deg, rgba(255, 213, 79, 0.25), rgba(255, 213, 79, 0.15)) !important;
  color: #002f6c !important;
  transform: none !important;
  box-shadow: 
    0 4px 15px rgba(255, 213, 79, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
  backdrop-filter: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .header-nav a::before,
  .header-nav a.disabled::before,
  .header-nav a.blog-link.disabled::before {
    animation: none;
    display: none;
  }
  
  .header-nav a.blog-link::after {
    display: none;
  }
  
  .header-nav a:hover,
  .header-nav a:focus-visible {
    transform: none;
  }
  
  .header-nav a.blog-link:hover,
  .header-nav a.blog-link:focus-visible {
    transform: none;
  }
}

/* ================= بخش موبایل و تبلت ================= */
@media (max-width: 768px) {
  html, body { 
    overflow-x: hidden; 
    height: 100%; 
  }

  .main-content { 
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }

  .site-header {
    padding: 1rem 0.75rem;
  }

  .header-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: center; /* وسط چین عمودی */
    align-items: center;     /* وسط چین افقی */
    text-align: center;
    min-width: 0;
  }

  /* ترتیب ستون: عنوان+زیرعنوان وسط، ویدیو + دکمه پایین */
  .title-section {
    order: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    text-align: center;
    padding: 0.25rem 0;
  }
  .title-section h1,
  .title-section h2 {
    margin: 0;
  }
  .title-section h1 { font-size: 1.1rem; line-height: 1.2; }
  .title-section h2 { font-size: 0.8rem; line-height: 1.1; }

  .video-container {
    order: 2;
    width: auto;
    max-width: 80px;
    display: flex;
    justify-content: center; /* وسط چین */
    margin: 0.25rem 0;
  }
  .video-container video {
    width: 60px;
    height: auto;
    max-height: 60px;
    object-fit: cover;
  }

  .nav-dashboard-wrapper {
    order: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    width: auto;
  }

  .dashboard-toggle {
    margin-top: 0.25rem;
    max-width: fit-content;
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .header-nav {
    display: none !important;
  }
}

/* ---------------- موبایل‌های کوچک‌تر زیر 480px ---------------- */
@media (max-width: 480px) {
  .video-container { max-width: 70px; }
  .video-container video { max-height: 50px; }
  .dashboard-toggle { padding: 0.25rem 0.45rem; font-size: 0.75rem; }
  .title-section h1 { font-size: 0.95rem; }
  .title-section h2 { font-size: 0.7rem; }
}

/* ---------------- موبایل‌های خیلی کوچک زیر 360px ---------------- */
@media (max-width: 360px) {
  .video-container { max-width: 60px; }
  .video-container video { max-height: 45px; }
  .dashboard-toggle { font-size: 0.7rem; padding: 0.25rem 0.4rem; }
  .title-section h1 { font-size: 0.85rem; }
  .title-section h2 { font-size: 0.6rem; }
  .header-content { flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
}

/* ---------------- موبایل‌های بسیار کوچک زیر 320px ---------------- */
@media (max-width: 320px) {
  .video-container { max-width: 50px; }
  .video-container video { max-height: 40px; }
  .dashboard-toggle { font-size: 0.65rem; padding: 0.2rem 0.35rem; }
  .title-section h1 { font-size: 0.75rem; }
  .title-section h2 { font-size: 0.55rem; }
  .header-content { flex-direction: column; gap: 0.4rem; }
}

/* ================= پشتیبانی مرورگرهای قدیمی ================= */
@supports not (backdrop-filter: blur(10px)) {
  .dashboard-panel { background: rgba(255,255,255,0.95); }
}

/* ================= کاهش انیمیشن ================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .dashboard-toggle, .dashboard-panel, .header-nav a { transition: none !important; }
}

/* ================= هوشمند برای زبان انگلیسی ================= */
body:lang(en) .site-header { min-height: 85px; }
@media (max-width: 480px) { body:lang(en) .site-header { min-height: 80px; } }
@media (max-width: 360px) { body:lang(en) .site-header { min-height: 75px; } }

/* پایان نسخه موبایل — عنوان و زیرعنوان وسط، ویدیو و دکمه پایین، کاملاً ریسپانسیو برای آیفون‌ها، سامسونگ‌ها، شیامی و تبلت‌ها */
