/* ================================================================
   کراد میرور — طراحی الهام‌گرفته از crowdfa.ir
   فونت وزیرمتن، پالت teal، کارت‌های گرد با هاور بالارونده
   ================================================================ */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --teal-800: #115e59;
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --slate-50: #f8fafc;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --danger: #dc2626;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --radius-3xl: 1.75rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--slate-50);
  color: var(--gray-700);
  font-size: 15px;
  line-height: 1.7;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container, .section-container {
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

.section { padding-block: 2.5rem 1rem; }
.muted { color: var(--gray-500); }
.tiny { font-size: 11px; }
.small { font-size: 12px; }
.ltr { direction: ltr; text-align: left; }
.accent { color: var(--teal-600); }
.empty { padding: 2rem 1rem; text-align: center; }

h1, h2, h3, h4 { color: var(--gray-800); line-height: 1.5; }

/* ---------------------------------------------------- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; padding: .55rem 1.15rem;
  border-radius: 9999px; border: 1px solid var(--gray-200);
  background: #fff; color: var(--gray-700);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .25s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.btn:hover { background: var(--gray-100); }
.btn.primary {
  background: var(--teal-600); border-color: var(--teal-600); color: #fff;
}
.btn.primary:hover { background: var(--teal-700); border-color: var(--teal-700); }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; }
.btn.mini { padding: .3rem .8rem; font-size: 12px; }
.btn.block { width: 100%; }
.inline { display: inline-flex; }

/* ---------------------------------------------------- header ---- */
.site-header {
  position: fixed; inset-inline: 0; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--gray-100);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding-block: .8rem;
}
.brand { display: flex; align-items: center; gap: .45rem; }
.brand-logo { height: 42px; width: auto; }
.brand-mark {
  font-size: 1.25rem; font-weight: 900; color: var(--teal-800);
  padding: .3rem .85rem; background: var(--teal-50);
  border-radius: var(--radius-lg);
}
.brand-mark.alt { color: #fff; background: var(--teal-600); }
.main-nav { display: flex; align-items: center; gap: 1.7rem; font-size: 14px; }
.main-nav a {
  color: var(--gray-700); padding-bottom: 4px;
  border-bottom: 2px solid transparent; transition: color .2s;
}
.main-nav a:hover { color: var(--teal-700); }
.main-nav a.active {
  color: var(--teal-800); font-weight: 700;
  border-bottom-color: var(--teal-800);
}
.header-auth { display: flex; gap: .5rem; }
.user-menu { position: relative; }
.user-chip {
  padding: .45rem 1rem; border-radius: 9999px; cursor: pointer;
  background: var(--teal-50); color: var(--teal-800); font-weight: 700;
  font-size: 13px;
}
.user-dropdown {
  position: absolute; top: calc(100% + 10px); inset-inline-start: 0;
  min-width: 11rem; background: #fff; border: 1px solid var(--gray-100);
  border-radius: var(--radius-2xl); box-shadow: 0 10px 30px rgba(0,0,0,.08);
  padding: .5rem; display: none; flex-direction: column; gap: 2px;
}
.user-menu:hover .user-dropdown, .user-menu:focus-within .user-dropdown { display: flex; }
.user-dropdown a {
  padding: .55rem .8rem; border-radius: .8rem; font-size: 13px;
}
.user-dropdown a:hover { background: var(--teal-50); color: var(--teal-700); }
.user-dropdown a.danger { color: var(--danger); }
.user-dropdown a.danger:hover { background: #fef2f2; }
main { padding-top: 72px; min-height: 60vh; }

/* ------------------------------------------------------ hero ---- */
.hero {
  background: linear-gradient(180deg, var(--teal-50) 0%, var(--slate-50) 100%);
  padding: 4rem 0 3rem; text-align: center;
}
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 900; margin: 0 0 .6rem;
}
.hero .lead { max-width: 42rem; margin: 0 auto 1.6rem; font-size: 15px; }
.hero-actions {
  display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap;
}
.hero-search {
  display: flex; max-width: 34rem; margin: 1.6rem auto 0;
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: 9999px; padding: .35rem; box-shadow: 0 8px 24px rgba(13,148,136,.10);
}
.hero-search input {
  flex: 1; border: 0; outline: 0; padding: .5rem 1.1rem;
  font-family: inherit; font-size: 14px; background: transparent; color: var(--gray-800);
}
.hero-stats {
  display: flex; gap: 2.6rem; justify-content: center; margin-top: 2rem;
  flex-wrap: wrap;
}
.hero-stats div { text-align: center; }
.hero-stats b {
  display: block; font-size: 1.7rem; font-weight: 900; color: var(--teal-800);
}

/* designer credit (about page) */
.designer-panel h2 {
  display: flex; align-items: center; gap: .55rem;
}
.designer-panel h2::before {
  content: ''; width: 4px; height: 18px; border-radius: 9999px;
  background: var(--teal-800); display: inline-block;
}

/* hero designer box (legacy, unused) */
.designer-box {
  display: inline-block; margin-top: 2.2rem; padding: .9rem 1.6rem;
  background: rgba(255, 255, 255, .75); backdrop-filter: blur(8px);
  border: 1px solid var(--teal-100); border-radius: var(--radius-2xl);
  box-shadow: 0 6px 20px rgba(13, 148, 136, .08);
}
.designer-box b { color: var(--teal-800); font-size: 14px; }
.designer-box p {
  margin: .35rem 0 0; font-size: 12.5px; color: var(--gray-600);
  line-height: 2.1;
}
.tel-link {
  display: inline-block; padding: .25rem .9rem; margin-inline-start: .3rem;
  border-radius: 9999px; background: var(--teal-600); color: #fff;
  font-weight: 700; letter-spacing: 1px; direction: ltr;
}
.tel-link:hover { background: var(--teal-700); }

/* --------------------------------------------- section heads ---- */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.4rem;
}
.section-head h2 {
  display: flex; align-items: center; gap: .55rem; margin: 0;
  font-size: 1.2rem; font-weight: 800;
}
.section-head h2::before {
  content: ''; width: 4px; height: 20px; border-radius: 9999px;
  background: var(--teal-800); display: inline-block;
}
.section-head .link { color: var(--teal-600); font-size: 13px; font-weight: 700; }
.section-head .link:hover { color: var(--teal-700); }

