/* ============================================================
   پرتال جامع وب‌سایت‌های استان زنجان - Estedad + بنفش/زرد
   ============================================================ */

@font-face {
    font-family: 'Estedad';
    src: url('https://cdn.landin.ir/assets/fonts/Estedad-Regular.ttf') format('truetype');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Estedad';
    src: url('https://cdn.landin.ir/assets/fonts/Estedad-Bold.ttf') format('truetype');
    font-weight: 700; font-style: normal; font-display: swap;
}

:root {
    --purple: #6b21a8;
    --purple-dark: #4c1d95;
    --purple-deep: #3b0764;
    --purple-light: #a855f7;
    --yellow: #facc15;
    --yellow-dark: #eab308;
    --bg: #faf5ff;
    --surface: #ffffff;
    --text: #1e1b4b;
    --text-muted: #6b7280;
    --border: #e9d5ff;
    --shadow: 0 4px 20px rgba(107, 33, 168, 0.07);
    --shadow-hover: 0 12px 32px rgba(107, 33, 168, 0.16);
    --radius: 16px;
    --radius-sm: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Estedad', 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
.header {
    background: linear-gradient(135deg, var(--purple-deep) 0%, var(--purple) 45%, #7e22ce 100%);
    color: #fff;
    padding: 3rem 1.5rem 3.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.header::before {
    content: '';
    position: absolute;
    top: -60%; left: -40%;
    width: 180%; height: 180%;
    background: radial-gradient(circle at 70% 30%, rgba(250, 204, 21, 0.13) 0%, transparent 55%);
    animation: float 18s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-30px, 25px) rotate(4deg); }
}
.header-content { position: relative; z-index: 1; max-width: 1000px; margin: 0 auto; }
.header-badge {
    display: inline-block;
    background: rgba(250, 204, 21, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(250, 204, 21, 0.4);
    padding: 0.45rem 1.5rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 1.25rem;
    color: var(--yellow);
}
.header h1 {
    font-size: clamp(1.7rem, 5vw, 2.7rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}
.stats-bar {
    display: flex; justify-content: center; gap: 3rem;
    margin-top: 1.5rem; flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-number {
    display: block; font-size: 2rem; font-weight: 700;
    color: var(--yellow); line-height: 1.2;
}
.stat-label { font-size: 0.78rem; opacity: 0.8; }

/* ===== Search ===== */
.search-wrap {
    max-width: 620px; margin: -1.6rem auto 0;
    padding: 0 1rem; position: relative; z-index: 5;
}
.search-box {
    display: flex; align-items: center;
    background: var(--surface);
    border-radius: 50px;
    box-shadow: 0 8px 30px rgba(107, 33, 168, 0.18);
    padding: 0.3rem 0.5rem 0.3rem 1.5rem;
    border: 2px solid transparent;
    transition: var(--transition);
}
.search-box:focus-within { border-color: var(--yellow); }
.search-box input {
    flex: 1; border: none; outline: none;
    font-family: inherit; font-size: 0.92rem;
    padding: 0.75rem 0; color: var(--text); background: transparent;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box button {
    background: var(--purple); color: #fff;
    border: none; border-radius: 50px;
    padding: 0.65rem 1.3rem;
    font-family: inherit; font-size: 0.83rem;
    font-weight: 700; cursor: pointer;
    transition: var(--transition); white-space: nowrap;
}
.search-box button:hover { background: var(--purple-dark); }

/* ===== Zanjan 360 ===== */
.z360-section { max-width: 1200px; margin: 2.5rem auto 0; padding: 0 1.25rem; }
.z360-card {
    display: flex; align-items: center; gap: 1.75rem;
    background: linear-gradient(135deg, var(--purple-deep) 0%, var(--purple) 50%, #9333ea 100%);
    border-radius: var(--radius);
    padding: 2rem 2rem;
    text-decoration: none; color: #fff;
    position: relative; overflow: hidden;
    box-shadow: 0 15px 45px rgba(107, 33, 168, 0.35);
    transition: var(--transition);
}
.z360-card::before {
    content: '';
    position: absolute; top: -50%; right: -20%;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.22) 0%, transparent 70%);
    border-radius: 50%;
}
.z360-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 22px 55px rgba(107, 33, 168, 0.45);
}
.z360-logo {
    width: 100px; height: 100px;
    border-radius: 16px;
    object-fit: cover;
    background: #fff;
    padding: 4px;
    flex-shrink: 0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    position: relative; z-index: 1;
}
.z360-body { flex: 1; position: relative; z-index: 1; }
.z360-label {
    display: inline-block;
    background: var(--yellow); color: var(--purple-deep);
    font-size: 0.7rem; font-weight: 700;
    padding: 0.2rem 0.9rem;
    border-radius: 50px; margin-bottom: 0.5rem;
}
.z360-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.3rem; }
.z360-desc { font-size: 0.9rem; opacity: 0.9; line-height: 1.7; }
.z360-url {
    display: inline-block; margin-top: 0.5rem;
    font-size: 0.82rem; font-weight: 500;
    color: var(--yellow); direction: ltr;
}
.z360-arrow {
    font-size: 2rem; color: var(--yellow);
    flex-shrink: 0; transition: var(--transition);
    position: relative; z-index: 1;
}
.z360-card:hover .z360-arrow { transform: translateX(-8px); }

/* ===== Category Page Header ===== */
.cat-header {
    background: linear-gradient(135deg, var(--purple-deep) 0%, var(--purple) 100%);
    color: #fff; padding: 2.5rem 1.5rem;
    text-align: center; position: relative; overflow: hidden;
}
.cat-header::before {
    content: '';
    position: absolute; top: -50%; right: -30%;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}
.cat-header h1 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 700;
    position: relative; z-index: 1;
}
.cat-header p {
    opacity: 0.9; margin-top: 0.5rem;
    position: relative; z-index: 1; font-size: 0.92rem;
}
.breadcrumb {
    max-width: 1200px; margin: 1rem auto 0;
    padding: 0 1.25rem; font-size: 0.8rem; color: var(--text-muted);
}
.breadcrumb a { color: var(--purple); text-decoration: none; font-weight: 700; }
.breadcrumb a:hover { text-decoration: underline; }

/* ===== Navigation ===== */
.nav-sticky {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 12px rgba(107, 33, 168, 0.05);
    margin-top: 2.5rem;
}
.nav-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: center;
    gap: 0.35rem; flex-wrap: wrap;
}
.nav-inner a {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.4rem 0.85rem;
    border-radius: 50px; text-decoration: none;
    color: var(--text-muted); font-size: 1rem; font-weight: 700;
    transition: var(--transition); white-space: nowrap;
}
.nav-inner a:hover, .nav-inner a.active {
    background: var(--purple); color: #fff;
}

