/* ============================================
   DaneshTan - Complete Stylesheet
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  /* Colors - Light Mode */
  --bg: #fafaf7;
  --bg-elevated: #ffffff;
  --bg-subtle: #f5f3ee;
  --bg-muted: #ebe8e0;

  --text-primary: #0a0a0a;
  --text-secondary: #404040;
  --text-tertiary: #737373;
  --text-muted: #a3a3a3;

  --accent: #16a085;
  --accent-hover: #1abc9c;
  --accent-dark: #0e7a65;
  --accent-light: #e8f8f5;
  --accent-subtle: rgba(22, 160, 133, 0.08);
  --accent-glow: rgba(22, 160, 133, 0.3);

  --border: #e8e5de;
  --border-strong: #d4d0c7;
  --border-subtle: #f0ede6;

  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --info: #3b82f6;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.12);

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.25s var(--ease);
  --transition-slow: 0.5s var(--ease);

  /* Typography */
  --font: "Vazirmatn", system-ui, -apple-system, sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-size-3xl: 32px;
  --font-size-4xl: 40px;

  /* Layout */
  --container-max: 1200px;
  --navbar-height: 72px;
}

/* ---------- Dark Mode Variables ---------- */
[data-theme="dark"] {
  --bg: #0a0f0d;
  --bg-elevated: #111815;
  --bg-subtle: #162019;
  --bg-muted: #1e2a24;

  --text-primary: #f0fdf4;
  --text-secondary: #bbf7d0;
  --text-tertiary: #86efac;
  --text-muted: #6ee7b7;

  --accent: #16a085;
  --accent-hover: #1abc9c;
  --accent-dark: #0e7a65;
  --accent-light: rgba(22, 160, 133, 0.15);
  --accent-subtle: rgba(22, 160, 133, 0.08);
  --accent-glow: rgba(22, 160, 133, 0.4);

  --border: rgba(22, 160, 133, 0.15);
  --border-strong: rgba(22, 160, 133, 0.3);
  --border-subtle: rgba(22, 160, 133, 0.08);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: var(--font-size-base);
  transition:
    background-color var(--transition),
    color var(--transition);
  min-height: 100vh;
}

body[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ---------- Container ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--navbar-height);
  transition: all var(--transition);
}

[data-theme="dark"] .navbar {
  background: rgba(10, 15, 13, 0.85);
}

.navbar.scrolled {
  box-shadow: var(--shadow);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 24px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: var(--font-size-xl);
  color: var(--accent);
}

.navbar-brand svg {
  width: 32px;
  height: 32px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  font-size: var(--font-size-sm);
}

.nav-link:hover {
  background: var(--bg-subtle);
  color: var(--accent);
}

.nav-link.active {
  background: var(--accent-subtle);
  color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn,
.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.icon-btn:hover,
.theme-toggle:hover {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-subscribe {
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-size-sm);
  transition: all var(--transition);
}

.btn-subscribe:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* ---------- Hero Section ---------- */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-subtle) 100%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-title {
  font-size: var(--font-size-4xl);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.title-outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--accent);
}

.hero-subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all var(--transition);
}

.hero-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--accent-glow);
}

/* ---------- Section ---------- */
.section {
  padding: 60px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-title {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

.eyebrow-line {
  width: 24px;
  height: 2px;
  background: var(--accent);
}

.view-all {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  padding-bottom: 2px;
  transition: all var(--transition);
}

.view-all:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- Featured Article ---------- */
.featured {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.featured-article {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.article-meta-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--font-size-xs);
}

.meta-separator {
  color: var(--border-strong);
}

.article-title {
  font-size: var(--font-size-3xl);
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.article-lead {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 32px;
}

.article-hero-image {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: var(--shadow-lg);
}

.article-hero-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.image-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: var(--font-size-xs);
}

.article-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}

.content-block {
  padding: 20px 24px;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  border-right: 4px solid var(--border-strong);
}

.content-block-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-weight: 700;
}

.content-block-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  font-size: 16px;
}

.content-block-content {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ---------- Poll ---------- */
.question-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 20px;
}

.question-box h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.poll-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.poll-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  overflow: hidden;
}

.poll-option:hover:not(.disabled) {
  border-color: var(--accent);
  background: var(--accent-subtle);
  transform: translateX(-2px);
}

.poll-option.voted {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.poll-option.disabled {
  cursor: default;
}

.poll-option input[type="radio"] {
  display: none;
}

.poll-check {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  transition: all var(--transition);
  background: var(--bg-elevated);
}

.poll-option.voted .poll-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-glow);
}

