/* =========================================
   1. Imports & Fonts
   ========================================= */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

/* =========================================
   2. CSS Variables (Theme Config)
   ========================================= */
:root {
    --bg-dark: #050505;
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    
    /* Neon Green Theme */
    --accent-color: #39ff14;
    --accent-glow: rgba(57, 255, 20, 0.5);
    
    /* Glass Effect Config */
    --glass-bg: rgba(20, 20, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --nav-height-mobile: 80px;
}

/* =========================================
   3. Base Setup
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Vazirmatn', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
    min-height: 100vh;
}

/* =========================================
   4. Custom Scrollbar
   ========================================= */
/* اسکرول اصلی صفحه */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
    border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* اسکرول جداول و لیست‌ها (باریک‌تر) */
.custom-scrollbar::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.02);
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* =========================================
   5. Aurora Background (Animation)
   ========================================= */
.aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* زیر تمام لایه‌ها */
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, #4f46e5 0%, transparent 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #059669 0%, transparent 70%);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 40%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
    opacity: 0.2;
    animation-duration: 15s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

/* =========================================
   6. Glassmorphism Utilities
   ========================================= */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

nav.glass {
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(20px);
}

/* =========================================
   7. Form Elements Styling
   ========================================= */
input, textarea, select {
    color-scheme: dark;
    transition: all 0.3s ease;
}

/* استایل اختصاصی برای Select Box (فلش سفید) */
select {
    appearance: none; /* حذف استایل پیش‌فرض */
    -webkit-appearance: none;
    -moz-appearance: none;
    
    /* فلش سفید سفارشی */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 1rem center; /* قرارگیری در سمت چپ (چون سایت راست‌چین است) */
    background-size: 1.2em;
    
    padding-left: 3rem !important; /* فضای خالی برای فلش */
    cursor: pointer;
}

/* استایل گزینه‌های داخل سلکت */
select option {
    background-color: #121212;
    color: #ffffff;
    padding: 12px;
}

/* حالت فوکوس برای تمام ورودی‌ها */
input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 2px var(--accent-color);
    border-color: transparent;
    background-color: rgba(0, 0, 0, 0.6);
}

/* =========================================
   8. Service Cards (Fixed Visibility)
   ========================================= */
.service-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* گرادینت برای وضوح روی زمینه مشکی */
    background: linear-gradient(145deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    
    z-index: 10;
}

.service-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px -5px rgba(57, 255, 20, 0.15);
    background: linear-gradient(145deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 100%);
}

.service-card h3 {
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.icon-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

/* =========================================
   9. Animations & Utilities
   ========================================= */
.text-gradient {
    background: linear-gradient(to right, #fff, #999);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.typed-cursor {
    color: var(--accent-color);
    font-size: 1em;
    font-weight: 200;
}

/* انیمیشن پالس کند برای قیمت */
@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
.animate-pulse-slow {
    animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-down {
    animation: fadeInDown 0.3s ease-out forwards;
}

.animate-fade-in {
    animation: fadeInDown 0.5s ease-out forwards;
}

/* سایه متن برای خوانایی */
.drop-shadow-2xl {
    filter: drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06));
    text-shadow: 0 0 20px rgba(0,0,0,0.8);
}

/* =========================================
   10. Markdown Content Styling
   ========================================= */
/* استایل‌دهی به متن‌های پیام که توسط Markdown رندر می‌شوند */
.markdown-content {
    color: #e5e5e5;
    line-height: 1.8;
    font-size: 0.9rem;
}

.markdown-content p {
    margin-bottom: 0.8rem;
}

.markdown-content strong {
    color: #fff;
    font-weight: 800;
}

.markdown-content em {
    color: var(--accent-color);
    font-style: italic;
}

.markdown-content h1, 
.markdown-content h2, 
.markdown-content h3 {
    color: #fff;
    font-weight: bold;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.2rem;
}

.markdown-content h1 { font-size: 1.4rem; }
.markdown-content h2 { font-size: 1.2rem; }
.markdown-content h3 { font-size: 1.1rem; }

.markdown-content ul, 
.markdown-content ol {
    margin-bottom: 1rem;
    padding-right: 1.5rem; /* RTL Padding */
}

.markdown-content ul {
    list-style-type: disc;
}

.markdown-content ol {
    list-style-type: decimal;
}

.markdown-content li {
    margin-bottom: 0.3rem;
}

.markdown-content blockquote {
    border-right: 3px solid var(--accent-color);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    font-style: italic;
    color: #a1a1aa;
}

.markdown-content code {
    background: rgba(0, 0, 0, 0.4);
    color: var(--accent-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.markdown-content pre {
    background: #111;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto; /* اسکرول افقی برای کد */
    margin: 1rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    direction: ltr; /* کد همیشه چپ‌چین */
    text-align: left;
}

.markdown-content pre code {
    background: transparent;
    color: #ccc;
    padding: 0;
    border: none;
}

.markdown-content a {
    color: var(--accent-color);
    text-decoration: underline;
    transition: color 0.2s;
}
.markdown-content a:hover {
    color: #fff;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.markdown-content th, 
.markdown-content td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px;
    text-align: right;
}

.markdown-content th {
    background: rgba(255, 255, 255, 0.05);
}

/* =========================================
   11. Mobile Responsive
   ========================================= */
@media (max-width: 768px) {
    body {
        padding-bottom: var(--nav-height-mobile);
    }
    
    .aurora-bg .blob {
        opacity: 0.2;
    }
}