/* Header Styles */
header {
    background-color: transparent;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

/* User pages usually need a background if not provided, distinct from home page transparency */
/* We can override this in home.ejs if needed, but 0.95 is safer general default */

.mainhead {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    text-decoration: none;
    color: #000;
    font-weight: 700;
    font-size: 1.5rem;
    font-family: 'Playfair', serif;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.subhead {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px 15px 20px;
    /* Added bottom padding */
}

.subhead nav ul {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.subhead li {
    margin: 0 15px;
    padding: 5px;
    /* Adjusted padding */
    position: relative;
    font-weight: 500;
    transition: all 0.3s ease;
}

.subhead li::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #000;
    transition: all 0.3s ease;
}

.subhead li:hover::after {
    width: 100%;
}

.subhead a {
    text-decoration: none;
    color: #000;
}

.active-nav {
    font-weight: 600;
}

.active-nav::after {
    content: '';
    position: absolute;
    width: 100% !important;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #000;
}

/* Buttons and Search Bar */
.buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.buttons img {
    height: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.buttons img:hover {
    transform: scale(1.15);
}

.buttons .searchBar,
.buttons input[type="text"] {
    width: 18rem;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.buttons .searchBar:focus,
.buttons input[type="text"]:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.buttons button {
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    background-color: #000;
    color: white;
    border: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.buttons button:hover {
    background-color: #4a4a4a;
    transform: translateY(-2px);
}

/* Profile Hover Modal */
.profile-container {
    position: relative;
    display: inline-block;
}

.profileImg {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
}

.profile-container .modal {
    display: none;
    position: absolute;
    top: 40px;
    right: 0;
    background-color: #ffffff;
    padding: 15px;
    border-radius: 8px;
    width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    border: 1px solid #eee;
}

.profile-container:hover .modal {
    display: block;
    opacity: 1;
}

.modal-content p {
    margin-bottom: 10px;
    font-size: 14px;
}

.modal-content ul {
    padding: 0;
    margin: 0;
}

.modal-content li {
    list-style: none;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    text-align: left;
    padding-left: 10px;
}

.modal-content li:last-child {
    border-bottom: none;
}

.modal-content li:hover {
    background-color: #f9f9f9;
    padding-left: 15px;
}

.modal-content a {
    text-decoration: none;
    color: #333;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .mainhead {
        flex-direction: column;
        gap: 10px;
    }

    .buttons .searchBar,
    .buttons input[type="text"] {
        width: 100%;
        max-width: 300px;
    }

    .subhead ul {
        flex-direction: row;
        gap: 10px;
    }

    .subhead li {
        margin: 0 5px;
    }
}