
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0b1120; /* هماهنگ با پس‌زمینه تاریک ابزار */
    color: #e2e8f0;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ==========================================
   ۲. استایل هدر و باکس جستجو (Header & Search)
   ========================================== */
.site-header {
    background-color: #0d1b2a;
    padding: 12px 20px;
    position: relative;
    z-index: 1000;
    width: 100%;
    border-bottom: 3px solid #00b4d8;
}

.header-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
    position: relative;
    flex-wrap: nowrap;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo span {
    color: #00b4d8;
}

/* باکس سرچ */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #1b263b;
    border: 1px solid #415a77;
    border-radius: 6px;
    padding: 6px 12px;
    width: 240px;
    flex-shrink: 0;
}

.search-box:focus-within {
    border-color: #00b4d8;
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}

.search-box i {
    color: #00b4d8;
    font-size: 13px;
    margin-right: 8px;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 13px;
    width: 100%;
}

.search-box input::placeholder {
    color: #8d99ae;
}

/* نتایج جستجوی زنده */
.search-results {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background-color: #0f172a;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid #334155;
    z-index: 2000;
    max-height: 350px;
    overflow-y: auto;
}

.search-results ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-results li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    color: #e2e8f0;
    font-size: 14px;
    border-bottom: 1px solid #1e293b;
    transition: background-color 0.2s;
}

.search-results li:last-child a {
    border-bottom: none;
}

.search-results li a:hover {
    background-color: #1e293b;
    color: #00b4d8;
}

.search-results li a small {
    color: #94a3b8;
    font-size: 11px;
}

.search-results .no-result {
    padding: 12px 16px;
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
}

/* ==========================================
   ۳. نوار منوی اصلی و افقی (Navigation Bar)
   ========================================== */
.nav-menu {
    display: flex;
    align-items: center;
    flex-shrink: 1;
}

.main-menu {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}

.menu-item {
    position: static !important;
}

.menu-link {
    color: #ffffff;
    padding: 8px 12px;
    display: block;
    font-weight: 600;
    font-size: 12px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.menu-link:hover,
.menu-item:hover .menu-link {
    background-color: #00b4d8;
    color: #ffffff;
}

.menu-link i {
    font-size: 11px;
    margin-left: 3px;
}

/* ==========================================
   ۴. استایل مگامنو تمام‌صفحه (Full-Width Mega Menu)
   ========================================== */
.mega-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #0f172a;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    border-top: 3px solid #00b4d8;
    border-bottom: 1px solid #334155;
    z-index: 1005;
    padding: 30px 0;
    box-sizing: border-box;
    margin-top: 12px;
}

.mega-dropdown::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

.mega-dropdown-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between;
    gap: 20px;
    overflow-x: auto;
    max-height: 70vh;
}

.subcategory-column {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.menu-item:hover .mega-dropdown {
    display: block;
}

.subcategory-column h4 {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #334155;
    text-transform: uppercase;
}

.tools-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tools-list li a {
    font-size: 13.5px;
    color: #94a3b8;
    transition: color 0.2s, padding-left 0.2s;
    display: inline-block;
}

.tools-list li a:hover {
    color: #00b4d8;
    padding-left: 5px;
}

/* ==========================================
   ۵. بخش محتوا و صفحات داخلی (Main Content Container)
   ========================================== */
.page-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 35px;
    background: #0f172a;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #1e293b;
    line-height: 1.7;
    color: #e2e8f0;
}

.page-container h1 {
    font-size: 30px;
    margin-bottom: 20px;
    color: #ffffff;
    border-bottom: 3px solid #00b4d8;
    padding-bottom: 10px;
}

.page-container h2 {
    font-size: 20px;
    margin-top: 25px;
    margin-bottom: 12px;
    color: #ffffff;
}

.page-container p, .page-container ul {
    margin-bottom: 15px;
    font-size: 15px;
    color: #94a3b8;
}

.page-container ul {
    padding-left: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #cbd5e1;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #475569;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    background: #1e293b;
    color: #ffffff;
}

.form-group input:focus, 
.form-group textarea:focus {
    border-color: #00b4d8;
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}