.poll-text {
  font-weight: 500;
  flex: 1;
  position: relative;
  z-index: 1;
}

.poll-bar {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  background: var(--accent-subtle);
  transition: width 0.6s var(--ease);
  z-index: 0;
}

.poll-percent {
  font-weight: 700;
  color: var(--accent);
  min-width: 40px;
  text-align: left;
  position: relative;
  z-index: 1;
}

.poll-votes {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  position: relative;
  z-index: 1;
}

.poll-total {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  text-align: center;
}

.poll-closed-msg {
  padding: 12px 16px;
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.3);
  border-radius: var(--radius-md);
  color: var(--success);
  font-size: var(--font-size-sm);
  margin-bottom: 16px;
}

/* ---------- Article Footer ---------- */
.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 16px;
}

.author-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    var(--accent-hover) 100%
  );
  color: #fff;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--font-size-lg);
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-weight: 700;
  font-size: var(--font-size-sm);
}

.author-role {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.share-buttons {
  display: flex;
  gap: 8px;
}

.share-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.share-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* ---------- Articles Grid ---------- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.article-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.article-image {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}

.article-card:hover .article-image img {
  transform: scale(1.05);
}

.article-category {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.article-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.article-body h3 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-body p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--accent);
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: all var(--transition);
  align-self: flex-start;
}

.read-more:hover {
  border-bottom-color: var(--accent);
}

/* ---------- Newsletter ---------- */
.newsletter {
  padding: 80px 0;
  background: linear-gradient(
    135deg,
    var(--bg-subtle) 0%,
    var(--bg-muted) 100%
  );
}

.newsletter-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  padding: 48px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.newsletter-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    var(--accent-hover) 100%
  );
  color: #fff;
  border-radius: var(--radius-lg);
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px var(--accent-glow);
}

.newsletter-title {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  margin-bottom: 12px;
}

.newsletter-subtitle {
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: var(--font-size-base);
}

.newsletter-form {
  display: flex;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto 16px;
}

.newsletter-form input {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-primary);
  transition: all var(--transition);
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.newsletter-form button {
  padding: 14px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}

.newsletter-form button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.newsletter-form button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.newsletter-note {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: var(--font-size-xl);
  color: var(--accent);
  margin-bottom: 16px;
}

.footer-description {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.8;
  max-width: 320px;
}

.footer-title {
  font-weight: 700;
  font-size: var(--font-size-base);
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  transition: all var(--transition);
}

.footer-links a:hover {
  color: var(--accent);
  padding-right: 4px;
}

.social-links {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.social-links a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.social-links a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
}

/* ---------- Search Modal ---------- */
.search-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 100px 20px 20px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.search-modal.active {
  opacity: 1;
  visibility: visible;
}

.search-container {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 16px;
  width: 100%;
  max-width: 600px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  transform: translateY(-20px);
  transition: transform var(--transition);
}

.search-modal.active .search-container {
  transform: translateY(0);
}

.search-container input {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-primary);
  font-size: var(--font-size-base);
}

.search-container input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.search-container button {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition);
  flex-shrink: 0;
}

.search-container button:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.search-results {
  width: 100%;
  max-width: 600px;
  margin-top: 16px;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-result-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: all var(--transition);
}

.search-result-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.search-result-category {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  margin-bottom: 8px;
}

.search-result-content h4 {
  font-size: var(--font-size-base);
  font-weight: 700;
  margin-bottom: 6px;
}

.search-result-content p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.search-no-results {
  text-align: center;
  padding: 40px;
  color: var(--text-tertiary);
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all var(--transition);
  border: none;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all var(--transition);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--danger);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all var(--transition);
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.btn-icon:hover {
  background: #fee2e2;
  border-color: var(--danger);
  color: var(--danger);
}

