/* =====================
   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;
}

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

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

.nav-links li a {
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

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

/* =====================
   User Circle & Dropdown
===================== */
.nav-user {
    position: relative;
    margin-left: 1rem;
    list-style: none;
}

/* Circle */
.user-circle {
    width: 40px;
    height: 40px;
    background-color: #4f46e5; /* purple */
    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; /* darker purple */
    transform: scale(1.05);
}

/* Dropdown menu hidden by default */
.user-menu {
    position: absolute;
    top: 50px; /* right under circle */
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    border-radius: 12px; /* rounded corners */
    min-width: 140px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    display: none; /* hidden initially */
    z-index: 1000;
    text-align: center;
    overflow: hidden; /* ensure corners aren't cut */
}

/* Show dropdown on hover */
.nav-user:hover .user-menu {
    display: block;
}

/* Logout button style */
.user-menu a {
    display: block;
    width: 100%;
    padding: 0.8rem 0; /* fills the full width */
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937; /* bright text */
    text-decoration: none;
    background-color: #f3f4f6;
    transition: background 0.2s ease;
    border-bottom: 1px solid #e5e7eb; 
    border-radius: 0; /* keep corners smooth on container */
}

/* Remove border for last child */
.user-menu a:last-child {
    border-bottom: none;
}

/* Hover effect for logout button */
.user-menu a:hover {
    background-color: #e5e7eb; /* only background changes */
    color: #1f2937; /* text color stays bright */
}

/* =====================
   Logout Modal
===================== */
#logout-modal {
    display: none; /* hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#logout-modal .modal-content {
    background: #fff;
    padding: 2rem 2.5rem;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    animation: fadeIn 0.3s ease-out;
}

#logout-modal p {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

#logout-close {
    padding: 0.7rem 1.6rem;
    font-size: 1rem;
    font-weight: 600;
    background-color: #f3f4f6;
    color: #1f2937;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

#logout-close:hover {
    background-color: #e5e7eb;
    transform: scale(1.05);
}

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