/* فونت‌ها و ریست */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* ======= استایل اصلی هدر ======= */
.header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* ======= نسخه دسکتاپ ======= */
.desktop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
}

.mobile-header {
    display: none;
}

.search-bottom-mobile {
    display: none;
}

/* استایل‌های دسکتاپ موجود شما */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 2;
    max-width: 450px;
    margin-left: 0;
}

.logo {
    display: flex;
    flex-direction: column;
    min-width: 140px;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.logo-link:hover .logo-main {
    color: #008f45;
}

.logo-main {
    font-size: 24px;
    font-weight: bold;
    color: #00a650;
    font-family: 'Lalezar', cursive;
    transition: color 0.3s ease;
}

.logo-sub {
    font-size: 12px;
    color: #666;
    margin-top: -2px;
}

/* منوهای دسکتاپ */
.province-dropdown, .projects-dropdown, .category-dropdown {
    position: relative;
}

.dropdown-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: color 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-btn:hover {
    color: #00a650;
}

.gps-icon {
    margin-left: 5px;
    width: 14px;
    height: 14px;
    object-fit: contain;
    filter: brightness(0.7);
    transition: filter 0.3s ease;
}

.dropdown-btn:hover .gps-icon {
    filter: brightness(1);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1001;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 5px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.province-item, .project-item, .category-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f8f8f8;
    transition: all 0.2s ease;
    gap: 10px;
}

.province-item:hover, .project-item:hover, .category-item:hover {
    background: #f0f9f0;
    color: #00a650;
}

.province-item.active, .project-item.active {
    background: #00a650;
    color: white;
}

.item-arrow {
    margin-left: 5px;
    font-size: 14px;
    color: #666;
    transition: transform 0.2s ease;
}

.province-item:hover .item-arrow,
.project-item:hover .item-arrow,
.category-item:hover .item-arrow {
    transform: translateX(3px);
    color: #00a650;
}

.province-item.active .item-arrow,
.project-item.active .item-arrow {
    color: white;
}

/* دسته‌بندی در دسکتاپ */
.category-item.parent-category {
    font-weight: 600;
    background-color: #f8f9fa;
    border-left: 3px solid #00a650;
}

.category-item.child-category {
    font-weight: normal;
    padding-right: 25px;
    font-size: 13px;
    color: #555;
    border-left: 2px solid #e0e0e0;
}

.category-item.child-category:hover {
    background: #f0f9f0;
    color: #00a650;
    border-left-color: #00a650;
}

/* بخش‌های دیگر دسکتاپ */
.header-center {
    flex: 1;
    max-width: 400px;
    margin: 0 15px;
}

.search-box {
    display: flex;
    background: white;
    border: 1px solid #00a650;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    box-shadow: 0 0 0 2px rgba(0, 166, 80, 0.1);
}

.search-box input {
    flex: 1;
    border: none;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
    background: transparent;
}

.search-btn {
    background: rgba(0, 166, 80, 0.1);
    border: none;
    padding: 10px 15px;
    color: #00a650;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: rgba(0, 166, 80, 0.2);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 2;
    justify-content: flex-end;
    max-width: 400px;
    margin-right: 0;
    margin-left: 20px;
}

.guest-menu, .user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.login-btn, .register-btn, .dashboard-btn, .logout-btn, .help-btn {
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-btn {
    border: 1.5px solid #00a650;
    color: #00a650;
    background: transparent;
}

.login-btn:hover {
    background: #00a650;
    color: white;
}

.register-btn {
    background: #00a650;
    color: white;
    border: 1.5px solid #00a650;
}

.register-btn:hover {
    background: #008f45;
    border-color: #008f45;
}

.dashboard-btn {
    background: #f8f8f8;
    color: #333;
    border: 1.5px solid #e0e0e0;
}

.dashboard-btn:hover {
    background: #e8e8e8;
    border-color: #d0d0d0;
}

.logout-btn {
    background: #ff4444;
    color: white;
    border: 1.5px solid #ff4444;
}

.logout-btn:hover {
    background: #dd3333;
    border-color: #dd3333;
}

.help-btn {
    color: #666;
    border: 1.5px solid transparent;
    padding: 10px 15px;
}

.help-btn:hover {
    color: #00a650;
    background: #f8fff8;
    border-color: #e0f0e0;
}

.guest-help-btn {
    border: 1.5px solid #00a650 !important;
    color: #00a650 !important;
    background: transparent !important;
}

.guest-help-btn:hover {
    background: #00a650 !important;
    color: white !important;
}

.user-help-btn {
    background: #f8f8f8 !important;
    color: #333 !important;
    border: 1.5px solid #e0e0e0 !important;
}

.user-help-btn:hover {
    background: #e8e8e8 !important;
    border-color: #d0d0d0 !important;
}

.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-left: 15px;
}

.welcome-text {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

.user-name {
    font-size: 14px;
    font-weight: bold;
    color: #00a650;
    background: #f0f9f0;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.user-buttons .dashboard-btn,
.user-buttons .logout-btn,
.user-buttons .user-help-btn {
    padding: 8px 12px !important;
    font-size: 12px !important;
    min-width: 70px;
}

/* ======= نسخه موبایل ======= */
@media (max-width: 768px) {
    .desktop-header {
        display: none;
    }
    
    .mobile-header {
        display: block;
        padding: 8px 10px;
    }
    
    .search-bottom-mobile {
        display: block;
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 95%;
        max-width: 400px;
        z-index: 1000;
    }
    
    .search-bottom-mobile .search-box {
        width: 100%;
        border-radius: 25px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        background: white;
        border: 1px solid #00a650;
    }
    
    .search-bottom-mobile .search-box input {
        padding: 12px 20px;
        font-size: 14px;
        background: transparent;
    }
    
    .search-bottom-mobile .search-btn {
        padding: 12px 20px;
        border-radius: 0 25px 25px 0;
        background: #00a650;
        color: white;
    }
    
    /* خط اول موبایل */
    .header-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 10px;
        margin-bottom: 8px;
    }
    
    .mobile-header .logo {
        flex: 1;
        min-width: 0;
    }
    
    .mobile-header .logo-main {
        font-size: 16px;
    }
    
    .mobile-header .logo-sub {
        font-size: 9px;
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .header-menus {
        display: flex;
        gap: 5px;
        flex-shrink: 0;
    }
    
    .mobile-header .dropdown-btn {
        padding: 6px 8px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .mobile-header .gps-icon {
        width: 12px;
        height: 12px;
        margin-left: 3px;
    }
    
    /* خط دوم موبایل */
    .header-middle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 8px 0;
        border-top: 1px solid #f0f0f0;
        border-bottom: 1px solid #f0f0f0;
        margin-bottom: 8px;
        min-height: 35px;
    }
    
    .welcome-section {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .mobile-header .welcome-text {
        font-size: 11px;
        color: #666;
        margin: 0;
    }
    
    .mobile-header .user-name {
        font-size: 11px;
        font-weight: bold;
        color: #00a650;
        background: #f0f9f0;
        padding: 3px 6px;
        border-radius: 4px;
        white-space: nowrap;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }
    
    /* دکمه مشاهده مشاور */
    .view-project-btn-mobile {
        background: #e8f5e8;
        color: #2d774d;
        padding: 6px 10px;
        border-radius: 6px;
        text-decoration: none;
        font-size: 11px;
        white-space: nowrap;
        font-weight: 500;
        border: 1px solid #c8e6c9;
        display: flex;
        align-items: center;
        gap: 5px;
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .view-project-btn-mobile:hover {
        background: #d4edda;
        border-color: #b7dfb7;
    }
    
    /* خط سوم موبایل */
    .header-bottom {
        display: flex;
        justify-content: center;
        width: 100%;
    }
    
    .mobile-header .guest-menu,
    .mobile-header .user-menu {
        display: flex;
        gap: 8px;
        width: 100%;
        justify-content: center;
    }
    
    .mobile-header .login-btn,
    .mobile-header .register-btn,
    .mobile-header .dashboard-btn,
    .mobile-header .logout-btn,
    .mobile-header .help-btn {
        padding: 8px 12px !important;
        font-size: 11px !important;
        min-width: 70px;
    }
    
    /* منوهای موبایل */
    .dropdown-content {
        display: none;
        position: fixed;
        top: 35%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 250px;
        max-height: 350px;
        border-radius: 12px;
        background: white;
        border: 1px solid #e0e0e0;
        box-shadow: 0 15px 30px rgba(0,0,0,0.25);
        z-index: 1003;
        overflow-y: auto;
        animation: modalFadeIn 0.3s ease;
    }
    
    @keyframes modalFadeIn {
        from {
            opacity: 0;
            transform: translate(-50%, -50%) scale(0.8);
        }
        to {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
    }
    
    .mobile-header .province-item,
    .mobile-header .project-item,
    .mobile-header .category-item {
        display: flex;
        align-items: center;
        padding: 12px 15px;
        font-size: 13px;
        border-bottom: 1px solid #f5f5f5;
        gap: 8px;
    }
    
    .mobile-header .category-item.parent-category {
        font-weight: 600;
        background-color: #f8f9fa;
        border-left: 3px solid #00a650;
    }
    
    .mobile-header .category-item.child-category {
        font-weight: normal;
        padding-right: 25px;
        font-size: 12px;
        color: #555;
        border-left: 2px solid #e0e0e0;
    }
}

/* Overlay برای منوها */
.dropdown-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 1002;
    backdrop-filter: blur(2px);
}









/* ======= استایل‌های دکمه ارتقا به مشاور ======= */

/* دکمه ارتقا در دسکتاپ */
.upgrade-section {
    margin-right: 10px;
    flex-shrink: 0;
}

.upgrade-btn {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #ff6b35, #ff8e35);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    border: none;
    cursor: pointer;
    height: 36px;
}

.upgrade-btn:hover {
    background: linear-gradient(135deg, #ff5722, #ff7043);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    transform: translateY(-1px);
    color: white;
}

/* ======= ریسپانسیو برای موبایل ======= */
@media (max-width: 768px) {
    .search-bottom-mobile {
        position: fixed;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 350px;
        z-index: 1000;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .search-bottom-mobile .search-box {
        flex: 1;
        border-radius: 25px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        background: white;
        border: 1px solid #00a650;
        position: relative;
        min-height: 45px;
    }
    
    .search-bottom-mobile .search-box input {
        padding: 12px 45px 12px 15px;
        font-size: 14px;
        background: transparent;
        width: 100%;
        border: none;
        outline: none;
        border-radius: 25px;
    }
    
    .search-bottom-mobile .search-btn {
        position: absolute;
        left: 5px;
        top: 50%;
        transform: translateY(-50%);
        padding: 8px 10px;
        border-radius: 50%;
        background: #00a650;
        color: white;
        border: none;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
    }
    
    /* دکمه ارتقا در موبایل - کنار سرچ باکس */
    .upgrade-btn-mobile {
        display: flex;
        align-items: center;
        background: linear-gradient(135deg, #ff6b35, #ff8e35);
        color: white;
        text-decoration: none;
        padding: 8px 12px;
        border-radius: 20px;
        font-size: 11px;
        font-weight: 600;
        white-space: nowrap;
        transition: all 0.3s ease;
        box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
        z-index: 1001;
        border: 2px solid white;
        flex-shrink: 0;
        min-width: 80px;
        justify-content: center;
    }
    
    .upgrade-btn-mobile:hover {
        background: linear-gradient(135deg, #ff5722, #ff7043);
        box-shadow: 0 3px 8px rgba(255, 107, 53, 0.4);
        transform: scale(1.05);
        color: white;
    }
}

/* ======= بهبود نمایش در حالت‌های مختلف ======= */
@media (max-width: 480px) {
    .search-bottom-mobile {
        width: 95%;
        max-width: 320px;
        gap: 6px;
    }
    
    .search-bottom-mobile .search-box {
        min-height: 42px;
    }
    
    .search-bottom-mobile .search-box input {
        padding: 10px 40px 10px 12px;
        font-size: 13px;
    }
    
    .search-bottom-mobile .search-btn {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }
    
    .upgrade-btn-mobile {
        font-size: 10px;
        padding: 6px 10px;
        min-width: 70px;
    }
}


.dropdown-search {
    padding: 10px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.dropdown-search input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.dropdown-search input:focus {
    border-color: #00a650;
}



/* نسخه دسکتاپ – جلوگیری از خراب شدن توسط موبایل */
@media (min-width: 769px) {
    .dropdown-content {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
        transform: none !important;
        width: auto !important;
        max-height: 400px !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
        z-index: 1001 !important;
    }
}