@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #1a3a5c;
  --primary-light: #2a5298;
  --accent: #c9a84c;
  --accent-light: #e8c96a;
  --bg: #f8f7f4;
  --bg-card: #ffffff;
  --text: #1e1e1e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  direction: rtl;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
}

/* HEADER */
header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 0;
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo-area { display: flex; align-items: center; gap: 14px; text-decoration: none; color: #fff; }
.logo-icon {
  width: 48px; height: 48px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: var(--primary);
}
.logo-text { line-height: 1.3; }
.logo-text h1 { font-size: 15px; font-weight: 700; }
.logo-text span { font-size: 11px; opacity: 0.8; }

nav { display: flex; gap: 6px; }
nav a {
  color: #fff; text-decoration: none; padding: 8px 16px;
  border-radius: 8px; font-size: 14px; font-weight: 500;
  transition: background 0.2s;
}
nav a:hover, nav a.active { background: rgba(255,255,255,0.15); }

/* HERO */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #0d2137 100%);
  color: #fff;
  padding: 80px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; max-width: 700px; margin: 0 auto; }
.hero h2 { font-size: 32px; font-weight: 800; margin-bottom: 16px; line-height: 1.4; }
.hero p { font-size: 17px; opacity: 0.85; margin-bottom: 30px; }
.hero-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--primary);
  padding: 6px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
}

/* MAIN */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.main-content { padding: 50px 0; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 30px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--accent);
}
.section-title {
  font-size: 22px; font-weight: 700; color: var(--primary);
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: '';
  width: 5px; height: 26px;
  background: var(--accent);
  border-radius: 3px;
  display: inline-block;
}

/* GRID */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

/* CARD */
.post-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  border: 1px solid var(--border);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.card-img {
  height: 200px; overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 48px;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 22px; }
.card-category {
  display: inline-block;
  background: #eef2ff; color: var(--primary-light);
  padding: 3px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
  margin-bottom: 10px;
}
.card-title {
  font-size: 17px; font-weight: 700; color: var(--text);
  margin-bottom: 10px; line-height: 1.5;
  text-decoration: none; display: block;
}
.card-title:hover { color: var(--primary-light); }
.card-excerpt { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; }
.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-muted);
  padding-top: 14px; border-top: 1px solid var(--border);
}
.read-more {
  color: var(--accent); font-weight: 600; text-decoration: none; font-size: 13px;
}
.read-more:hover { color: var(--primary); }

/* SINGLE POST */
.post-single { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px; margin: 40px 0; }
.post-single h1 { font-size: 28px; font-weight: 800; color: var(--primary); margin-bottom: 20px; line-height: 1.5; }
.post-single .post-meta { display: flex; gap: 20px; color: var(--text-muted); font-size: 13px; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.post-single .post-content { font-size: 16px; line-height: 2; }
.post-single .post-content p { margin-bottom: 20px; }
.post-single .post-content h2 { font-size: 20px; color: var(--primary); margin: 30px 0 15px; }

/* FOOTER */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.85);
  text-align: center;
  padding: 30px 20px;
  margin-top: 60px;
}
footer a { color: var(--accent); text-decoration: none; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 12px; }
  .logo-text h1 { font-size: 13px; }
  nav a { padding: 6px 10px; font-size: 13px; }
  .hero h2 { font-size: 22px; }
  .posts-grid { grid-template-columns: 1fr; }
  .post-single { padding: 20px; }
}

/* ADMIN */
.admin-body { background: #f1f5f9; }
.admin-sidebar {
  width: 260px; background: var(--primary); color: #fff;
  position: fixed; right: 0; top: 0; bottom: 0;
  padding: 0; z-index: 200; overflow-y: auto;
}
.admin-sidebar .brand {
  padding: 24px 20px;
  background: rgba(0,0,0,0.2);
  font-size: 14px; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-sidebar nav { padding: 16px 12px; }
.admin-sidebar nav a {
  display: flex; align-items: center; gap: 12px;
  color: rgba(255,255,255,0.75); text-decoration: none;
  padding: 11px 16px; border-radius: 8px;
  font-size: 14px; margin-bottom: 4px;
  transition: all 0.2s;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
  background: rgba(255,255,255,0.15); color: #fff;
}
.admin-main {
  margin-right: 260px; padding: 30px;
  min-height: 100vh;
}
.admin-topbar {
  background: #fff; padding: 16px 24px;
  border-radius: 12px; box-shadow: var(--shadow);
  margin-bottom: 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.admin-topbar h1 { font-size: 18px; font-weight: 700; color: var(--primary); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; border: none;
  transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: var(--primary); }
.btn-accent:hover { background: var(--accent-light); }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

.card-admin {
  background: #fff; border-radius: 12px; box-shadow: var(--shadow);
  padding: 28px; margin-bottom: 24px;
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin-bottom: 28px; }
.stat-card {
  background: #fff; border-radius: 12px; padding: 24px;
  box-shadow: var(--shadow); text-align: center;
  border-top: 4px solid var(--accent);
}
.stat-card .num { font-size: 36px; font-weight: 800; color: var(--primary); }
.stat-card .lbl { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
table th { background: #f8fafc; color: var(--text-muted); padding: 12px 16px; text-align: right; font-weight: 600; border-bottom: 2px solid var(--border); }
table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table tr:hover td { background: #f8fafc; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.form-control {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 14px; color: var(--text);
  background: #fff; transition: border 0.2s;
  direction: rtl;
}
.form-control:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(42,82,152,0.1); }
textarea.form-control { min-height: 180px; resize: vertical; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-warning { background: #fef3c7; color: #d97706; }

.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-height(135deg, var(--primary), #0d2137); }
.login-box {
  background: #fff; border-radius: 16px; padding: 44px;
  width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-box h1 { font-size: 20px; font-weight: 800; color: var(--primary); text-align: center; margin-bottom: 8px; }
.login-box p { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 30px; }

@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(260px); transition: transform 0.3s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-right: 0; padding: 16px; }
}
.post-source {
    margin-top: 24px;
    padding: 12px 16px;
    background: #f8fafc;
    border-right: 3px solid #2563eb;
    border-radius: 6px;
    font-size: 13px;
}
.post-source span {
    font-weight: bold;
    color: #444;
    margin-left: 8px;
}
.post-source a {
    color: #2563eb;
    word-break: break-all;
}
.post-source a:hover {
    text-decoration: underline;
}
/* SOURCES SLIDER */
.sources-section {
  background: var(--primary);
  padding: 60px 20px;
  clear: both;
}

.sources-section-title {
  font-size: 13px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 8px;
}

.sources-section-heading {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 36px;
}

.sources-slider-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}

.sources-slider {
  display: flex;
  transition: transform 0.5s ease;
}

.source-slide {
  min-width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.source-slide-img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  overflow: hidden;
}

.source-slide-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.source-slide-body { flex: 1; }

.source-slide-label {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.source-slide-body h3 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.5;
}

.source-slide-date {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 14px;
}

.source-slide-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.source-slide-link:hover { color: var(--accent-light); }

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.slider-dots button {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.slider-dots button.active {
  background: var(--accent);
  transform: scale(1.3);
}

@media (max-width: 600px) {
  .source-slide-img { display: none; }
  .source-slide { padding: 20px; }
}
