/* ===== NAVBAR BASE ===== */
#navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 72px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-sizing: border-box;
    width: 100%;
    overflow: visible;

    background: linear-gradient(135deg,
        rgba(3,60,65,0.95) 0%,
        rgba(5,87,94,0.92) 40%,
        rgba(7,122,133,0.90) 70%,
        rgba(4,70,76,0.95) 100%
    );
    backdrop-filter: blur(18px) saturate(1.8);
    -webkit-backdrop-filter: blur(18px) saturate(1.8);
    border-bottom: 1px solid rgba(255,255,255,0.15);
    box-shadow:
        0 4px 24px rgba(0,0,0,0.35),
        0 1px 0 rgba(255,255,255,0.12) inset,
        0 -1px 0 rgba(0,0,0,0.2) inset;
}

#navbar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.5) 30%,
        rgba(15,184,200,0.8) 50%,
        rgba(255,255,255,0.5) 70%,
        transparent 100%
    );
}

/* ===== MENU BAR ===== */
#menu_bar {
    display: flex;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
    justify-content: flex-start;
    gap: 4px;
    list-style: none;
    margin: 0; padding: 0;
    overflow: hidden;
}

#menu_bar li a {
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.25s ease;
    white-space: nowrap;
    position: relative;
    display: block;
}

#menu_bar li a:hover {
    color: #fff;
    background: rgba(255,255,255,0.12);
    text-shadow: 0 0 12px rgba(15,184,200,0.6);
}

#menu_bar li a::after {
    content: '';
    position: absolute;
    bottom: 2px; left: 50%; right: 50%;
    height: 2px;
    background: #0fb8c8;
    border-radius: 2px;
    transition: left 0.25s ease, right 0.25s ease;
}

#menu_bar li a:hover::after { left: 12px; right: 12px; }

/* ===== LOGO ===== */
#nav_icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1010;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 100px;
    height: 80px;
    background: rgba(255,255,255,0.97);
    border-radius: 0 0 16px 16px;
    border: 1px solid rgba(255,255,255,0.6);
    border-top: none;
    box-shadow:
        0 6px 20px rgba(0,0,0,0.25),
        0 2px 6px rgba(0,0,0,0.15),
        0 1px 0 rgba(255,255,255,0.8) inset;
    padding: 2px 4px 4px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#nav_icon:hover {
    transform: translate(-50%, -50%) translateY(-2px);
    box-shadow:
        0 10px 28px rgba(0,0,0,0.3),
        0 3px 8px rgba(0,0,0,0.2),
        0 1px 0 rgba(255,255,255,0.8) inset;
}

#nav_icon img {
    display: block;
    width: 92px !important;
    height: 74px !important;
    min-height: 74px !important;
    max-width: 92px;
    object-fit: contain;
    filter: none !important;
}

/* ===== USER BAR ===== */
#user_bar {
    flex: 1 1 0 !important;
    max-width: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px;
    flex-wrap: nowrap !important;
    overflow: visible !important;
    height: 100%;
    min-width: 0;
}

/* ===== دکمه‌های ورود / ثبت‌نام ===== */
.log_re_nav {
    display: inline-flex !important;
    align-items: center;
    border-radius: 10px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    overflow: hidden;
    box-shadow:
        0 4px 14px rgba(0,0,0,0.25),
        0 1px 0 rgba(255,255,255,0.2) inset !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    border: 1px solid rgba(255,255,255,0.2) !important;
}

.log_re_nav:hover {
    transform: translateY(-2px);
    filter: brightness(1.12);
    box-shadow: 0 7px 20px rgba(0,0,0,0.3), 0 1px 0 rgba(255,255,255,0.25) inset !important;
}

.log_re_nav:active { transform: translateY(0); filter: brightness(0.97); }

#login_nav.log_re_nav {
    background: linear-gradient(135deg, #0fb8c8 0%, #0a9aa8 50%, #05575e 100%) !important;
    border-color: rgba(15,184,200,0.4) !important;
}

#register_nav.log_re_nav {
    background: linear-gradient(135deg, #34d974 0%, #22c55e 50%, #16a34a 100%) !important;
    border-color: rgba(52,217,116,0.4) !important;
}

#login_nav a,
#register_nav a {
    color: #fff !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
    padding: 7px 16px !important;
    font-size: 13px !important;
    text-decoration: none !important;
    display: block;
}

/* ===== فاصله محتوا ===== */
#content { padding-top: 88px !important; }

/* =========================================================
   RESPONSIVE — از تبلت تا کوچک‌ترین گوشی‌ها
   ترتیب: 900 → 768 → 600 → 480 → 400 → 340
   ========================================================= */

/* تبلت / لپ‌تاپ کوچک */
@media (max-width: 900px) {
    #nav_icon { width: 96px; height: 78px; padding: 2px 4px 4px; }
    #nav_icon img {
        width: 88px !important;
        height: 70px !important;
        min-height: 70px !important;
        max-width: 88px;
    }
}

/* تبلت عمودی / موبایل بزرگ */
@media (max-width: 768px) {
    #navbar { padding: 0 16px; }
    #menu_bar { gap: 2px; }
    #menu_bar li a { font-size: 13px; padding: 6px 10px; }
}

/* موبایل استاندارد */
@media (max-width: 600px) {
    #nav_icon {
        width: 72px; height: 62px;
        border-radius: 0 0 12px 12px;
        padding: 2px 3px 3px;
    }
    #nav_icon img {
        width: 66px !important;
        height: 56px !important;
        min-height: 56px !important;
        max-width: 66px;
    }
}

/* گوشی‌های هوشمند جدید (آیفون 12/13/14، گلکسی S، پیکسل: عرض 390-430) */
@media (max-width: 480px) {
    #navbar { padding: 0 10px; }

    #user_bar { gap: 5px; }

    #login_nav a,
    #register_nav a {
        padding: 6px 10px !important;
        font-size: 11.5px !important;
    }

    #menu_bar li a { font-size: 12px; padding: 5px 8px; }
}

/* گوشی‌های کوچک‌تر (آیفون SE، عرض حدود 375-400) */
@media (max-width: 400px) {
    #login_nav a,
    #register_nav a {
        padding: 5px 8px !important;
        font-size: 11px !important;
    }
    #user_bar { gap: 4px; }
}

/* گوشی‌های خیلی کوچک/قدیمی (کمتر از 340px) */
@media (max-width: 340px) {
    #navbar { padding: 0 6px; }

    #login_nav a,
    #register_nav a {
        padding: 4px 6px !important;
        font-size: 10px !important;
    }

    #user_bar { gap: 3px; }

    #menu_bar { display: none; } /* در عرض خیلی کم، منو مخفی و فقط لوگو + auth نمایش داده شود */
}
