/* میهن مدرک — استایل سفارشی (نسخه MySQL) */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --emerald-50: #ecfdf5;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --emerald-800: #065f46;
    --emerald-900: #064e3b;
    --emerald-950: #022c22;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --amber-600: #d97706;
}

/* اصلاح سلکتور box-sizing */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Vazirmatn', system-ui, sans-serif;
    background: #fefdfb;
    color: #0f2a1f;
    margin: 0;
    direction: rtl;
}

/* جلوگیری از زوم خودکار در iOS */
input, select, textarea {
    font-size: 16px !important;
}

/* Gradient text */
.text-gradient-emerald {
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.text-gradient-gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Glass */
.glass {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Grid pattern */
.bg-grid {
    background-image:
        linear-gradient(to right, rgba(5,150,105,0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(5,150,105,0.06) 1px, transparent 1px);
    background-size: 40px 40px;
}

.bg-dots {
    background-image: radial-gradient(rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Scrollbar */
.scroll-thin { scrollbar-width: thin; }
.scroll-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }
.scroll-thin::-webkit-scrollbar-thumb { background: rgba(5,150,105,0.3); border-radius: 999px; }

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
.animate-float { animation: float 6s ease-in-out infinite; }

@keyframes float-slow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-18px) rotate(2deg); }
}
.animate-float-slow { animation: float-slow 9s ease-in-out infinite; }

@keyframes ping {
    75%, 100% { transform: scale(2); opacity: 0; }
}
.animate-ping { animation: ping 1.5s cubic-bezier(0,0,0.2,1) infinite; }

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(50%); }
}
.animate-marquee { animation: marquee 40s linear infinite; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-up { animation: fadeInUp 0.6s ease-out both; }

/* Card hover */
.card-hover {
    transition: all 0.3s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(6,78,59,0.15);
}

/* Button */
.btn-primary {
    background: linear-gradient(135deg, #059669, #065f46);
    color: white;
    font-weight: 700;
    border-radius: 1rem;
    transition: all 0.3s;
    box-shadow: 0 10px 20px -5px rgba(6,78,59,0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(6,78,59,0.4);
}

/* Sticky footer */
.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.site-main { flex: 1; }

/* Accordion */
.accordion-item { transition: all 0.3s; }
.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.accordion-item.open .accordion-content { max-height: 500px; }

/* Lucide icon size helper */
.icon-sm { width: 1rem; height: 1rem; }
.icon-md { width: 1.25rem; height: 1.25rem; }
.icon-lg { width: 1.5rem; height: 1.5rem; }

/* Admin */
.admin-sidebar-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    text-align: right;
    font-size: 0.875rem;
    color: #022c22;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: transparent;
}
.admin-sidebar-link:hover { background: rgba(5,150,105,0.1); }
.admin-sidebar-link.active {
    background: #059669;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(5,150,105,0.3);
}

/* Chip و آیتم */
.city-chip {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    border-radius: 0.75rem;
    background: white;
    border: 1px solid rgba(6,78,59,0.08);
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: #022c22;
    font-weight: 500;
}
.city-chip .dot { width: 0.375rem; height: 0.375rem; border-radius: 9999px; background: #10b981; flex-shrink: 0; }

.field-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(6,78,59,0.08);
    background: white;
    padding: 0.75rem 1rem;
    text-align: right;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.field-item:hover { border-color: rgba(5,150,105,0.3); background: rgba(5,150,105,0.05); }
.field-item .dot-amber { width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: #f59e0b; flex-shrink: 0; }
.field-item span:last-child { font-size: 0.875rem; color: #022c22; font-weight: 500; }

.field-result-card { border-radius: 1rem; border: 1px solid rgba(6,78,59,0.1); background: white; padding: 1.25rem; }
.field-result-card h4 { font-weight: 700; color: #022c22; font-size: 0.875rem; margin-bottom: 0.75rem; }
.field-result-card .tags { display: flex; flex-wrap: wrap; gap: 0.375rem; }

/* Paginate */
.pag-btn { min-width: 2.5rem; height: 2.5rem; padding: 0 0.75rem; border-radius: 0.75rem; border: 1px solid rgba(6,78,59,0.1); background: white; color: #022c22; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.pag-btn.active { background: #059669; color: white; border-color: #059669; }
.pag-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Toast */
.toast { position:fixed; top:1rem; left:50%; transform:translateX(-50%) translateY(-100px); background:#065f46; color:white; padding:0.875rem 1.5rem; border-radius:0.75rem; box-shadow:0 10px 25px rgba(0,0,0,0.2); z-index:9999; transition:transform 0.3s; }
.toast.show { transform:translateX(-50%) translateY(0); }
.toast-error { background:#dc2626; }

/* line-clamp */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* جلوگیری از اسکرول افقی */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* ریسپانسیو برای نمایش زیر ۴۰۰px */
@media (max-width: 400px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Prose برای محتوای TinyMCE */
.prose { font-size: 1rem; line-height: 1.75; }
.prose p { margin-bottom: 1rem; }
.prose h1, .prose h2, .prose h3 { font-weight: 700; margin-top: 1.5rem; margin-bottom: 0.75rem; color: #022c22; }
.prose h1 { font-size: 1.5rem; }
.prose h2 { font-size: 1.25rem; }
.prose h3 { font-size: 1.125rem; }
.prose ul, .prose ol { margin-bottom: 1rem; padding-right: 1.5rem; }
.prose li { margin-bottom: 0.25rem; }
.prose a { color: #059669; text-decoration: underline; }
.prose blockquote { border-right: 3px solid #059669; padding-right: 1rem; margin: 1rem 0; color: #6b7280; font-style: italic; }
.prose img { max-width: 100%; height: auto; border-radius: 0.75rem; margin: 1rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.prose th, .prose td { border: 1px solid #e5e7eb; padding: 0.5rem; }
.prose th { background: #f9fafb; font-weight: 600; }
/* هدر هنگام اسکرول */
#site-header.scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

#site-header.scrolled nav a,
#site-header.scrolled a[href^="tel:"] {
    color: #022c22 !important;
}

#site-header.scrolled button {
    background: rgba(5, 150, 105, 0.05);
}
