/* =============================================
   AFGHelp Template - Main Stylesheet
   ============================================= */

/* ---------------------------------------------
   ۱. Font Face - Vazirmatn
   --------------------------------------------- */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ---------------------------------------------
   ۲. Reset & Base
   --------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: #f8fbff;
    color: #08245c;
    line-height: 2;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 90%;
    max-width: 1180px;
    margin: auto;
}

/* ---------------------------------------------
   ۳. Header (بر اساس archive.html)
   --------------------------------------------- */
.header {
    height: 78px;
    background: linear-gradient(90deg, #001b4c, #062d73);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 45px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Logo */
.logo {
    background: white;
    color: #08245c;
    height: 64px;
    width: 275px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: inherit;
}

.logo .custom-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
}

.logo .custom-logo {
    max-width: 250px;
    max-height: 52px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.logo-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.logo strong {
    display: block;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.4;
}

.logo span {
    font-size: 10px;
    color: #64748b;
    display: block;
    line-height: 1.4;
}

/* Navigation */
.nav {
    display: flex;
    gap: 38px;
    font-size: 14px;
    font-weight: 600;
}

.nav ul {
    display: flex;
    gap: 38px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav li {
    position: relative;
}

.nav a {
    color: white;
    display: block;
    transition: color 0.2s;
}

.nav a:hover {
    color: #1d6df2;
}

.nav .current-menu-item a,
.nav .current_page_parent a,
.nav a.active {
    border-bottom: 3px solid #1d6df2;
}
/* Submenu */
.nav li {
    position: relative;
}

.nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 200px;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,.15);
    padding: 8px 0;
    z-index: 999;
    flex-direction: column;
    gap: 0;
}

.nav li:hover > .sub-menu {
    display: flex;
}

.nav .sub-menu li {
    border-bottom: 1px solid #f1f5f9;
}

.nav .sub-menu li:last-child {
    border-bottom: none;
}

.nav .sub-menu a {
    color: #08245c;
    padding: 10px 18px;
    display: block;
    font-size: 13px;
    white-space: nowrap;
    border-bottom: none !important;
}

.nav .sub-menu a:hover {
    background: #f1f5f9;
    color: #0058e6;
}
/* Dark Mode Toggle */
.dark-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 5px 8px;
    border-radius: 6px;
    transition: background 0.2s;
    line-height: 1;
}

.dark-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}
/* Nested submenu (level 2) */
.nav .sub-menu .sub-menu {
    top: -8px;
    right: 100%;
}

@media (max-width: 900px) {
    .nav .sub-menu {
        position: static;
        display: none;
        background: rgba(255,255,255,.05);
        box-shadow: none;
        border-radius: 0;
        padding: 0 10px;
    }

    .nav li:hover > .sub-menu,
    .nav .sub-menu.active {
        display: flex;
    }

    .nav .sub-menu a {
        color: white;
        padding: 10px 15px;
        font-size: 13px;
    }

    .nav .sub-menu li {
        border-bottom: 1px solid rgba(255,255,255,.1);
    }
}
/* Search Icon */
.search-icon {
    font-size: 23px;
    cursor: pointer;
    flex-shrink: 0;
}

.search-icon a {
    color: white;
    transition: color 0.2s;
}

.search-icon a:hover {
    color: #1d6df2;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 26px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 5px;
    line-height: 1;
}

/* ---------------------------------------------
   ۴. Footer
   --------------------------------------------- */
