:root {
    --bg: #f5f7fa;
    --card: #ffffff;
    --header-bg: var(--card);
    --text: #1f2937;
    --muted: #6b7280;
    --accent: #3b82f6;
    --danger: #ef4444;
    --glass: rgba(0, 0, 0, 0.04);
    --code-bg: rgba(0, 0, 0, 0.03);
    --radius: 12px;
    --sans:
        "Vazir", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
        Arial;
    --mono:
        ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono",
        "Courier New", monospace;
}

[data-theme="dark"] {
    --bg: #0f1724;
    --header-bg: #0b1220;
    --card: #0b1220;
    --accent: #7dd3fc;
    --muted: #94a3b8;
    --text: #e6eef6;
}

[data-theme="dark"] hr {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

body {
    font-family: var(--sans);
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
    display: flex;
    flex-direction: column;
}

main {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background: #1e1e2f;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: #eaeaea;
    line-height: 1.8;
}

main p {
    margin-bottom: 1.2rem;
    text-align: justify;
}

main .meta {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 1.5rem;
}

main img {
    max-width: 100%;
    border-radius: 12px;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

main a {
    color: #4da3ff;
    text-decoration: none;
    border-bottom: 1px dashed #4da3ff;
    transition:
        color 0.3s,
        border-color 0.3s;
}

main a:hover {
    color: #82c0ff;
    border-color: #82c0ff;
}

main blockquote {
    border-right: 4px solid #4da3ff;
    padding: 0.8rem 1rem;
    margin: 1.5rem 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    font-style: italic;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    color: var(--text);
    letter-spacing: 0.2px;
}
h1 {
    font-size: 2rem;
}
h2 {
    font-size: 1.6rem;
}
h3 {
    font-size: 1.3rem;
}

p {
    margin: 1em 0;
    color: var(--text);
    font-size: 15px;
}

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

ul,
ol {
    margin: 1em 0;
    padding-left: 1.5em;
}
li {
    margin-bottom: 0.4em;
}

blockquote {
    margin: 1em 0;
    padding: 12px 14px;
    border-left: 4px solid var(--accent);
    background: var(--glass);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
}

code,
pre {
    font-family: var(--mono);
    background: var(--code-bg);
    border-radius: var(--radius);
    color: var(--text);
}
pre {
    padding: 12px;
    overflow-x: auto;
    font-size: 13px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
code {
    padding: 2px 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}
th,
td {
    padding: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}
th {
    background: var(--card);
    color: var(--accent);
    text-align: left;
}

header,
footer,
article,
aside,
main,
section,
details,
blockquote {
    padding: 1em;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--text);
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
}
nav li {
    display: inline;
}
nav a {
    color: var(--accent);
    text-decoration: none;
    padding: 8px 12px;
    transition: background 0.3s ease;
}
nav a:hover {
    background: rgba(59, 130, 246, 0.1);
    border-radius: 6px;
}

footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--card);
}
footer p {
    margin: 0;
    font-size: 0.9rem;
}
#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
}

strong {
    color: var(--accent);
    font-weight: 700;
    background: rgba(59, 130, 246, 0.08);
    padding: 2px 4px;
    border-radius: 4px;
}

small {
    font-size: 12px;
    color: var(--muted);
}

mark {
    background: rgba(59, 130, 246, 0.2);
    color: var(--text);
    padding: 2px 4px;
    border-radius: 4px;
}

abbr[title] {
    border-bottom: 1px dotted var(--muted);
    cursor: help;
}

address {
    font-style: normal;
    color: var(--muted);
    line-height: 1.5;
}

dl {
    margin: 1em 0;
}
dt {
    font-weight: bold;
    color: var(--accent);
}
dd {
    margin: 0 0 1em 1.5em;
    color: var(--muted);
}

form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
label {
    font-weight: 600;
    color: var(--text);
}
input,
textarea,
select {
    background: var(--glass);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    outline: none;
    transition:
        border 0.2s ease,
        background 0.2s ease;
}
input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.06);
}

button,
input[type="submit"],
input[type="button"] {
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.1s ease;
}
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: #2563eb;
}
button:active,
input[type="submit"]:active,
input[type="button"]:active {
    transform: scale(0.97);
}

