/* =====================
   Header & Navigation
===================== */
header {
    background-color: #1a202c;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 40px;
}

.logo {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 30px;
    margin: 0;
    padding: 0;
    line-height: 1;
}

.nav-links li {
    list-style: none;
}

.nav-links li:first-child a {
    margin-left: 1rem;
}

.nav-links li a {
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    white-space: nowrap;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: #3b82f6;
}

/* Our Bots link — when admin: highlight */
.nav-links li a.nav-link-admin {
    color: #93c5fd;
    font-weight: 700;
}
.nav-links li a.nav-link-admin:hover {
    color: #bfdbfe;
}
/* =====================
   User Circle & Dropdown
===================== */
.nav-user {
    position: relative;
    margin-left: 1rem;
    list-style: none;
    display: flex;
    align-items: center;
}

.nav-user-avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.user-circle-admin-label {
    display: none;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: none;
    color: #fbbf24;
    line-height: 1;
}
.nav-user-avatar-wrap.is-admin .user-circle-admin-label {
    display: block;
}

.user-circle {
    width: 40px;
    height: 40px;
    background-color: #4f46e5;
    color: #fff;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
    font-size: 1rem;
}

.user-circle:hover {
    background-color: #3730a3;
    transform: scale(1.05);
}

/* User circle when logged in as admin */
.user-circle.user-circle-admin {
    background: linear-gradient(135deg, #b45309 0%, #d97706 50%, #f59e0b 100%);
    border: 2px solid rgba(251, 191, 36, 0.5);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(245, 158, 11, 0.3);
}
.user-circle.user-circle-admin:hover {
    background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
    border-color: rgba(251, 191, 36, 0.7);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(245, 158, 11, 0.4);
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    min-width: 240px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: none;
    z-index: 1001;
    overflow: hidden;
    padding: 8px 0;
}

.nav-user:hover .user-menu,
.user-menu.is-open {
    display: block;
}

.user-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: #1f2937;
    text-decoration: none;
    background: transparent;
    transition: background-color 0.15s ease;
    border: none;
    border-radius: 0;
    cursor: pointer;
    box-sizing: border-box;
}

.user-menu-item:hover {
    background-color: #f3f4f6;
}

.user-menu-item .user-menu-label {
    font-weight: 600;
    color: #1f2937;
}

.user-menu-item .user-menu-desc {
    font-size: 0.8rem;
    font-weight: 400;
    color: #6b7280;
    text-align: right;
    flex-shrink: 0;
}

.user-menu-item:hover .user-menu-desc {
    color: #4b5563;
}

/* Log Out — darker blue: positive, on-theme */
.user-menu-item.user-menu-logout .user-menu-label,
.user-menu-item.user-menu-logout .user-menu-desc {
    color: #2563eb;
    font-weight: 600;
}

.user-menu-item.user-menu-logout:hover {
    background-color: #dbeafe;
}

.user-menu-item.user-menu-logout:hover .user-menu-label,
.user-menu-item.user-menu-logout:hover .user-menu-desc {
    color: #1d4ed8;
}

.user-menu-divider {
    height: 1px;
    margin: 6px 0;
    background: #e5e7eb;
}

/* =====================
   Hamburger Button
===================== */
.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
    padding: 0;
}

.menu-toggle span {
    position: absolute;
    left: 8px;
    right: 8px;
    height: 3px;
    background-color: #e5e7eb;
    border-radius: 999px;
    transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease;
}

.menu-toggle span:nth-child(1) { top: 12px; }
.menu-toggle span:nth-child(2) { top: 19px; }
.menu-toggle span:nth-child(3) { top: 26px; }

.menu-toggle.open span:nth-child(1) {
    top: 19px;
    transform: rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
    top: 19px;
    transform: rotate(-45deg);
}

/* =====================
   Logout Modal
===================== */
.logout-modal-overlay,
#logout-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.logout-modal-overlay.is-open,
#logout-modal.is-open {
    display: flex;
}

.logout-modal-content,
#logout-modal .modal-content {
    background: #fff;
    padding: 1.75rem 2rem;
    border-radius: 12px;
    text-align: center;
    max-width: 360px;
    width: calc(100% - 2rem);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    animation: logoutModalFadeIn 0.25s ease-out;
}

#logout-modal p,
.logout-modal-content p {
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
    margin: 0 0 1.25rem;
    line-height: 1.5;
}

.logout-modal-btn,
#logout-close {
    padding: 0.6rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: #1a202c;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.logout-modal-btn:hover,
#logout-close:hover {
    background: #2d3748;
}

@keyframes logoutModalFadeIn {
    from { opacity: 0; transform: scale(0.97) translateY(-8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* =====================
   Mobile (≤768px)
===================== */
@media (max-width: 768px) {
    nav {
        position: relative;
        padding: 10px 16px;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin-top: 8px;
        padding: 0.75rem 0.75rem 0.9rem;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(6px);
        border-radius: 14px;
        box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        z-index: 1500;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li {
        list-style: none;
        margin: 0;
        width: 100%;
    }

    .nav-links li.hide-mobile {
        display: none;
    }

    .nav-links li + li:not(.nav-user):not(.hide-mobile) {
        margin-top: 0;
        padding-top: 0;
        border-top: 1px solid rgba(55, 65, 81, 0.6);
    }

    .nav-links li a {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0.6rem 0.9rem;
        border-radius: 10px;
        color: #e5e7eb;
        font-weight: 600;
        letter-spacing: 0.02em;
        text-decoration: none;
    }

    .nav-links li a:hover,
    .nav-links li a.active {
        background: rgba(37, 99, 235, 0.12);
        color: #3b82f6;
    }

    .nav-links li a.nav-link-admin {
        color: #93c5fd;
        font-weight: 700;
    }
    .nav-links li a.nav-link-admin:hover {
        background: rgba(37, 99, 235, 0.12);
        color: #bfdbfe;
    }

    .nav-user {
        margin-left: 0;
        margin-top: 0.6rem;
        padding-top: 0.6rem;
        border-top: 1px solid rgba(55, 65, 81, 0.6);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .nav-user-avatar-wrap {
        align-items: center;
    }

    .nav-user .user-circle {
        width: 36px;
        height: 36px;
    }

    .user-circle-admin-label {
        font-size: 0.55rem;
    }

    .user-menu {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        top: calc(100% + 8px);
        min-width: 220px;
    }
}

/* End of header styles */