/* ===================================
   صدائے قلم - مکمل CSS
   =================================== */

/* مہر نستعلیق - CDN سے */
@import url("https://cdn.jsdelivr.net/gh/shakeebahmad95/MehrNastaleeq@f4685c00850b66e3aa0b3e94a4755378d88c1d99/font.css");

:root {
  --primary: #1a5276;
  --primary-dark: #154360;
  --primary-light: #2e86c1;
  --accent: #c0392b;
  --accent-light: #e74c3c;
  --gold: #d4a017;
  --gold-light: #f1c40f;
  --bg: #f4f6f8;
  --bg-white: #ffffff;
  --text: #2c3e50;
  --text-light: #5d6d7e;
  --text-muted: #95a5a6;
  --border: #dde1e7;
  --shadow: 0 2px 15px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
  --radius: 12px;
  --font: 'Mehr', 'MehrNastaleeq', serif;
}

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

body {
  font-family: var(--font);
  direction: rtl;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 2;
}

a { text-decoration: none; color: inherit; transition: all 0.3s; }
ul { list-style: none; }
img { max-width: 100%; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.3s;
  font-weight: 600;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #333;
  font-weight: 700;
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(212,160,23,0.4); }
.btn-danger { background: var(--accent); color: white; }
.btn-success { background: #27ae60; color: white; }

/* ===== HEADER ===== */
.header-top {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.8);
  padding: 6px 0;
  font-size: 13px;
}
.header-top-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.social-links a {
  color: white;
  margin-left: 10px;
  font-size: 16px;
}
.header-main {
  background: var(--primary);
  padding: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
}
.logo h1 {
  color: white;
  font-size: 28px;
  line-height: 1.2;
}
.logo p {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
}
.main-nav ul {
  display: flex;
  gap: 5px;
}
.main-nav a {
  color: rgba(255,255,255,0.9);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  white-space: nowrap;
}
.main-nav a:hover { background: rgba(255,255,255,0.15); color: white; }
.header-actions {
  display: flex;
  gap: 10px;
  margin-right: auto;
}
.header-actions .btn-outline { color: white; border-color: white; }
.header-actions .btn-outline:hover { background: white; color: var(--primary); }
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

/* ===== HERO ===== */
.hero-section {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 30px 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
.hero-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-hover);
}
.hero-img-placeholder {
  height: 220px;
  background: linear-gradient(135deg, #1a3a5c, #2e86c1);
  display: flex;
  align-items: flex-start;
  padding: 15px;
  position: relative;
}
.hero-img-placeholder::after {
  content: '📖';
  font-size: 80px;
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.2;
}
.hero-cat, .side-cat {
  background: var(--accent);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  display: inline-block;
}
.hero-content { padding: 20px; }
.hero-content h2 { font-size: 20px; margin-bottom: 10px; line-height: 1.6; }
.hero-content h2 a:hover { color: var(--primary); }
.hero-content p { color: var(--text-light); font-size: 14px; line-height: 1.9; margin-bottom: 12px; }
.meta { color: var(--text-muted); font-size: 13px; display: flex; gap: 15px; }

.hero-side { display: flex; flex-direction: column; gap: 15px; }
.side-card {
  background: white;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  flex: 1;
}
.side-card h3 { font-size: 16px; margin: 8px 0; line-height: 1.6; }
.side-card h3 a:hover { color: var(--primary); }

/* ===== CATEGORIES BAR ===== */
.cats-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  overflow-x: auto;
}
.cats-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.cats-label { font-weight: 600; color: var(--primary); margin-left: 10px; }
.cats-inner a {
  padding: 5px 15px;
  background: var(--bg);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text);
  border: 1px solid var(--border);
}
.cats-inner a:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== MAIN CONTENT ===== */
.main-content { padding: 30px 0; }
.content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
}

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--primary);
}
.section-header h2 { font-size: 22px; color: var(--primary); }
.see-all { color: var(--primary); font-size: 14px; }
.see-all:hover { color: var(--accent); }

