/* Portal Layout Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden; /* Prevent scrollbars on the main page */
}

.portal-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.portal-container {
    display: grid;
    grid-template-columns: 225px 1fr;
    grid-template-areas: 
        "left-panel right-panel";
    flex: 1;
    height: calc(100vh - 50px);
}

/* Left Navigation Panel */
.left-panel {
    grid-area: left-panel;
    background-color: #264ad0;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.logo-container {
    padding: 0 15px 20px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

.company-logo {
    width: 56px;
    height: auto;
    max-width: 170px;
}

.navigation-menu {
    flex: 1;
    padding: 0 10px;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-category {
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    padding: 10px 15px;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 5px;
}

.nav-category.expandable {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    border-bottom: none;
    border-radius: 8px;
    margin-bottom: 10px;
}

.nav-category.expandable:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.category-text {
    flex: 1;
}

.expand-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: rgba(255, 255, 255, 0.8);
    margin-left: 10px;
}

.nav-category.expandable.expanded .expand-icon {
    transform: rotate(180deg);
}

.sub-nav {
    list-style: none;
    margin-left: 15px;
    margin-right: 5px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin-bottom 0.3s ease;
    opacity: 0;
    margin-bottom: 0;
}

.sub-nav.expanded {
    max-height: 300px; /* Adjust based on content */
    opacity: 1;
    margin-bottom: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-bottom: 3px;
    font-size: 13px;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-left-color: rgba(255, 255, 255, 0.6);
    transform: translateX(2px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-left-color: #33cc33;
    font-weight: 600;
}

.nav-link .icon {
    margin-right: 10px;
    font-size: 16px;
}

.nav-link .label {
    font-size: 14px;
    font-weight: 500;
}

/* Right Panel Container */
.right-panel {
    grid-area: right-panel;
    display: grid;
    grid-template-rows: 100px 1fr;
    grid-template-areas: 
        "top-panel"
        "content-panel";
}

/* Top Panel (Breadcrumb/Title Area) */
.top-panel {
    grid-area: top-panel;
    background-color: #33cc33;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: 2px solid #2eb82e;
}

.breadcrumb-container {
    flex: 1;
}

.current-module {
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

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

.user-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
    transition: border-color 0.3s ease;
}

.user-photo:hover {
    border-color: rgba(255, 255, 255, 0.6);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0; /* Allow text to truncate */
}

.user-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.user-email {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.logout-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Content Panel */
.content-panel {
    grid-area: content-panel;
    background-color: #ffffff;
    position: relative;
    overflow: hidden;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    padding: 60px 40px 40px 40px;
    text-align: center;
}

.welcome-image {
    max-width: 400px;
    height: auto;
    margin-bottom: 30px;
}

.welcome-screen h2 {
    color: #333;
    font-size: 28px;
    margin-bottom: 15px;
    font-weight: 600;
}

.welcome-screen p {
    color: #666;
    font-size: 16px;
    line-height: 1.5;
}

.content-frame {
    width: 100%;
    height: 100%;
    border: none;
    background-color: #ffffff;
}

/* Bottom Footer Panel */
.bottom-panel {
    background-color: #1247c9;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 50px;
    padding-left: 0;
    margin: 0;
    width: 100%;
}

.footer-image {
    height: 50px;
    width: auto;
    margin: 0;
    padding: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .portal-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr 50px;
        grid-template-areas: 
            "left-panel"
            "right-panel"
            "bottom-panel";
    }
    
    .left-panel {
        height: auto;
        flex-direction: row;
        padding: 10px;
    }
    
    .logo-container {
        padding: 0 10px;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.2);
        margin-bottom: 0;
        margin-right: 20px;
    }
    
    .company-logo {
        max-width: 100px;
    }
    
    .navigation-menu {
        flex: 1;
        padding: 0;
    }
    
    .nav-list {
        display: flex;
        gap: 10px;
    }
    
    .nav-item {
        margin-bottom: 0;
    }
    
    .nav-category {
        font-size: 12px;
        padding: 5px 10px;
        margin-bottom: 5px;
    }
    
    .sub-nav {
        margin-left: 0;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Mobile user profile adjustments */
    .user-profile {
        gap: 8px;
        padding: 6px 8px;
    }
    
    .user-photo {
        width: 28px;
        height: 28px;
    }
    
    .user-info {
        display: none; /* Hide text on very small screens */
    }
    
    .user-name {
        font-size: 12px;
        max-width: 100px;
    }
    
    .user-email {
        font-size: 10px;
        max-width: 100px;
    }
}

/* Show user info on slightly larger mobile screens */
@media (min-width: 480px) and (max-width: 768px) {
    .user-info {
        display: flex !important;
    }
}