.submit-btn {
    background-color: #00b4d8;
    color: #ffffff;
    padding: 12px 28px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.submit-btn:hover {
    background-color: #0077b6;
}

.welcome-section {
    text-align: center;
    margin-bottom: 40px;
}

.welcome-section h1 {
    font-size: 2.2rem;
    color: #ffffff;
    margin-bottom: 10px;
}

.welcome-section p {
    color: #94a3b8;
    font-size: 1.05rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.quick-categories {
    margin-bottom: 45px;
}

.quick-categories h2, .popular-tools h2 {
    font-size: 1.5rem;
    color: #ffffff;
    margin-bottom: 20px;
    border-bottom: 2px solid #334155;
    padding-bottom: 8px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.cat-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 25px 20px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cat-card i {
    font-size: 2.2rem;
    color: #00b4d8;
    margin-bottom: 12px;
}

.cat-card h3 {
    font-size: 1.15rem;
    color: #ffffff;
    margin-bottom: 6px;
}

.cat-card p {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0;
}

.cat-card:hover {
    transform: translateY(-5px);
    background: #0f172a;
    border-color: #00b4d8;
    box-shadow: 0 8px 20px rgba(0, 180, 216, 0.2);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.tool-btn {
    display: flex;
    align-items: center;
    background: #1e293b;
    border: 1px solid #475569;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #cbd5e1;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.2s ease;
}

.tool-btn i {
    color: #00b4d8;
    font-size: 1.1rem;
    margin-right: 6px;
}

.tool-btn:hover {
    background: #00b4d8;
    color: #ffffff;
    border-color: #00b4d8;
}

.tool-btn:hover i {
    color: #ffffff;
}

/* اسکرول‌بار مگامنو */
.mega-dropdown-inner::-webkit-scrollbar {
    width: 6px;
}

.mega-dropdown-inner::-webkit-scrollbar-track {
    background: #1e293b;
}

.mega-dropdown-inner::-webkit-scrollbar-thumb {
    background: #00b4d8;
    border-radius: 3px;
}

/* ==========================================
   ۶. استایل دکمه پرینت و حالت چاپ (Print & PDF Button)
   ========================================== */
.pdf-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background-color: #0284c7;
    color: white;
    border: none;
    padding: 0.5rem 0.9rem;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    margin-left: 10px;
    margin-right: 10px;
    vertical-align: middle;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.pdf-download-btn:hover {
    background-color: #0369a1;
}

/* فوتر مخصوص پرینت - در حالت عادی مخفی است */
.print-footer {
    display: none;
}

@media print {
    .print-footer {
        display: block !important;
        text-align: center;
        margin-top: 50px;
        font-family: Arial, sans-serif;
        border-top: 1px solid #cbd5e1;
        padding-top: 15px;
    }
    
    .print-footer p {
        margin: 5px 0;
        font-size: 13px;
    }
    
    .print-footer p:first-child {
        font-weight: bold;
        color: #0284c7;
        font-size: 14px;
    }

    .print-footer a {
        color: #64748b;
        text-decoration: none;
    }
}

/* ==========================================
   ۷. استایل فوتر اصلی سایت (Footer)
   ========================================== */
.site-footer {
    background-color: #0d1b2a;
    color: #e2e8f0;
    padding: 30px 20px;
    margin-top: 60px;
    border-top: 3px solid #00b4d8;
    text-align: center;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-links {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #00b4d8;
}

.copyright {
    font-size: 13px;
    color: #94a3b8;
}

.copyright strong {
    color: #ffffff;
}

/* ==========================================
   ۸. تنظیمات ریسپانسیو حرفه‌ای برای موبایل و تبلت
   ========================================== */
@media screen and (max-width: 1070px) {
    .header-container {
        flex-direction: column !important;
        align-items: center !important;
        padding: 12px !important;
    }

    .logo {
        text-align: center !important;
        width: 100% !important;
        margin-bottom: 4px;
    }

    .search-box {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 8px;
    }

    .search-box input {
        width: 100% !important;
    }

    .pdf-download-btn {
        width: 100% !important;
        max-width: 420px !important;
        margin: 5px auto !important;
        display: flex !important;
    }

    .nav-menu {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }

    .main-menu {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 5px !important;
        width: 100% !important;
        max-width: 420px !important;
        margin: 0 auto !important;
        padding: 0 !important;
        list-style: none !important;
        flex-direction: unset !important;
    }

    .menu-item {
        position: static !important;
        text-align: center !important;
    }

    .menu-link {
        display: block !important;
        padding: 6px 4px !important;
        font-size: 0.78rem !important;
        background: #1e293b !important;
        border-radius: 6px !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .mega-dropdown {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        box-sizing: border-box !important;
        padding: 12px 10px !important;
    }

    .mega-dropdown-inner {
        flex-direction: column !important;
        gap: 10px !important;
        max-height: 55vh !important;
        overflow-y: auto !important;
    }

    .subcategory-column {
        min-width: 100% !important;
    }
    
    .subcategory-column h4 {
        margin-bottom: 4px !important;
        font-size: 11px !important;
    }

    .tools-list {
        gap: 2px !important;
    }

    .tools-list li a {
        font-size: 10px !important;
        padding: 2px 0 !important;
    }
}

.topMptGrid a {
    font-size: 14px;
}
.topMptGrid i {
    margin-right: 10px;
}
.topmpt h2 {
    margin-top: 0px;
}