/* ===== ARTICLE CARDS ===== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}
.article-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  border: 1px solid var(--border);
  position: relative;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}
.article-cat-badge {
  background: var(--primary);
  color: white;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 10px;
}
.article-card h3 { font-size: 17px; margin-bottom: 10px; line-height: 1.7; }
.article-card h3 a:hover { color: var(--primary); }
.article-card p { color: var(--text-light); font-size: 13px; line-height: 1.9; margin-bottom: 15px; }
.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.author-link { display: flex; align-items: center; gap: 8px; color: var(--text); }
.author-link:hover { color: var(--primary); }
.author-avatar {
  width: 32px; height: 32px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}
.article-date { color: var(--text-muted); font-size: 12px; }
.load-more-wrap { text-align: center; padding: 10px 0 20px; }

/* ===== SIDEBAR ===== */
.sidebar-widget {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.widget-title {
  font-size: 16px;
  color: var(--primary);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.search-form { display: flex; gap: 8px; }
.search-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 13px;
  direction: rtl;
}
.search-form button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font);
}
.submit-widget { background: linear-gradient(135deg, #eaf4fb, #d6eaf8); border-color: var(--primary-light); }
.submit-widget p { color: var(--text-light); font-size: 13px; margin-bottom: 12px; }

.author-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.author-item:last-child { border: none; }
.author-item:hover { color: var(--primary); }
.author-avatar-lg {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.author-item strong { display: block; font-size: 14px; }
.author-item small { color: var(--text-muted); font-size: 12px; }

.cat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  color: var(--text);
  font-size: 14px;
}
.cat-item:hover { color: var(--primary); }
.cat-count {
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.competition-widget {
  background: linear-gradient(135deg, #fef9e7, #fdebd0);
  border-color: var(--gold);
}
.competition-widget p { font-size: 13px; color: var(--text-light); margin-bottom: 12px; }

/* ===== ARTICLE DETAIL PAGE ===== */
.article-detail { padding: 30px 0; }
.article-detail-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
}
.article-full {
  background: white;
  border-radius: var(--radius);
  padding: 35px;
  box-shadow: var(--shadow);
}
.article-full h1 {
  font-size: 26px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 20px;
}
.article-info {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 15px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 25px;
  flex-wrap: wrap;
}
.article-info span { color: var(--text-muted); font-size: 14px; }
.article-body {
  font-size: 17px;
  line-height: 2.2;
  color: var(--text);
}
.article-body p { margin-bottom: 20px; }

/* ===== AUTHOR PAGE ===== */
.author-profile {
  background: white;
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  text-align: center;
  margin-bottom: 25px;
}
.author-avatar-xl {
  width: 90px; height: 90px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700;
  margin: 0 auto 15px;
}
.author-profile h2 { font-size: 24px; margin-bottom: 10px; }
.author-profile p { color: var(--text-light); font-size: 14px; line-height: 1.9; }
.author-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 15px;
}
.stat { text-align: center; }
.stat strong { display: block; font-size: 22px; color: var(--primary); }
.stat span { font-size: 12px; color: var(--text-muted); }

/* ===== FORMS ===== */
.auth-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
}
.auth-box {
  background: white;
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-hover);
}
.auth-box h2 {
  text-align: center;
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 25px;
}
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 15px;
  direction: rtl;
  transition: border 0.3s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,82,118,0.1);
}
.form-group textarea { min-height: 200px; resize: vertical; }
.btn-block { width: 100%; padding: 14px; font-size: 16px; }
.auth-links { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-light); }
.auth-links a { color: var(--primary); font-weight: 600; }
.alert {
  padding: 12px 18px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 14px;
}
.alert-success { background: #d5f5e3; color: #1e8449; border: 1px solid #a9dfbf; }
.alert-error { background: #fadbd8; color: #922b21; border: 1px solid #f1948a; }

/* ===== DASHBOARD ===== */
.dashboard { padding: 30px 0; }
.dashboard-grid { display: grid; grid-template-columns: 250px 1fr; gap: 25px; }
.dashboard-sidebar {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  height: fit-content;
}
.dash-user {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 15px;
}
.dash-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 4px;
}
.dash-nav a:hover, .dash-nav a.active { background: var(--primary); color: white; }
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}
.stat-box {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-box .num { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-box .lbl { font-size: 13px; color: var(--text-muted); }

/* ===== ADMIN PANEL ===== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-table th {
  background: var(--primary);
  color: white;
  padding: 14px 16px;
  text-align: right;
  font-size: 14px;
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.admin-table tr:hover { background: #f8f9fa; }
.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-pending { background: #fef9e7; color: #d68910; }
.badge-published { background: #d5f5e3; color: #1e8449; }
.badge-rejected { background: #fadbd8; color: #922b21; }

/* ===== COMPETITION PAGE ===== */
.muqabla-hero {
  background: linear-gradient(135deg, var(--gold), #e67e22);
  color: white;
  padding: 60px 0;
  text-align: center;
}
.muqabla-hero h1 { font-size: 36px; margin-bottom: 15px; }
.muqabla-hero p { font-size: 18px; opacity: 0.9; }
.prize-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 30px 0;
}
.prize-card {
  background: white;
  border-radius: var(--radius);
  padding: 25px;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--gold);
}
.prize-icon { font-size: 48px; margin-bottom: 10px; }
.prize-amount { font-size: 28px; font-weight: 700; color: var(--gold); }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.85);
  padding: 50px 0 0;
  margin-top: 50px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  padding-bottom: 40px;
}
.footer-col h3 { color: white; font-size: 20px; margin-bottom: 12px; }
.footer-col h4 { color: white; font-size: 15px; margin-bottom: 12px; }
.footer-col p { font-size: 13px; line-height: 1.9; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a { font-size: 13px; color: rgba(255,255,255,0.75); }
.footer-col ul a:hover { color: var(--gold); }
.footer-social { display: flex; gap: 10px; margin-top: 12px; }
.footer-social a {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 13px; font-weight: 700;
}
.footer-social a:hover { background: var(--gold); }
.footer-bottom {
  background: rgba(0,0,0,0.2);
  text-align: center;
  padding: 15px;
  font-size: 13px;
}

/* ===== SEARCH PAGE ===== */
.search-page { padding: 30px 0; }
.search-hero {
  background: white;
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}
.search-hero h2 { color: var(--primary); margin-bottom: 20px; }
.search-big {
  display: flex;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
}
.search-big input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid var(--primary);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 16px;
  direction: rtl;
}
.search-big button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 15px;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  background: white;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb span { color: var(--text-muted); margin: 0 8px; }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px 0;
}
.pagination a {
  padding: 8px 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}
.pagination a:hover, .pagination a.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
  .hero-grid { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .article-detail-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .main-nav {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background: rgba(21, 67, 96, 0.98);
    z-index: 9999;
    padding: 80px 20px 20px;
    overflow-y: auto;
  }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s ease;
  }
  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }
  .main-nav ul li a {
    display: block;
    padding: 16px 20px;
    font-size: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: white;
  }
  .main-nav ul li a:hover {
    background: rgba(255,255,255,0.15);
    padding-right: 30px;
  }
  .header-actions { display: none; }
  .mobile-menu-btn {
    display: block;
    position: relative;
    z-index: 10000;
    font-size: 26px;
    padding: 5px 10px;
  }
  .articles-grid { grid-template-columns: 1fr; }
  .prize-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-grid { gap: 15px; }
  .auth-box { padding: 25px 20px; }
  .header-inner { position: relative; }
}