/* =============================================
   Unified Navbar & Footer CSS
   University of Phayao Colors:
     Purple: #8D38C9 / Gold: #C4996C
   ============================================= */

/* --- Navbar --- */
.syllabus-navbar {
    background: linear-gradient(135deg, #6B2FA0 0%, #8D38C9 50%, #A34FD9 100%);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(109, 40, 166, 0.35);
    font-family: 'Prompt', sans-serif;
}

.syllabus-navbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

/* Brand */
.syllabus-navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: #fff;
    padding: 0.6rem 0;
    flex-shrink: 0;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #F5D998;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.brand-title {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.02em;
    color: #fff;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: #E8C8F0;
    font-weight: 300;
}

/* Mobile Toggler */
.navbar-toggler {
    display: none;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
}

.navbar-toggler:hover {
    background: rgba(255,255,255,0.2);
}

/* Nav Collapse */
.syllabus-navbar-collapse {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

/* Nav Links */
.syllabus-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.15rem;
    flex-wrap: wrap;
    align-items: center;
}

.syllabus-nav-links li a {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.7rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 400;
    border-radius: 8px;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.syllabus-nav-links li a:hover {
    color: #fff;
    background: rgba(255,255,255,0.12);
}

.syllabus-nav-links li a.active {
    color: #fff;
    background: rgba(255,255,255,0.18);
    font-weight: 500;
    box-shadow: inset 0 -2px 0 #F5D998;
}

.syllabus-nav-links li a i {
    font-size: 0.8rem;
    color: #F5D998;
}

/* Nav Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 200px;
    padding: 0.4rem 0;
    z-index: 10000;
    list-style: none;
    margin: 0.35rem 0 0;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: #334155 !important;
    font-size: 0.85rem;
    border-radius: 0;
    white-space: nowrap;
}
.nav-dropdown-menu li a:hover {
    background: #f3e8ff !important;
    color: #7c3aed !important;
}
.nav-dropdown-menu li a i { color: #8D38C9 !important; }

/* User Badge */
.syllabus-navbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 0.75rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255,255,255,0.15);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #C4996C, #D4AA7D);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role {
    font-size: 0.7rem;
    color: #E8C8F0;
    font-weight: 300;
}

/* Logout Button */
.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s;
    font-family: 'Prompt', sans-serif;
    white-space: nowrap;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fee2e2;
}

/* Login / Register buttons */
.btn-nav-login,
.btn-nav-register {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-nav-login {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.35);
}

.btn-nav-login:hover {
    background: rgba(255,255,255,0.1);
}

.btn-nav-register {
    background: linear-gradient(135deg, #C4996C, #D4AA7D);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(196, 153, 108, 0.4);
}

.btn-nav-register:hover {
    background: linear-gradient(135deg, #B38A5E, #C49B6F);
}

/* --- Footer --- */
.syllabus-footer {
    font-family: 'Prompt', sans-serif;
    margin-top: auto;
    position: relative;
}

.footer-wave {
    color: #5A2D82;
    line-height: 0;
    overflow: hidden;
}

.footer-wave svg {
    display: block;
    width: 100%;
    height: 50px;
}

.footer-body {
    background: linear-gradient(135deg, #5A2D82 0%, #7B3AAF 100%);
    padding: 2.5rem 1.5rem 1.5rem;
    color: #E8C8F0;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 3rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.75rem;
}

.footer-brand i {
    font-size: 1.4rem;
    color: #F5D998;
}

.footer-desc {
    font-size: 0.85rem;
    color: #D4AAE4;
    line-height: 1.7;
    margin: 0;
}

.footer-heading {
    color: #F5D998;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.4rem;
}

.footer-links li a {
    color: #D4AAE4;
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s, padding-left 0.2s;
}

.footer-links li a:hover {
    color: #fff;
    padding-left: 0.25rem;
}

.footer-links li a i {
    font-size: 0.7rem;
    color: #F5D998;
}

.footer-contact {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-contact li {
    color: #D4AAE4;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-contact li i {
    color: #F5D998;
    width: 16px;
    text-align: center;
    font-size: 0.85rem;
}

.footer-contact li a {
    color: #E8C8F0;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-contact li a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.12);
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.8rem;
    color: #C09BD0;
}

.footer-version {
    margin-top: 0.25rem !important;
    font-size: 0.7rem !important;
    color: rgba(192, 155, 208, 0.6) !important;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .navbar-toggler { display: block; }

    .syllabus-navbar-collapse {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 0.75rem 0;
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-left: 0;
        gap: 0.5rem;
    }

    .syllabus-navbar-collapse.show { display: flex; }

    .syllabus-navbar-inner {
        flex-wrap: wrap;
    }

    .syllabus-nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .syllabus-nav-links li a {
        padding: 0.75rem 1rem;
        border-radius: 6px;
    }

    .syllabus-navbar-user {
        width: 100%;
        margin-left: 0;
        padding-left: 0;
        padding-top: 0.75rem;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.1);
        justify-content: space-between;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 576px) {
    .brand-title { font-size: 0.85rem; }
    .brand-subtitle { font-size: 0.7rem; }
    .brand-icon { width: 36px; height: 36px; font-size: 1rem; }
    .user-name { max-width: 100px; }
}
