/*
 * General Styles and Font
 */
:root {
    --primary-color: #1a0262;
    --secondary-color: #820b5c;
    --text-light: #fff;
    --text-dark: #333;
    --background-light: #f8f9fa;
    --border-color: #ddd;
    --active-color: linear-gradient(
        180deg,
        #1a0262 0%,
        #1a0262 50%,
        #820b5c 100%
    );
}

body {
    font-family: "Roboto", sans-serif;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
}

/*
 * Header Structure
 */
.perfect-header {
    background-color: var(--background-light);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 1rem 2rem;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
}

.header-top-row {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr; /* Defines the three-column layout */
    align-items: center;
    gap: 1rem;
}

.header-logo img {
    height: 70px;
    width: auto;
}

.header-center {
    justify-self: center; /* Centers the notice bar within its grid column */
}

.header-right {
    justify-self: end; /* Aligns the entire right section to the right */
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-title {
    text-align: right;
    display: flex;
    gap: 10px;
}

.header-title-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1.2;
    margin: 0;
    text-align: center;
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.welcome-message {
    font-size: 0.9rem;
    line-height: 1.3;
    text-align: right;
    color: var(--secondary-color);
}

.welcome-message strong {
    color: var(--primary-color);
    font-weight: 700;
}

.user-avatar img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10%;
    border: 2px solid var(--primary-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

/* Notice Bar Styles */
.notice-bar {
    background-color: #f0f0f0; /* A light blue to make it stand out */
    border-radius: 5px;
    padding: 0.5rem 1rem;
    text-align: center;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.notice-text {
    font-size: 0.9rem;
    margin: 0;
    color: #1a0262;
    overflow: hidden;
    width: 100%;
}
.marquee-text {
    width: 100%;
    white-space: nowrap;
    animation: marquee 15s linear infinite;
    display: inline-block;
}

@keyframes marquee {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/*
 * Main Navigation (Unchanged from previous code)
 */
.header-nav {
    margin-top: 1rem;
}

.nav-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
}

.nav-item {
    flex: 1 1 auto;
    text-align: center;
}

.nav-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.nav-item a:hover {
    background: var(--active-color);
    border-radius: 10px;
}

.nav-item.active a {
    background: var(--active-color);
    font-weight: 700;
    border-radius: 10px;
}

.nav-item i {
    font-size: 1.25rem;
}

.badge {
    background-color: #dc3545;
    color: var(--text-light);
    font-size: 0.7rem;
    padding: 0.2em 0.5em;
    border-radius: 50px;
    font-weight: bold;
    margin-left: 5px;
}

.logout-link a {
    background-color: #e74c3c;
    color: var(--text-light);
}

.logout-link a:hover {
    background-color: #c0392b;
}

/*
 * Notification Dropdown (Unchanged from previous code)
 */
.notification-dropdown {
    position: relative;
}

.notification-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
    position: relative;
    padding: 0.5rem;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74c3c;
    color: var(--text-light);
    font-size: 0.7rem;
    border-radius: 50%;
    padding: 0.2em 0.5em;
    min-width: 20px;
    text-align: center;
}

.notification-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background-color: var(--text-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    z-index: 1000;
    overflow: hidden;
    margin-top: 0.5rem;
}

.notification-dropdown:hover .notification-menu,
.notification-toggle[aria-expanded="true"] + .notification-menu {
    display: block;
}

.notification-menu a {
    display: block;
    padding: 10px 15px;
    color: var(--text-dark);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.notification-menu a:hover {
    background-color: var(--background-light);
}

.notification-menu small {
    display: block;
    font-size: 0.75rem;
    color: var(--secondary-color);
    margin-top: 5px;
}

.notification-view-all {
    text-align: center;
    font-weight: 500;
}

/*
 * Mobile Responsiveness
 */
@media (max-width: 992px) {
    .perfect-header {
        padding: 1rem;
    }

    .header-top-row {
        grid-template-columns: 1fr auto; /* Collapses to two columns: logo and right content */
        justify-content: space-between;
        align-items: center;
    }

    .header-center {
        display: none; /* Hide notice bar on smaller screens to save space */
    }

    .header-right {
        gap: 0.5rem;
    }

    .header-title,
    .header-user-info {
        display: none; /* Hide on mobile, will be shown inside the menu */
    }

    .menu-toggle {
        display: block; /* Show the toggle button */
    }

    .header-nav {
        display: none;
        margin-top: 0;
        background-color: var(--primary-color);
        border-radius: 0 0 8px 8px;
        overflow: hidden;
    }

    .header-nav.is-active {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        border-radius: 0;
    }

    .nav-item {
        border-bottom: 1px solid var(--active-color);
    }

    .nav-item a {
        justify-content: flex-start;
        padding: 1rem;
    }

    /* User info in the menu for mobile */
    .header-nav .header-user-info {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
        background-color: var(--active-color);
        gap: 1rem;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    .header-nav .header-user-info .welcome-message {
        color: var(--text-light);
        text-align: left;
    }
    .header-nav .header-user-info .user-avatar img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        margin-right: 10px;
    }

    .logout-link {
        width: 100%;
    }
}