/* ---------- Responsive ---------- */
@media (max-width: 968px) {
  .nav-menu {
    display: none;
  }
  .btn-subscribe {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-title {
    font-size: var(--font-size-3xl);
  }

  .article-title {
    font-size: var(--font-size-2xl);
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }
  .articles-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .article-card {
    margin-bottom: 0;
  }

  .article-image {
    height: 200px;
  }

  .article-body {
    padding: 16px;
  }

  .article-body h3 {
    font-size: 16px;
    line-height: 1.5;
    -webkit-line-clamp: 2;
  }

  .article-body p {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }

  .article-meta {
    font-size: 11px;
  }

  .read-more {
    font-size: 13px;
  }

  .hero {
    padding: 48px 0 32px;
  }

  .hero-title {
    font-size: var(--font-size-2xl);
  }

  .hero-subtitle {
    font-size: var(--font-size-base);
  }

  .section {
    padding: 40px 0;
  }

  .section-title {
    font-size: var(--font-size-xl);
  }

  .featured-article {
    padding: 24px;
  }

  .article-title {
    font-size: var(--font-size-xl);
  }

  .article-lead {
    font-size: var(--font-size-base);
  }

  .article-hero-image img {
    height: 240px;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .newsletter-card {
    padding: 32px 24px;
  }

  .newsletter-title {
    font-size: var(--font-size-xl);
  }

  .newsletter-form {
    flex-direction: column;
  }

  .article-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-modal {
    padding: 80px 12px 12px;
  }

  .search-container {
    padding: 12px;
  }
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.animate-fade-in {
  animation: fadeIn 0.4s var(--ease);
}

.animate-slide-in {
  animation: slideIn 0.4s var(--ease);
}

/* ---------- Utility ---------- */
.text-accent {
  color: var(--accent);
}
.text-muted {
  color: var(--text-tertiary);
}
.text-center {
  text-align: center;
}
.mt-1 {
  margin-top: 8px;
}
.mt-2 {
  margin-top: 16px;
}
.mt-3 {
  margin-top: 24px;
}
.mt-4 {
  margin-top: 32px;
}
.mb-1 {
  margin-bottom: 8px;
}
.mb-2 {
  margin-bottom: 16px;
}
.mb-3 {
  margin-bottom: 24px;
}
.mb-4 {
  margin-bottom: 32px;
}
/* ============================================
   Font Size Controller
   ============================================ */

.font-size-controller {
  position: relative;
}

.font-size-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: 700;
  font-size: var(--font-size-sm);
  transition: all var(--transition);
  cursor: pointer;
}

.font-size-btn:hover {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

.font-size-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition);
  z-index: 100;
}

.font-size-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.font-size-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  font-weight: 500;
}

.font-size-option:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.font-size-option.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}

.font-size-option .size-preview {
  font-weight: 700;
  color: var(--accent);
}

.font-size-option .check-icon {
  opacity: 0;
  transition: opacity var(--transition);
}

.font-size-option.active .check-icon {
  opacity: 1;
}

/* Font Size Classes */
body.font-small {
  --font-size-base: 14px;
  --font-size-sm: 12px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 22px;
  --font-size-3xl: 28px;
  --font-size-4xl: 34px;
}

body.font-medium {
  /* Default sizes */
}

body.font-large {
  --font-size-base: 18px;
  --font-size-sm: 15px;
  --font-size-lg: 20px;
  --font-size-xl: 22px;
  --font-size-2xl: 26px;
  --font-size-3xl: 36px;
  --font-size-4xl: 44px;
}

/* Smooth transition for font size change */
body {
  transition: font-size 0.3s var(--ease);
}

/* ============================================
   Bookmarks Page
   ============================================ */

.bookmarks-page {
  padding: 60px 0 80px;
  min-height: 60vh;
}

.bookmarks-header {
  text-align: center;
  margin-bottom: 48px;
}

.bookmarks-header h1 {
  font-size: var(--font-size-3xl);
  font-weight: 900;
  margin-bottom: 12px;
}

.bookmarks-header p {
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
}

.bookmarks-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-top: 16px;
}

.bookmarks-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-tertiary);
}

.bookmarks-empty svg {
  margin: 0 auto 20px;
  opacity: 0.3;
}

.bookmarks-empty h3 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.bookmarks-empty p {
  font-size: var(--font-size-base);
  margin-bottom: 24px;
}

.bookmarks-empty .btn-primary {
  display: inline-flex;
}

/* Bookmark Card */
.bookmark-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  transition: all var(--transition);
  margin-bottom: 16px;
}

.bookmark-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.bookmark-image {
  width: 100px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-subtle);
}

.bookmark-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bookmark-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    var(--accent-subtle) 0%,
    var(--bg-subtle) 100%
  );
  color: var(--accent);
  font-size: 24px;
}

.bookmark-content {
  flex: 1;
  min-width: 0;
}

.bookmark-category {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
}