details {
    background: var(--glass);
    border-radius: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}
details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--accent);
}
details[open] {
    background: rgba(0, 0, 0, 0.05);
}

audio,
video {
    max-width: 100%;
    outline: none;
    border-radius: 8px;
}

figure {
    margin: 1em 0;
    text-align: center;
}
figcaption {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
}

hr {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin: 2em 0;
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
        padding: 0;
    }
    header,
    footer,
    article,
    aside,
    section {
        padding: 0.8em;
    }
    nav ul {
        flex-direction: column;
        gap: 12px;
    }
    h1 {
        font-size: 1.6rem;
    }
    h2 {
        font-size: 1.3rem;
    }
    h3 {
        font-size: 1.1rem;
    }
    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
        width: 100%;
    }
    th {
        background: none;
        color: var(--accent);
    }
    td {
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
}

table, th, td {
  border: 1px solid #cbd5e1;
}

@media (max-width: 480px) {
    nav a {
        padding: 6px 10px;
        font-size: 14px;
    }
    input,
    textarea,
    select,
    button {
        font-family: inherit;
        font-size: 13px;
    }
}

.menu-toggle {
    display: none;
    font-size: 1.4rem;
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 8px 10px;
}

@media (max-width: 768px) {
    .trending-news {
        display: none;
    }
    nav ul {
        display: none;
        flex-direction: column;
        background: var(--card);
        padding: 0;
        gap: 10px;
        width: 100%;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transition:
            max-height 0.6s ease-in-out,
            opacity 0.6s ease-in-out,
            padding 0.6s ease-in-out;
        position: relative;
    }
    nav ul.show {
        display: flex;
        padding: 10px;
        max-height: 1000px;
        opacity: 1;
    }
    .menu-toggle {
        display: block;
        margin-left: auto;
        margin-right: 0;
        align-self: flex-end;
        font-size: 1.5rem;
        background: none;
        border: none;
        color: var(--accent);
        cursor: pointer;
        padding: 8px 12px;
    }
    header {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
    }
    nav h1,
    nav small {
        text-align: center;
    }
}

.layout {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.trending-news {
    width: 300px;
    background: var(--card);
    padding: 20px;
    border-radius: var(--radius);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.trending-news h3 {
    margin-top: 0;
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.trending-news ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trending-news li {
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(125, 211, 252, 0.05);
    border-radius: 6px;
    transition: background 0.2s ease;
}

.trending-news li:hover {
    background: rgba(125, 211, 252, 0.12);
}

.trending-news a {
    color: var(--accent);
    text-decoration: none;
    display: block;
}

.trending-news a:hover {
    text-decoration: underline;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition:
        background 0.3s ease,
        transform 0.2s ease;
}
.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
}
.btn-secondary {
    background: var(--glass);
    color: var(--accent);
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--accent);
    transition:
        background 0.3s ease,
        transform 0.2s ease;
}
.btn-secondary:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    background-color: #1e40af; /* آبی تیره و کمی جدی */
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition:
        background-color 0.3s ease,
        transform 0.2s ease;
}

.badge:hover {
    background-color: #1e3a8a; /* هاور کمی تیره‌تر */
    transform: translateY(-1px);
}

[data-theme="dark"] .badge {
    background-color: #1e40af;
    color: #e6eef6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.badge.warning {
    background-color: #dc2626; /* قرمز هشدار جذاب */
    color: #fff;
}

.badge.warning:hover {
    background-color: #991b1b; /* قرمز تیره‌تر هنگام هاور */
    transform: translateY(-1px);
}


.img-fit {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    display: block;
}