/* ------------------------------------------------------ grid ---- */
.grid.cards {
  display: grid; gap: 1.4rem;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}

/* --------------------------------------------- project cards ---- */
.project-card {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--gray-100);
  border-radius: var(--radius-3xl); overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
  transition: box-shadow .3s ease, transform .3s ease;
}
.project-card:hover {
  box-shadow: 0 20px 40px rgba(15, 23, 42, .12);
  transform: translateY(-4px);
}
.card-media { position: relative; aspect-ratio: 16 / 10; background: var(--gray-100); }
.card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s ease;
}
.project-card:hover .card-media img { transform: scale(1.05); }
.card-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.45), transparent 55%);
  pointer-events: none;
}
.card-media .badge {
  position: absolute; z-index: 2; bottom: .7rem;
  background: #fff; color: var(--gray-800);
  font-size: 10px; font-weight: 700;
  padding: .25rem .65rem; border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.card-media .badge.status { inset-inline-end: .7rem; }
.card-media .badge.platform { inset-inline-start: .7rem; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-media .badge.status-collecting { background: var(--teal-600); color: #fff; }
.card-media .badge.status-finished { background: #fff; color: var(--gray-800); }
.card-media .badge.status-cancelled { background: var(--danger); color: #fff; }
.media-fallback {
  width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; font-size: 2rem; font-weight: 900;
  color: var(--teal-600); background: var(--teal-50);
}
.media-fallback.big { font-size: 4rem; aspect-ratio: 16/9; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 1.2rem; gap: 1rem; }
.card-title {
  margin: 0; font-size: 15px; font-weight: 700; color: var(--gray-800);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 3rem; line-clamp: 2;
}
.card-title a:hover { color: var(--teal-600); }
.metric-row { display: flex; align-items: center; justify-content: space-between; }
.metric { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.metric.main { align-items: flex-start; }
.metric-label { font-size: 10px; color: var(--gray-400); }
.metric-value { font-size: 13px; color: var(--gray-800); font-weight: 600; }
.metric-value.accent {
  color: var(--teal-600); font-size: 26px; font-weight: 900; line-height: 1.2;
}
.metric-value.accent small, .metric-value.accent .unit {
  font-size: 13px; font-weight: 700;
}
.metric-value.small { font-size: 12px; text-align: center; max-width: 9rem; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .9rem; font-size: 12px; }
.facts > div { display: flex; flex-direction: column; gap: .1rem; }
.facts b { color: var(--gray-800); font-weight: 600; font-size: 12.5px; }
.progress-wrap { display: flex; flex-direction: column; gap: .35rem; }
.progress-meta { display: flex; justify-content: space-between; font-size: 11px; }
.progress-track {
  height: 8px; background: var(--gray-100); border-radius: 9999px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 9999px;
  background: linear-gradient(90deg, var(--teal-600), #14b8a6);
  transition: width .6s ease;
}
.card-links { display: flex; gap: .5rem; margin-top: auto; }
.card-links .btn { flex: 1; }

/* ------------------------------------------------------ panels -- */
.panel {
  background: #fff; border: 1px solid var(--gray-100);
  border-radius: var(--radius-2xl); padding: 1.4rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04); margin-bottom: 1.4rem;
}
.panel h2 { margin: 0 0 1rem; font-size: 1.05rem; font-weight: 800; }
.panel.row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.panel table { width: 100%; border-collapse: collapse; font-size: 13px; }
.panel th {
  text-align: right; color: var(--gray-500); font-weight: 600;
  padding: .55rem .6rem; border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.panel td { padding: .6rem; border-bottom: 1px solid var(--gray-100); }
.panel tr:last-child td { border-bottom: 0; }
.panel tr:hover td { background: var(--slate-50); }
.panel tr.off td { opacity: .45; }
.flash {
  background: var(--emerald-50); border: 1px solid var(--emerald-100);
  color: #065f46; padding: .6rem 1rem; border-radius: .9rem;
  font-size: 13px; margin-bottom: .8rem;
}

/* --------------------------------------------------- filter bar - */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  background: #fff; border: 1px solid var(--gray-100);
  border-radius: var(--radius-2xl); padding: .8rem 1rem; margin-bottom: 1.4rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.filter-bar input[type="text"], .filter-bar select, .filter-bar input:not([type]) {
  border: 1px solid var(--gray-200); border-radius: .9rem;
  padding: .5rem .9rem; font-family: inherit; font-size: 13px;
  outline: none; min-width: 10rem; background: #fff; color: var(--gray-800);
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--teal-600); }

/* ------------------------------------------------ detail page -- */
.detail-card {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 1.6rem;
  background: #fff; border: 1px solid var(--gray-100);
  border-radius: var(--radius-3xl); padding: 1.6rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05); margin-top: 1.2rem;
}
.detail-media { border-radius: var(--radius-2xl); overflow: hidden; background: var(--gray-100); }
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-body h1 { font-size: 1.35rem; font-weight: 800; margin: .8rem 0 1.1rem; }
.badges { display: flex; gap: .5rem; flex-wrap: wrap; }
.badges .badge { position: static; }
.facts.four { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.facts.four > div {
  background: var(--slate-50); border-radius: var(--radius-lg);
  padding: .7rem .9rem;
}
.description { margin-top: 1.4rem; }
.description h2 { font-size: 1rem; font-weight: 800; margin: 0 0 .7rem; }
.description p { font-size: 14px; color: var(--gray-600); }
.link { color: var(--teal-600); font-weight: 600; }
.link:hover { color: var(--teal-700); }
.link.back { display: inline-block; font-size: 13px; }

/* --------------------------------------------------- platforms -- */
.platform-card { display: flex; align-items: center; gap: .9rem; padding: 1.1rem; }
.platform-card img, .platform-card .media-fallback {
  width: 52px; height: 52px; border-radius: .9rem; object-fit: contain;
  background: var(--teal-50); flex-shrink: 0;
}

/* --------------------------------------------------- pagination - */
.pagination { display: flex; gap: .35rem; justify-content: center; margin: 1.6rem 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 2.2rem; height: 2.2rem; display: inline-flex; align-items: center;
  justify-content: center; border-radius: .8rem; font-size: 13px;
  border: 1px solid var(--gray-200); background: #fff; padding: 0 .5rem;
}
.pagination a:hover { border-color: var(--teal-600); color: var(--teal-700); }
.pagination a.current { background: var(--teal-600); color: #fff; border-color: var(--teal-600); }

/* --------------------------------------------------- forms ----- */
form.stack input, form.stack select {
  width: 100%; border: 1px solid var(--gray-200); border-radius: .9rem;
  padding: .65rem .9rem; font-family: inherit; font-size: 14px; margin-bottom: .9rem;
}
.auth-card {
  max-width: 24rem; margin: 2rem auto; background: #fff;
  border: 1px solid var(--gray-100); border-radius: var(--radius-2xl);
  padding: 1.8rem; box-shadow: 0 8px 30px rgba(15, 23, 42, .07);
  display: flex; flex-direction: column; gap: .8rem;
}
.auth-card h1 { font-size: 1.2rem; font-weight: 800; margin: 0 0 .3rem; text-align: center; }
.auth-card input {
  border: 1px solid var(--gray-200); border-radius: .9rem;
  padding: .65rem .9rem; font-family: inherit; font-size: 14px; outline: none;
}
.auth-card input:focus { border-color: var(--teal-600); }
.post-card {
  display: flex; flex-direction: column; gap: .5rem; padding: 1.2rem;
  background: #fff; border: 1px solid var(--gray-100);
  border-radius: var(--radius-2xl); box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: box-shadow .3s, transform .3s;
}
.post-card:hover { box-shadow: 0 16px 34px rgba(15,23,42,.1); transform: translateY(-3px); }

/* --------------------------------------------------- faq ------- */
.faq details {
  background: #fff; border: 1px solid var(--gray-100);
  border-radius: var(--radius-xl); padding: 1rem 1.2rem; margin-bottom: .7rem;
}
.faq summary { font-weight: 700; cursor: pointer; color: var(--gray-800); }

/* --------------------------------------------------- footer ---- */
.site-footer {
  margin-top: 4rem; background: #fff; border-top: 1px solid var(--gray-100);
  padding: 3.2rem 0 1.6rem;
}
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}
.footer-grid h4 {
  display: flex; align-items: center; gap: .5rem; margin: 0 0 .8rem;
  font-size: 15px; font-weight: 800;
}
.footer-grid h4::before {
  content: ''; width: 4px; height: 18px; border-radius: 9999px;
  background: var(--teal-800);
}
.footer-grid p { font-size: 13px; }
.footer-grid a { display: block; font-size: 13px; padding-block: .2rem; }
.footer-grid a:hover { color: var(--teal-600); }
.copyright { text-align: center; font-size: 12px; margin-top: 2rem; }

/* --------------------------------------------------- admin ----- */
body.admin { background: var(--slate-50); }
body.admin main { padding-top: 0; }
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 230px; flex-shrink: 0; position: sticky; top: 0;
  height: 100vh; display: flex; flex-direction: column;
  background: #fff; border-inline-start: 1px solid var(--gray-100);
  padding: 1.2rem 1rem; box-shadow: 0 0 24px rgba(15, 23, 42, .04);
}
.side-brand { display: flex; gap: .4rem; margin-bottom: 1.6rem; padding: .2rem .4rem; }
.side-nav { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.side-nav a {
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem .85rem; border-radius: .9rem;
  font-size: 13.5px; font-weight: 600; color: var(--gray-600);
  transition: all .2s;
}
.side-nav a svg { width: 19px; height: 19px; opacity: .75; flex-shrink: 0; }
.side-nav a:hover { background: var(--gray-100); color: var(--gray-800); }
.side-nav a.active {
  background: var(--teal-50); color: var(--teal-800);
  box-shadow: inset 0 0 0 1px var(--teal-100);
}
.side-nav a.active svg { opacity: 1; color: var(--teal-700); }
.side-foot { display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.admin-content { flex: 1; padding: 1.6rem 1.8rem; max-width: 1200px; }
.admin-content h1 { margin: 0 0 1.1rem; font-size: 1.3rem; font-weight: 800; }
@media (max-width: 860px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center; gap: .8rem;
    overflow-x: auto; padding: .6rem .8rem;
  }
  .side-brand { margin: 0; }
  .side-nav { flex-direction: row; gap: .2rem; }
  .side-nav a { padding: .45rem .7rem; white-space: nowrap; }
  .side-nav a svg { display: none; }
  .side-foot { flex-direction: row; margin-inline-start: auto; }
  .admin-content { padding: 1rem; }
}

/* chips */
.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .65rem; border-radius: 9999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.chip.ok { background: var(--emerald-50); color: #065f46; }
.chip.warn { background: #fef3c7; color: #92400e; }
.chip.err { background: #fee2e2; color: #991b1b; }
.chip.info { background: var(--teal-50); color: var(--teal-800); }
.chip.muted { background: var(--gray-100); color: var(--gray-500); }
.log-row-error td { background: #fff5f5; }
.log-row-warn td { background: #fffbeb; }

/* gradient stat cards */
.stat-cards.grad .stat-card {
  background: linear-gradient(135deg, var(--teal-600), #0f766e);
  border: 0; color: #fff;
}
.stat-cards.grad .stat-card b { color: #fff; }
.stat-cards.grad .stat-card span { color: rgba(255, 255, 255, .8); }
.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem; margin-bottom: 1.4rem;
}
.stat-card {
  background: #fff; border: 1px solid var(--gray-100);
  border-radius: var(--radius-xl); padding: 1rem; text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.stat-card b { display: block; font-size: 1.5rem; font-weight: 900; color: var(--teal-800); }
.stat-card span { font-size: 12px; color: var(--gray-500); }

/* --------------------------------------------------- responsive  */
@media (max-width: 900px) {
  .detail-card { grid-template-columns: 1fr; }
  .facts.four { grid-template-columns: repeat(2, 1fr); }
  .main-nav { display: none; }
}
@media (max-width: 560px) {
  .hero-stats { gap: 1.4rem; }
  .facts { grid-template-columns: 1fr; }
}