.bookmark-title {
  font-size: var(--font-size-base);
  font-weight: 700;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmark-meta {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  display: flex;
  gap: 8px;
  align-items: center;
}

.bookmark-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.bookmark-remove-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(220, 38, 38, 0.1);
  border: none;
  border-radius: var(--radius-md);
  color: var(--danger);
  cursor: pointer;
  transition: all var(--transition);
}

.bookmark-remove-btn:hover {
  background: var(--danger);
  color: #fff;
  transform: scale(1.1);
}

.bookmark-view-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle);
  border: none;
  border-radius: var(--radius-md);
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.bookmark-view-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.1);
}

@media (max-width: 640px) {
  .bookmarks-header h1 {
    font-size: var(--font-size-2xl);
  }

  .bookmark-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .bookmark-image {
    width: 100%;
    height: 160px;
  }

  .bookmark-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ============================================
   Mobile Touch Optimization
   ============================================ */

@media (max-width: 768px) {
  /* Make all clickable elements at least 44x44px (Apple HIG recommendation) */
  .nav-link,
  .btn-primary,
  .btn-ghost,
  .btn-icon,
  .share-btn,
  .filter-btn,
  .action-btn {
    min-height: 44px;
    min-width: 44px;
  }

  /* Improve tap targets for links */
  a {
    padding: 8px 0;
  }

  /* Better spacing for mobile */
  .article-card {
    margin-bottom: 16px;
  }

  /* Prevent text selection on buttons */
  button,
  .nav-link,
  .btn-primary,
  .btn-ghost {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  /* Smooth scrolling for iOS */
  * {
    -webkit-overflow-scrolling: touch;
  }

  /* Prevent zoom on input focus (iOS) */
  input,
  textarea,
  select {
    font-size: 16px !important;
  }

  /* Better form inputs on mobile */
  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px;
    padding: 14px 16px;
  }
}
/* ============================================
   Mobile Scroll Optimization
   ============================================ */

@media (max-width: 768px) {
  /* Smooth momentum scrolling */
  html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  /* Prevent horizontal scroll */
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Better image loading on mobile */
  img {
    content-visibility: auto;
  }

  /* Reduce motion for users who prefer it */
  @media (prefers-reduced-motion: reduce) {
    * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

/* Show horizontal menu on tablet and above */
@media (min-width: 769px) {
  .nav-menu {
    display: flex !important;
  }
}

/* ============================================
   Floating Glassmorphism Navigation Dock
   ============================================ */

.floating-nav {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  transition: all 0.3s var(--ease);
}

/* Dark Mode Support */
[data-theme="dark"] .floating-nav {
  background: rgba(17, 24, 21, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Nav Items */
.floating-nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.floating-nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform 0.3s var(--ease);
}

/* Hover Effects (Desktop) */
.floating-nav-item:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

.floating-nav-item:hover svg {
  transform: scale(1.15);
}

/* Active State (Mobile & Desktop) */
.floating-nav-item.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.floating-nav-item.active svg {
  transform: scale(1.1);
}

/* Tooltip (Desktop Only) */
.floating-nav-item .tooltip {
  position: absolute;
  top: -42px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  transform-origin: bottom center;
  padding: 6px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all 0.3s var(--ease);
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
}

.floating-nav-item .tooltip::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: var(--bg-elevated) transparent transparent transparent;
}

.floating-nav-item:hover .tooltip {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

/* Hide tooltip on mobile to save space */
@media (max-width: 768px) {
  .floating-nav {
    display: flex;
    bottom: 16px;
    padding: 10px 12px;
    gap: 4px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .floating-nav-item {
    width: 44px;
    height: 44px;
  }

  .floating-nav-item .tooltip {
    display: none;
  }

  /* Push content up */
  body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  /* Adjust other fixed buttons */
  .back-to-top {
    bottom: calc(100px + env(safe-area-inset-bottom));
  }

  .bookmark-btn {
    bottom: calc(160px + env(safe-area-inset-bottom));
  }

  .reading-mode-btn {
    bottom: calc(230px + env(safe-area-inset-bottom));
  }
}

/* نمایش منوی افقی در دسکتاپ و تبلت */
@media (min-width: 769px) {
  .nav-menu {
    display: flex !important;
  }
}

/* بهبود اسکرول افقی فیلترها در موبایل */
@media (max-width: 768px) {
  .category-filters {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 4px 0;
  }

  .filter-btn {
    scroll-snap-align: start;
    flex-shrink: 0;
  }
}
