/* Layout Styles for IAMQC Application */

/* Reset */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    height: 100%;
}

/* ===== Custom Navbar ===== */
.custom-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: #1a6b6d;
    padding-left: 236px;
    z-index: 1030;
    display: flex;
    align-items: center;
}

.logo-white {
    filter: brightness(0) invert(1);
    margin-right: 12px;
}

.navbar-title {
    color: white;
    font-weight: 500;
    font-size: 1.25rem;
}

.navbar-icons {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
    padding-right: 20px;
}

.icon-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

    .icon-btn:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    .icon-btn i {
        font-size: 1.2rem;
    }

/* ===== Custom Sidebar ===== */
.custom-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background-color: #1a6b6d;
    z-index: 1040;
    overflow: visible;
}

.sidebar-spacer {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.logo-white {
    display: block;
    max-width: 100%;
    height: auto;
}

.sidebar-item-wrapper {
    position: relative;
}

.sidebar-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 14px 20px;
    gap: 12px;
    min-height: 48px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

    .sidebar-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: white;
    }

    .sidebar-link.active {
        background-color: rgba(255, 255, 255, 0.15);
        border-left: 3px solid white;
        padding-left: 17px;
    }

    .sidebar-link i {
        font-size: 1.2rem;
        flex-shrink: 0;
        width: 20px;
        text-align: center;
    }

.sidebar-label {
    font-size: 0.9rem;
    font-weight: 400;
    white-space: nowrap;
}

.sidebar-chevron {
    margin-left: auto;
    font-size: 0.7rem;
    opacity: 0.7;
}

/* ===== Flyout Popup ===== */
.sidebar-flyout {
    display: none;
    position: absolute;
    top: 0;
    left: 220px;
    min-width: 240px;
    background-color: #ffffff;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    padding: 8px 0;
}

.sidebar-item-wrapper:hover > .sidebar-flyout {
    display: block;
}

.flyout-header {
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #1a6b6d;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flyout-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.15s ease;
}

    .flyout-link:hover {
        background-color: #f0f9f9;
        color: #1a6b6d;
    }

    .flyout-link.active {
        background-color: #e0f2f2;
        color: #1a6b6d;
        font-weight: 500;
    }

    .flyout-link i {
        font-size: 1rem;
        width: 20px;
        text-align: center;
        color: #1a6b6d;
    }

/* ===== Main Content ===== */
.main-content {
    margin-left: 220px;
    margin-top: 64px;
    padding: 24px;
    background-color: #f5f5f5;
    min-height: calc(100vh - 64px);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .custom-sidebar {
        width: 60px;
    }

    .sidebar-label,
    .sidebar-chevron {
        display: none;
    }

    .sidebar-link {
        justify-content: center;
        padding: 20px 0;
        gap: 0;
    }

    .sidebar-flyout {
        left: 60px;
    }

    .main-content {
        margin-left: 60px;
    }

    .custom-navbar {
        padding-left: 76px;
    }
}

/* ===== User Profile Component ===== */
.user-profile-container {
    position: relative;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.user-profile-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0d4d4f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.chevron-icon {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.user-profile-btn:hover .chevron-icon {
    transform: translateY(2px);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    z-index: 1050;
    animation: fadeInDown 0.2s ease-out;
}

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

.user-dropdown-header {
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.user-initials-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #1a6b6d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.125rem;
    color: white;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
}

.user-info-name {
    font-weight: 600;
    font-size: 1rem;
    color: #212529;
    margin-bottom: 4px;
}

.user-info-email {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 4px;
}

.user-info-lab {
    font-size: 0.875rem;
    color: #495057;
    font-weight: 500;
}

.user-info-role {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 2px;
}

.dropdown-divider {
    margin: 0;
    border: 0;
    border-top: 1px solid #e9ecef;
}

.user-dropdown-menu {
    padding: 8px 0;
}

.dropdown-item {
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    color: #212529;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item i {
    width: 16px;
    font-size: 1rem;
    color: #6c757d;
}

.dropdown-item.logout {
    color: #dc3545;
}

.dropdown-item.logout i {
    color: #dc3545;
}

.dropdown-item.logout:hover {
    background-color: #fff5f5;
}