/* ===== Main / Sections ===== */
.container {
    max-width: 1200px; margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}
.section { margin-bottom: 2.75rem; scroll-margin-top: 80px; }
.section-header {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 1.25rem; padding-bottom: 0.65rem;
    border-bottom: 3px solid var(--border);
}
.section-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex-shrink: 0; background: #f3e8ff;
}
.section-title {
    font-size: 1.25rem; font-weight: 700; color: var(--purple-dark);
}
.section-title a { color: inherit; text-decoration: none; }
.section-count {
    font-size: 0.72rem; color: var(--text-muted);
    font-weight: 400; background: var(--bg);
    padding: 0.1rem 0.6rem; border-radius: 50px; margin-right: 0.5rem;
}
.section-subtitle {
    font-size: 0.78rem; color: var(--text-muted); font-weight: 400;
}

/* ===== Cards ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
    gap: 0.8rem;
}
.card {
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 1rem 1.1rem;
    text-decoration: none; color: inherit;
    display: flex; align-items: flex-start; gap: 0.8rem;
    transition: var(--transition);
    position: relative; overflow: hidden;
}
.card::before {
    content: '';
    position: absolute; top: 0; right: 0;
    width: 4px; height: 100%; background: var(--yellow);
    transform: scaleY(0); transform-origin: top;
    transition: transform 0.3s ease;
}
.card:hover::before { transform: scaleY(1); }
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}
.card-avatar {
    width: 42px; height: 42px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; flex-shrink: 0; background: #f3e8ff;
}
.card-body { flex: 1; min-width: 0; }
.card-title {
    font-size: 0.86rem; font-weight: 700;
    margin-bottom: 0.1rem; color: var(--text); line-height: 1.4;
}
.card-desc {
    font-size: 0.72rem; color: var(--text-muted); line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.card-url {
    display: inline-block; margin-top: 0.25rem;
    font-size: 0.8rem; color: var(--purple-light);
    font-weight: 500; direction: ltr; text-align: left;
    word-break: break-all;
}
.card-arrow {
    flex-shrink: 0; color: var(--border);
    font-size: 0.95rem; transition: var(--transition);
    margin-top: 0.4rem;
}
.card:hover .card-arrow {
    color: var(--yellow-dark); transform: translateX(-4px);
}

/* ===== Form ===== */
.link-form-section { margin-top: 3rem; }
.link-form {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}
.form-group { display: flex; flex-direction: column; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
    font-size: 0.85rem; font-weight: 700;
    margin-bottom: 0.4rem; color: var(--text);
}
.form-group .req { color: #dc2626; }
.form-group .opt { color: var(--text-muted); font-weight: 400; font-size: 0.75rem; }
.form-group input,
.form-group select,
.form-group textarea {
    font-family: inherit; font-size: 0.9rem;
    padding: 0.7rem 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    transition: var(--transition);
    width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--purple);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(107, 33, 168, 0.1);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group input[dir="ltr"],
.form-group textarea[dir="ltr"] { text-align: left; }
.form-actions {
    margin-top: 1.5rem;
    display: flex; flex-wrap: wrap;
    align-items: center; gap: 1rem;
    justify-content: space-between;
}
.btn-submit {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
    color: #fff;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(107, 33, 168, 0.3);
}
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(107, 33, 168, 0.4);
    background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple-deep) 100%);
}
.form-note {
    font-size: 0.75rem; color: var(--text-muted);
    max-width: 480px; line-height: 1.6;
}
.form-note strong { color: var(--purple); direction: ltr; display: inline-block; }
.form-message {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    font-weight: 500;
    border-right: 4px solid;
}
.form-message.success {
    background: #ecfdf5; color: #065f46; border-color: #10b981;
}
.form-message.error {
    background: #fef2f2; color: #991b1b; border-color: #dc2626;
}

