* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #0b0f19;
    color: #f8fafc;
    line-height: 1.6;
}

/* هیدر دو قطاره */
.navbar {
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
    top: 0;
    z-index: 99999;
}

.navbar-top {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 3%;
    border-bottom: 1px solid #1e293b;
}

.logo {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.logo span {
    color: #10b981;
}

.btn-pdf {
    background-color: #10b981;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-pdf:hover {
    background-color: #059669;
}

.navbar-bottom {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 2%;
    overflow: visible;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #cbd5e1;
    background: none;
    border: none;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 6px;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover, .nav-item:hover .nav-link {
    background-color: #1e293b;
    color: #10b981;
}

/* منوی آبشاری استاندارد */
.dropdown-menu {
    display: none;
    position: absolute;
    background-color: #0f172a;
    min-width: 260px;
    box-shadow: 0px 15px 35px rgba(0,0,0,0.9);
    border: 1px solid #334155;
    border-radius: 8px;
    z-index: 100000;
    top: 100%;
    left: 0;
    padding: 8px 0;
    max-height: 400px;
    overflow-y: auto;
}

/* برای منوهای سمت راست صفحه (جهت باز شدن به سمت داخل) */
.nav-item.right-dropdown .dropdown-menu {
    left: auto;
    right: 0;
}

.nav-item:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    color: #94a3b8;
    padding: 8px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.82rem;
    transition: background 0.2s, color 0.2s;
}

.dropdown-menu a:hover {
    background-color: #1e293b;
    color: #10b981;
    padding-left: 20px;
}

/* بخش هیرو و جستجو */
.hero-section {
    text-align: center;
    padding: 45px 20px 25px;
    background: linear-gradient(180deg, #0f172a 0%, #0b0f19 100%);
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: #f8fafc;
}

.hero-section p {
    color: #94a3b8;
    max-width: 700px;
    margin: 0 auto 20px;
    font-size: 0.9rem;
}

.search-box {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.search-box input {
    width: 100%;
    padding: 11px 18px 11px 45px;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-box input:focus {
    border-color: #10b981;
}

/* کارت‌های ابزارها */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 25px 20px;
    position: relative;
    z-index: 1;
}

.category-section {
    margin-bottom: 30px;
}

.category-section h2 {
    font-size: 1.1rem;
    color: #10b981;
    margin-bottom: 12px;
    border-left: 3px solid #10b981;
    padding-left: 10px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.tool-card {
    background-color: #121826;
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, border-color 0.2s, background-color 0.2s;
}

.tool-card:hover {
    border-color: #10b981;
}

.tool-card h3 {
    font-size: 0.88rem;
    color: #f8fafc;
    font-weight: 600;
    margin-bottom: 4px;
}

.tool-card p {
    font-size: 0.76rem;
    color: #94a3b8;
    line-height: 1.3;
}

/* بخش‌های پایانی و فوتر */
.content-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    border-top: 1px solid #1e293b;
}

.container-text h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #fff;
}

.container-text p, .container-text h4 {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.faq-item {
    margin-top: 12px;
}

.faq-item h4 {
    color: #e2e8f0;
}

.footer {
    background-color: #07090f;
    border-top: 1px solid #1e293b;
    padding: 35px 20px 15px;
    margin-top: 40px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.footer-col h3 span {
    color: #10b981;
}

.footer-col h4 {
    margin-bottom: 10px;
    color: #fff;
    font-size: 0.9rem;
}

.footer-col p, .footer-col a {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    margin-bottom: 5px;
    font-size: 0.8rem;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: #10b981;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #1e293b;
    padding-top: 12px;
    color: #64748b;
    font-size: 0.75rem;
}


/* تنظیمات ریسپانسیو برای هیدر و منوهای بالا */
@media screen and (max-width: 1200px) {
    .navbar-bottom {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 10px !important;
        padding: 10px 15px !important;
    }
    .navbar-top {
        padding: 15px 20px !important;
    }
}

@media screen and (max-width: 768px) {
    .navbar-top {
        gap: 15px;
        text-align: center;
    }
    .navbar-bottom {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    .nav-item {
        width: 100%;
        text-align: center;
        line-height: 1;
    }
    .nav-link {
        display: block;
        width: 100%;
    }
    /* تنظیم منوی آبشاری در حالت موبایل */
    .dropdown-menu {
        position: static !important;
        box-shadow: none !important;
        background: #192237 !important;
        width: 100% !important;
        max-height: 200px;
        overflow-y: auto;
    }
    .btn-pdf{
            padding: 5px 12px;
            font-weight: 200;
            font-size: 0.60rem;
    }
}


/* تنظیمات ریسپانسیو هوشمند برای تمامی ابزارها */
@media (max-width: 900px) {
    .calculator-grid {
        grid-template-columns: 1fr !important;
    }
}



/* ================================================= */
/* سیستم طراحی عمومی و ریسپانسیو برای تمام ابزارها     */
/* ================================================= */

/* کادر اصلی فرم ابزارها */
.tool-card {
    background: #121826;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 35px;
    max-width: 750px;
    margin: 0 auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    text-align: left;
}

/* گروه‌بندی ورودی‌ها */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
}

/* استایل یکپارچه برای تمام Inputها و Selectها */
.input-group input, 
.input-group select {
    width: 100%;
    background: #0b0f19;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px 15px;
    color: #fff;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box; /* جلوگیری از به هم ریختگی پهنا با پدینگ */
}

.input-group input:focus, 
.input-group select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* استایل یکپارچه برای دکمه محاسبه */
.btn-calculate {
    display: block;
    width: 100%;
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
    margin-top: 25px;
    text-align: center;
}

.btn-calculate:hover {
    background: #059669;
}

.btn-calculate:active {
    transform: scale(0.99);
}

/* بخش نمایش نتیجه */
.result-box {
    background: #192237;
    border: 1px dashed #334155;
    border-radius: 8px;
    padding: 25px;
    margin-top: 30px;
    text-align: center;
    word-break: break-all; /* جلوگیری از سرریز شدن اعداد بزرگ در موبایل */
}

.result-box h3 {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.result-value {
    color: #10b981;
    font-size: 2rem;
    font-weight: 700;
}

/* ================================================= */
/* تنظیمات واکنش‌گرا (Responsive) برای موبایل و تبلت */
/* ================================================= */
@media screen and (max-width: 768px) {
    .calculator-grid {
            grid-template-columns: 1fr !important;
            gap: 20px !important;
    }
    .tool-card {
        padding: 20px; /* کاهش حاشیه داخلی در صفحه کوچک */
        margin: 0 10px;
    }
    
    .result-value {
        font-size: 1.5rem; /* کوچک‌تر شدن اندازه فونت نتیجه در موبایل برای خوانایی بهتر */
    }
    
    .main-container {
        padding: 20px 10px !important;
    }
}


/* اصلاح فرم‌های داخلی بدهی‌ها در صفحات کوچک */
@media (max-width: 600px) {
    .inputs-section div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}
