/* Common Navigation Styles - Shared between public and admin layouts */

/* ============ TOP BAR ============ */
.common-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #fff;
    border-bottom: 1px solid #ebebeb;
    z-index: 10001;
}

.topbar-container {
    max-width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 24px;
}

/* Logo */
.topbar-left {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #222;
    font-weight: 600;
    font-size: 18px;
}

.topbar-logo:hover {
    text-decoration: none;
    color: #222;
}

.topbar-logo img {
    max-height: 36px;
    width: auto;
}

/* Desktop Navigation */
.topbar-nav {
    display: flex;
    align-items: stretch;
    gap: 24px;
    flex: 1;
    justify-content: center;
    height: 100%;
}

.topbar-nav .nav-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 4px;
    color: #222;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s;
    white-space: nowrap;
    position: relative;
    height: 100%;
    background: none;
    border: none;
    cursor: pointer;
}

.topbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.15s;
}

.topbar-nav .nav-link:hover {
    color: #000;
    text-decoration: none;
}

.topbar-nav .nav-link:hover::after {
    background: #ddd;
}

.topbar-nav .nav-link.active {
    color: #000;
    font-weight: 600;
}

.topbar-nav .nav-link.active::after {
    background: #222;
}

.topbar-nav .nav-link i {
    font-size: 10px;
}

/* Dropdown Menu */
.nav-item-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: stretch;
}

.nav-item-dropdown > button {
    background: none;
    border: none;
    cursor: pointer;
    height: 100%;
}

.nav-item-dropdown > button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.15s;
}

.nav-item-dropdown:hover > button::after {
    background: #ddd;
}

.nav-item-dropdown > button.active::after {
    background: #222;
}

.nav-item-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 8px 0;
    display: block;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s;
    z-index: 100;
}

.nav-item-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: #484848;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.1s;
}

.dropdown-item:hover {
    background: #f7f7f7;
    text-decoration: none;
    color: #222;
}

.dropdown-item.active {
    background: #f0f0f0;
    color: #222;
    font-weight: 500;
}

/* Right Side */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    height: 100%;
}

/* Role Switcher */
.role-switcher {
    display: flex;
    background: #f7f7f7;
    border-radius: 20px;
    padding: 4px;
    gap: 4px;
}

.role-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    color: #717171;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.role-btn:hover {
    color: #222;
}

.role-btn.active {
    background: #fff;
    color: #222;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.role-btn i {
    font-size: 12px;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.15s;
}

.user-btn:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #717171;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #222;
}

.user-btn i {
    font-size: 10px;
    color: #717171;
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s;
    z-index: 100;
}

.user-menu.show {
    opacity: 1;
    visibility: visible;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #484848;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.1s;
}

.user-menu-item:hover {
    background: #f7f7f7;
    text-decoration: none;
    color: #222;
}

.user-menu-item i {
    width: 16px;
    text-align: center;
    color: #717171;
}

/* Auth Links */
.auth-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.auth-links a {
    color: #484848;
    text-decoration: none;
    transition: color 0.15s;
}

.auth-links a:hover {
    color: #222;
}

.auth-links .separator {
    color: #ddd;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #222;
}

.mobile-menu-btn:hover {
    background: #f7f7f7;
}

/* ============ MOBILE MENU ============ */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.mobile-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

.mobile-slide-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: #fff;
    z-index: 10003;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-slide-menu.open {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #ebebeb;
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-user-info .user-avatar {
    width: 40px;
    height: 40px;
}

.mobile-user-info .user-name {
    font-size: 16px;
    font-weight: 600;
}

.mobile-menu-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #717171;
    border-radius: 50%;
}

.mobile-menu-close:hover {
    background: #f7f7f7;
}

.mobile-menu-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: #484848;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.1s;
}

.mobile-nav-link:hover {
    background: #f7f7f7;
    text-decoration: none;
}

.mobile-nav-link.active {
    background: #f0f0f0;
    color: #222;
    font-weight: 600;
}

.mobile-nav-link i {
    width: 20px;
    text-align: center;
    color: #717171;
}

.mobile-nav-group {
    padding: 8px 0;
    border-bottom: 1px solid #ebebeb;
}

.mobile-nav-title {
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #717171;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-menu-footer {
    border-top: 1px solid #ebebeb;
    padding: 8px 0;
}

/* ============ MAIN CONTENT ============ */
.common-main {
    padding-top: 64px;
    min-height: 100vh;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 991px) {
    .topbar-container {
        padding: 0 16px;
    }
}

@media (max-width: 767px) {
    .common-topbar {
        height: 56px;
    }
    
    .common-main {
        padding-top: 56px;
    }
    
    .user-btn {
        padding: 4px;
        border: none;
    }
}