.footer {
    margin-top: 55px;
    background: linear-gradient(90deg, #001b4c, #062d73);
    color: white;
    padding: 48px 80px 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 70px;
}

.footer h3 {
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 700;
}

.footer a,
.footer p {
    display: block;
    color: white;
    font-size: 14px;
    line-height: 2.2;
    opacity: 0.9;
}

.footer a:hover {
    opacity: 1;
    color: #1d6df2;
}

.footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Social Icons */
.social {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.social span,
.social a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: grid;
    place-items: center;
    font-size: 14px;
    transition: all 0.2s;
}

.social a:hover {
    background: #1d6df2;
    border-color: #1d6df2;
}

/* Copyright */
.copy {
    text-align: center;
    margin-top: 35px;
    font-size: 13px;
    opacity: 0.8;
}

/* ---------------------------------------------
   ۵. Responsive - Tablet & Mobile (۹۰۰px)
   --------------------------------------------- */
@media (max-width: 900px) {

    /* Header */
    .header {
        padding: 0 15px;
        height: 68px;
    }

    .logo {
        width: 230px;
        height: 54px;
        gap: 8px;
    }

    .logo-icon {
        width: 34px;
        height: 34px;
        font-size: 18px;
    }

    .logo strong {
        font-size: 16px;
    }

    .logo span {
        font-size: 9px;
    }

    /* Hide Desktop Nav */
    .nav {
        display: none;
        position: absolute;
        top: 78px;
        right: 0;
        left: 0;
        background: linear-gradient(90deg, #001b4c, #062d73);
        padding: 20px 15px;
        flex-direction: column;
        gap: 0;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }

    .nav.active {
        display: flex;
    }

    .nav ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav li:last-child {
        border-bottom: none;
    }

    .nav a {
        padding: 14px 10px;
        display: block;
        font-size: 15px;
    }

    .nav .current-menu-item a,
    .nav .current_page_parent a {
        border-bottom: none;
        color: #1d6df2;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 4px;
    }

    .nav a:hover {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 4px;
    }

    /* Show Menu Toggle */
    .menu-toggle {
        display: block;
    }

    /* Footer */
    .footer {
        padding: 35px 20px 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .social {
        justify-content: center;
    }
}

/* ---------------------------------------------
   ۶. Responsive - Small Mobile (۴۸۰px)
   --------------------------------------------- */
@media (max-width: 480px) {
    .header {
        padding: 0 10px;
        height: 60px;
    }

    .logo {
        width: 190px;
        height: 46px;
        gap: 6px;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
        font-size: 15px;
    }

    .logo strong {
        font-size: 14px;
    }

    .logo span {
        font-size: 8px;
    }

    .search-icon {
        font-size: 20px;
    }

    .footer {
        padding: 25px 15px 15px;
    }

    .footer h3 {
        font-size: 16px;
    }

    .footer a,
    .footer p {
        font-size: 13px;
    }
}



/* bale popup styles */
.popup-overlay.afghelp-popup {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 99999999999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        padding: 16px;
        font-family: inherit;
    }

    .popup-overlay.afghelp-popup.active {
        opacity: 1;
        visibility: visible;
    }

    .afghelp-popup .popup-container {
        background-color: #ffffff;
        border-radius: 24px;
        width: 100%;
        max-width: 380px;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 2rem 1.5rem 1.8rem;
        position: relative;
        transform: scale(0.9);
        transition: transform 0.3s ease;
        direction: rtl;
    }

    .popup-overlay.active .popup-container {
        transform: scale(1);
    }

    .afghelp-popup .popup-icon {
        width: 70px;
        height: 70px;
        
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 1.5rem;
    }

    .afghelp-popup .popup-icon img {
        width: 40px;
        height: 40px;
    }

    .afghelp-popup .popup-title {
        font-size: 16px;
        font-weight: 700;
        color: #1a1a2e;
        margin-bottom: 0.75rem;
        line-height: 1.4;
    }

    .afghelp-popup .popup-description {
        font-size: 13px;
        color: #4a4a6a;
        margin-bottom: 2rem;
        line-height: 1.8;
        padding: 0 5px;
    }

    .afghelp-popup .btn-popup-primary {
        background: linear-gradient(135deg, #0066ff, #0052cc);
        border: none;
        color: white !important;
        font-size: 14px;
        font-weight: 600;
        padding: 0.8rem 2rem;
        border-radius: 50px;
        width: 100%;
        cursor: pointer;
        margin-bottom: 0.8rem;
        transition: all 0.2s ease;
        box-shadow: 0 8px 16px rgba(0, 102, 255, 0.25);
        text-decoration: none;
        display: inline-block;
    }

    .afghelp-popup .btn-popup-primary:hover {
        background: linear-gradient(135deg, #0052cc, #003d99);
        transform: translateY(-2px);
        box-shadow: 0 12px 20px rgba(0, 102, 255, 0.35);
    }

    .afghelp-popup .btn-popup-secondary {
        background: transparent;
        border: none;
        color: #888;
        font-size: 11px;
        font-weight: 500;
        padding: 0.6rem 1rem;
        cursor: pointer;
        transition: color 0.2s ease;
        text-decoration: none;
    }

    .afghelp-popup .btn-popup-secondary:hover {
        color: #333;
    }
