/* Layout Styles - Navigation, Header, Footer */

/* Navbar */
.navbar {
    background: var(--theme-teal-dark);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--theme-teal);
}

.navbar-container {
    display: flex;
    align-items: center;
    padding: 0 30px;
    height: 70px;
    max-width: 1600px;
    margin: 0 auto;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-right: 40px;
}

.navbar-logo {
    height: 45px;
    width: 45px;
    object-fit: contain;
}

.navbar-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: #cbd5e1;
    /* Lighter text for Navy bg */
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    /* Subtle white tint */
    color: white;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.nav-item i {
    font-size: 16px;
    transition: color 0.3s;
}

.nav-item:hover i,
.nav-item.active i {
    color: white;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    /* Match nav-item default color */
    transition: color 0.3s;
}

.dropdown-toggle i.fa-chevron-down {
    color: white;
    /* Make chevron icon always white for visibility */
    font-size: 12px;
    margin-left: 2px;
}

.nav-item:hover .dropdown-toggle,
.dropdown-toggle:hover,
.dropdown.active .dropdown-toggle,
.dropdown.show .dropdown-toggle {
    color: white;
}

.nav-item:hover .dropdown-toggle i.fa-chevron-down,
.dropdown-toggle:hover i.fa-chevron-down,
.dropdown.active .dropdown-toggle i.fa-chevron-down,
.dropdown.show .dropdown-toggle i.fa-chevron-down {
    color: white;
    /* Ensure chevron stays white on hover/active */
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dropdown.active .dropdown-menu,
.dropdown.show .dropdown-menu,
.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-dark) !important;
    /* Force dark text - override global anchor white color */
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--bg-light);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--bg-teal-light);
    color: var(--theme-teal-dark) !important;
    /* Ensure text stays visible on hover */
}

.dropdown-item i {
    font-size: 14px;
    color: var(--theme-teal-dark) !important;
    /* Force teal color to override parent .nav-item:hover i white color */
    opacity: 0.8;
}

.dropdown-item:hover i {
    opacity: 1;
    color: var(--theme-teal-dark) !important;
}

/* User Dropdown */
.navbar-user {
    margin-left: auto;
}

.user-dropdown {
    position: relative;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.user-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.user-button i.fa-chevron-down {
    color: white;
    /* Ensure chevron is visible */
    font-size: 12px;
}

.user-button i.fa-user-circle {
    font-size: 28px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    font-size: 11px;
    opacity: 0.8;
    display: block;
}

.user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-dropdown.active .user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    padding: 20px;
    background: var(--bg-light);
    border-radius: 6px 6px 0 0;
}

.user-fullname {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.user-email {
    font-size: 12px;
    color: var(--text-light);
}

.user-menu-divider {
    height: 1px;
    background: var(--border-color);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-dark);
    transition: background 0.2s ease;
}

.user-menu-item:hover {
    background: var(--bg-light);
    color: var(--danger);
}

.user-menu-item i {
    font-size: 16px;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 130px);
    padding-top: 20px;
}

/* Footer */
.footer {
    background: var(--theme-teal-dark);
    color: #e0f2f1;
    padding: 20px 30px;
    margin-top: 40px;
    border-top: 1px solid var(--theme-teal);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 1024px) {
    .navbar-container {
        padding: 0 20px;
    }

    .navbar-menu {
        gap: 2px;
    }

    .nav-item {
        padding: 10px 12px;
        font-size: 13px;
    }

    .nav-item span {
        display: none;
    }

    .navbar-title {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .navbar-container {
        padding: 0 15px;
        height: 60px;
    }

    .navbar-logo {
        height: 35px;
        width: 35px;
    }

    .navbar-brand {
        margin-right: 20px;
    }

    .footer-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .main-content {
        padding-top: 15px;
    }
}