/* ===== Footer ===== */
.footer {
    background: var(--purple-deep);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 2.5rem 1.5rem;
    font-size: 0.82rem;
}
.footer strong { color: #fff; }
.footer .footer-note {
    margin-top: 0.65rem; font-size: 0.72rem; opacity: 0.55;
}

/* ===== Back to Top ===== */
.back-top {
    position: fixed; bottom: 2rem; left: 2rem;
    width: 42px; height: 42px;
    background: var(--yellow); color: var(--purple-deep);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; font-size: 1.1rem; font-weight: 700;
    box-shadow: 0 4px 16px rgba(250, 204, 21, 0.4);
    transition: var(--transition); z-index: 200;
    opacity: 0; pointer-events: none;
}
.back-top.visible { opacity: 1; pointer-events: auto; }
.back-top:hover { transform: translateY(-3px); background: #fde047; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .header { padding: 2rem 1rem 3rem; }
    .stats-bar { gap: 1.5rem; }
    .stat-number { font-size: 1.5rem; }
    .nav-inner { gap: 0.2rem; }
    .nav-inner a { padding: 0.3rem 0.55rem; font-size: 0.7rem; }
    .card-grid { grid-template-columns: 1fr; }
    .container { padding: 1.5rem 1rem 3rem; }
    .z360-card { flex-direction: column; text-align: center; padding: 1.75rem 1.5rem; gap: 1rem; }
    .z360-logo { width: 80px; height: 80px; }
    .z360-arrow { transform: rotate(90deg); }
    .z360-card:hover .z360-arrow { transform: rotate(90deg) translateX(-6px); }
    .search-box { padding: 0.2rem 0.4rem 0.2rem 1rem; }
    .search-box button { padding: 0.55rem 0.9rem; font-size: 0.75rem; }
    .form-grid { grid-template-columns: 1fr; }
    .link-form { padding: 1.25rem; }
    .form-actions { flex-direction: column; align-items: stretch; }
    .btn-submit { width: 100%; }
}
@media (min-width: 641px) and (max-width: 1024px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}