.img-fit:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.hero {
  text-align: center;
  padding: 5rem 1rem;
  background: #0f1724; /* تاریک و جذاب */
  color: #e6eef6;
  border-radius: 20px;
  margin-bottom: 3rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  background-image: linear-gradient(135deg, #0f1724 0%, #1e293b 100%);
}

[data-theme="light"] .hero h1 {
    color: #e6eef6; /* رنگ متن مناسب تم روشن */
}


.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.hero p {
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto 2rem auto;
  line-height: 1.6;
  color: #cbd5e1;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.btn-primary {
  background: #3b82f6;
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(59,130,246,0.4);
}

.btn-secondary {
  background: transparent;
  border: 2px solid #3b82f6;
  color: #3b82f6;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.btn-secondary:hover {
  background: #3b82f6;
  color: #fff;
  transform: translateY(-3px);
}


.news-grid,
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.news-card,
.featured-card {
    background: var(--card);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.news-card h3,
.featured-card h3 {
    margin-top: 0.8rem;
    font-size: 1.2rem;
}

.categories {
    text-align: center;
}
.cat-grid {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.newsletter {
    text-align: center;
    background: var(--card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.newsletter form {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.newsletter input[type="email"] {
    flex: 1;
    min-width: 240px;
}



/* کانتینر کارت‌های تیم */
.team-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center; /* وسط چین کردن کارت‌ها */
}

/* کارت اعضای تیم */
.team-card {
    width: 150px; /* اندازه کارت */
    background: var(--card);
    border: 1px solid #0e1d35;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-card:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.team-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 10px;
}

.team-card strong {
    display: block;
    margin-bottom: 4px;
    color: var(--accent);
}

.team-card small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

/* Responsive برای موبایل */
@media (max-width: 480px) {
    .team-card {
        width: 80%; /* هر کارت تقریباً کل عرض ردیف */
        margin: 0 auto 20px auto; /* وسط چین کردن کارت */
    }
}

.img-nav {
    max-width: 100%;
    border-radius: 12px;
    margin: 10px 0 2px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}


.hero {
  text-align: center;
  padding: 5rem 1rem;
  background: #0f1724; /* تاریک و جذاب */
  color: #e6eef6;
  border-radius: 20px;
  margin-bottom: 3rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  background-image: linear-gradient(135deg, #0f1724 0%, #1e293b 100%);
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.hero p {
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto 2rem auto;
  line-height: 1.6;
  color: #cbd5e1;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.btn-primary {
  background: #3b82f6;
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(59,130,246,0.4);
}

.btn-secondary {
  background: transparent;
  border: 2px solid #3b82f6;
  color: #3b82f6;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.btn-secondary:hover {
  background: #3b82f6;
  color: #fff;
  transform: translateY(-3px);
}


/* --- کارت ویژگی‌ها --- */
.featured-card {
  background: var(--card);
  padding: 1.5rem;
  border-radius: 16px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.featured-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.featured-card .card-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

/* --- دسته‌بندی‌ها --- */
.btn-category {
  background: linear-gradient(135deg, #3b82f6, #0a1f7a);
  color: #fff;
  padding: 10px 18px;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-category:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}

/* --- تیم --- */
.team-card {
  background: var(--card);
  border: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.team-card:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 22px rgba(0,0,0,0.25);
}

/* --- خبرنامه --- */
.newsletter {
  background: linear-gradient(135deg, #0a1f7a, #3b82f6);
  color: #fff;
  padding: 2.5rem;
  border-radius: 16px;
  text-align: center;
  margin-top: 2rem;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}
.newsletter input[type="email"] {
  border-radius: 30px;
  padding: 12px 16px;
  border: none;
  outline: none;
  font-size: 14px;
}
.newsletter button {
  border-radius: 30px;
  font-size: 14px;
  padding: 12px 20px;
  font-weight: bold;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 2rem 0;
}

/* کارت‌ها */
.featured-card {
  background: var(--card);
  padding: 1.5rem;
  border-radius: 16px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.featured-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.featured-card .card-icon {
  font-size: 3rem; /* بزرگتر و جذاب‌تر */
  margin-bottom: 12px;
}
.featured-card h3 {
  margin-bottom: 0.8rem;
}
.featured-card p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .featured-grid {
    grid-template-columns: 1fr; /* موبایل: هر کارت یک ردیف */
  }
}

.newsletter {
  background: #1e293b; /* تیره و هماهنگ با Hero */
  color: #e6eef6;
  padding: 3rem 1.5rem;
  border-radius: 20px;
  text-align: center;
  margin-top: 3rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

.newsletter h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.newsletter p {
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto 2rem auto;
  line-height: 1.6;
  color: #cbd5e1;
}

.newsletter form {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.newsletter input[type="email"] {
  flex: 1;
  min-width: 250px;
  padding: 12px 16px;
  border-radius: 30px;
  border: none;
  outline: none;
  font-size: 14px;
  background: #0f1724;
  color: #e6eef6;
}

.newsletter input[type="email"]::placeholder {
  color: #94a3b8;
}

.newsletter button {
  padding: 12px 24px;
  border-radius: 30px;
  background: #3b82f6;
  color: #fff;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.newsletter button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(59,130,246,0.4);
}

.white-list {
  list-style: disc; /* یا circle، square، هرچی دوست داری */
  padding-left: 1.5em;
  margin: 1em 0;
  color: #ffffff; /* متن سفید */
}

.white-list li {
  margin-bottom: 0.6em;
  color: #ffffff; /* متن سفید هر آیتم */
  line-height: 1.5;
}

.white-list li::marker {
  color: #ffffff; /* رنگ بولت‌ها هم سفید */
}


.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* دقیقا ۴ ستون */
    gap: 1.5rem;
    margin-top: 2rem;
}

.news-card {
    background: var(--card-bg, #1e1e1e);
    color: #fff;
    padding: 2rem 1.5rem;
    border-radius: 1.2rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.4);
}

.news-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.news-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.btn-news {
    display: inline-block;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.25s ease;
}

.btn-exit {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    background: #f87171;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.25s ease;
}

.btn-news:hover {
    background: rgba(255,255,255,0.25);
}

/* گرادیان‌های متنوع */
.gradient-0 { background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); }
.gradient-1 { background: linear-gradient(135deg, #1a2980, #26d0ce); }
.gradient-2 { background: linear-gradient(135deg, #373b44, #4286f4); }
.gradient-3 { background: linear-gradient(135deg, #42275a, #734b6d); }
.gradient-4 { background: linear-gradient(135deg, #000428, #004e92); }


@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr); /* تبلت → دو تا در ردیف */
    }
}

@media (max-width: 600px) {
    .news-grid {
        grid-template-columns: 1fr; /* موبایل → یکی در ردیف */
    }
}


.news-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-card {
    position: relative;
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #0b1220, #1e1e2f); /* هماهنگ با تم تیره سایت */
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.5);
    color: #e6eef6; /* متن روشن روی کارت تیره */
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.news-card:hover {
    transform: rotateY(3deg) rotateX(2deg);
    box-shadow: 0 12px 25px rgba(0,0,0,0.6);
}

.news-lock {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: var(--accent); /* رنگ قفل هماهنگ با رنگ سایت */
}

.news-card h3 {
    margin-top: 0;
    font-size: 1.3rem;
    font-weight: bold;
}

.news-card {
    background-color: #1e293b; /* رنگ پس‌زمینه کارت */
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: flex-start; /* متن و دکمه هم‌تراز */
    gap: 15px; /* فاصله بین متن و دکمه */
}

.news-content {
    display: flex;
    flex-direction: column;
    flex: 1; /* متن فضای بیشتر رو بگیره */
}

.news-text {
    font-size: 1rem;
    line-height: 1.4;
    color: #cbd5e1;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4; /* محدودیت به ۴ خط */
    -webkit-box-orient: vertical;
}

.btn-news {
    margin-top: 3px; /* کمی فاصله پایین متن */
    align-self: flex-start; /* دکمه کنار متن باقی بمونه */
    display: inline-block;
    padding: 10px 18px;
    background: linear-gradient(135deg, #3b82f6, #0a1f7a);
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}



.btn-news:hover {
    background: linear-gradient(135deg, #0a1f7a, #3b82f6); /* معکوس گرادیان روی هاور */
    box-shadow: 0 6px 18px rgba(59,130,246,0.6);
    transform: translateY(-2px);
}

/* ===== وسط‌چین کردن کل منو در دسکتاپ ===== */
@media (min-width: 769px) {

    header {
        display: flex;
        justify-content: center;
    }

    .header-container {
        width: 100%;
        max-width: 1200px; /* مثل layout سایتت */
        display: flex;
        justify-content: center;
    }

    nav ul {
        display: flex;
        justify-content: center;  /* این خط مهمه */
        align-items: center;
        gap: 20px;
        width: 100%;
    }

}

/* ================= LOGIN PAGE ================= */

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.auth-card {
    background: var(--card);
    padding: 2.5rem;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 35px rgba(0,0,0,0.6);
}

.auth-card h2 {
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 2rem;
}

.auth-card form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: right;
}

.auth-card input {
    background: var(--glass);
    border-radius: 8px;
    padding: 10px 12px;
}

.auth-btn {
    margin-top: 10px;
    width: 100%;
}

.auth-footer {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.auth-footer a {
    font-weight: 600;
}

/* ================= PROFILE PAGE ================= */

.profile-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1rem;
}

.profile-card {
    background: var(--card);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 35px rgba(0,0,0,0.6);
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 4px solid var(--accent);
}

.profile-header h2 {
    margin: 0.5rem 0;
    color: var(--accent);
}

.profile-username {
    color: var(--muted);
    font-size: 0.9rem;
}

.profile-info {
    margin-top: 2rem;
    text-align: right;
}

.profile-info h3 {
    margin-bottom: 0.8rem;
    color: var(--accent);
}

.profile-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profile-info li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    font-size: 14px;
    color: var(--text);
}

.profile-info li strong {
    color: var(--accent);
    margin-left: 10px;
}

.profile-actions {
    margin-top: 2rem;
}

.profile-actions .btn {
    font-family: inherit;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
}

/* Logout button */
.logout-btn {
    background: #f87171;
    color: #fff;
    border: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.logout-btn:hover {
    background: #991b1b;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 480px) {
    .profile-card {
        padding: 1.5rem;
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
    }

    .profile-info li {
        font-size: 13px;
    }
}

.dashboard-wrapper {
    display: flex;
    justify-content: center; /* ستون وسط وسط چین */
    align-items: flex-start;
    gap: 20px;
    margin-top: 2rem;
}

/* ستون وسط */
.main-column {
    flex: 0 0 900px; /* عرض ثابت ستون وسط */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ستون‌های جانبی */
.side-column {
    flex: 0 0 250px; /* عرض ستون‌های کناری */
    background: var(--card);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.side-column h3 {
    color: var(--accent);
    margin-top: 0;
}

/* لیست‌ها */
.news-list li,
.posts-list li {
    margin-bottom: 0.8rem;
    padding: 6px 10px;
    background: var(--glass);
    border-radius: 6px;
}

/* Responsive موبایل */
@media (max-width: 1200px) {
    .dashboard-wrapper {
        flex-direction: column;
        align-items: center;
    }
    .side-column,
    .main-column {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/*-=========================================================================*/


/* کانتینر اصلی */
.main-container {
    margin: 0 auto;
    max-width: 1200px;
    padding: 20px;
}


/* ستون محتوای اصلی */
.content {
    flex: 2; /* ستون محتوا کمی کمتر از قبل */
    min-width: 0;
}

/* ستون Trending */
.trending-news {
    flex: 1; /* ستون کناری کوچکتر */
    min-width: 250px;
    max-width: 300px;
}

/* ریسپانسیو */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
        padding: 10px;
    }

    .trending-news {
        max-width: 100%;
        margin-top: 20px;
    }
}



/* صفحات login و profile وسط چین بشن و ستون‌بندی اصلی غیرفعال بشه */
.auth-page, .profile-page {
    display: flex;
    justify-content: center;
    align-items: center; /* فقط برای login صفحه وسط چین */
    flex-direction: column;
    margin: 2rem;
}

/* اگر profile-card هم وسط نباشه */
.profile-page .profile-card {
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.form-error span {
    color: #dc2626; /* قرمز برای خطا */
    font-size: 0.85rem;
    margin-top: 4px;
}

/* پیام‌های خطا قرمز و کمی فونت کوچکتر */
.error {
    color: #dc2626; /* قرمز هشدار */
    font-size: 0.875rem;
    margin-top: 4px;
    line-height: 1.3;
}




.book-card {
    background: #0f172a;
    padding: 15px;
    border-radius: 16px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(4, 320px); /* عرض ثابت هر کارت */
    gap: 25px;
    justify-content: center; /* وسط‌چین شدن کارت‌ها */
}

/* تبلت */
@media (max-width: 1200px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* موبایل */
@media (max-width: 768px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* موبایل کوچک */
@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: 1fr;
    }
}