/* css/NV_U37_NV_client_style.css - Updated for Video Command Center v3.7 */
/* Updated Breakpoints for v5.3 */

/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- CSS Variables --- */
:root {
    /* Nav Bar Defaults */
    --navbar-actual-height: 60px; 
    --navbar-bg-color: #000000;
    --navbar-font-family: Arial, sans-serif;
    --navbar-font-size: 16px;
    --navbar-font-color: #FFFFFF;
    --navbar-link-hover-font-color: #DDDDDD;
    --navbar-link-hover-bg-color: #555555;
    --logo-placeholder-bg: black; 
    --logo-placeholder-text-color: #333; 
    
    /* Mega Menu Defaults */
    --current-mega-menu-bg-color: #3A3A3A; 
    --current-mega-menu-bg-image: none; 
    --current-mega-menu-font-family: Arial, sans-serif; 
    --current-mega-menu-font-size: 16px; 
    --current-mega-menu-font-color: #E0E0E0; 
    --current-mega-menu-link-color: #82C0FF; 
    --current-mega-menu-link-hover-color: #A8D8FF; 
    --current-mega-menu-heading-color: #E0E0E0; 
    --current-mega-menu-text-color: #BDBDBD; 
    --current-mega-menu-separator-thickness: 4px; 
    --current-mega-menu-bg-opacity: 1; /* Default Opacity */

    /* Mega Menu Header Defaults */
    --default-mega-header-height: auto; 
    --default-mega-header-bg-color: #4A90E2; 
    --default-mega-header-bg-image: none;
    --default-mega-header-font-family: inherit; 
    --default-mega-header-font-size: 1.5rem;
    --default-mega-header-font-color: #FFFFFF;
}

body {
    font-family: var(--navbar-font-family, Arial, sans-serif); 
    line-height: 1.6;
    background-color: #f4f4f4; 
    color: #333;
}

/* --- Navigation Bar --- */
.navbar {
    background-color: var(--navbar-bg-color); 
    min-height: var(--navbar-actual-height); 
    height: var(--navbar-actual-height); 
    padding: 0 1rem; 
    display: flex;
    align-items: center; 
    position: relative; 
    z-index: 1000;
    font-family: var(--navbar-font-family); 
}

.logo-placeholder {
    color: var(--logo-placeholder-text-color); 
    background-color: var(--logo-placeholder-bg); 
    padding: 5px 15px; 
    border-radius: 4px; 
    font-weight: bold;
    font-size: 1.2em; 
    margin-right: 20px; 
    display: flex; 
    align-items: center;
    justify-content: center;
    height: calc(var(--navbar-actual-height) - 20px); 
    flex-shrink: 0; 
}

.nav-links { 
    list-style: none;
    display: flex; 
    flex-wrap: wrap; 
    align-items: center; 
    padding-left: 0;
    height: 100%; 
    justify-content: flex-start; 
}

.nav-links li { margin: 0; display: flex; }

.nav-button-wrapper {
    display: flex; align-items: center; 
    height: var(--navbar-actual-height); 
    cursor: pointer; 
    transition: background-color 0.3s ease; 
    position: relative; 
}
.nav-links li:not(:first-child) .nav-button-wrapper { 
    border-left: 1px solid #444; 
}

.nav-button-wrapper:hover, .nav-button-wrapper.active-wrapper { 
    background-color: var(--navbar-link-hover-bg-color); 
}

.nav-button-wrapper a {
    color: var(--navbar-font-color); 
    font-size: var(--navbar-font-size); 
    text-decoration: none; 
    padding: 0 1rem; 
    display: flex; 
    align-items: center; 
    height: 100%; 
    border-radius: 0; 
}
.nav-button-wrapper:hover a { 
    color: var(--navbar-link-hover-font-color);
}

.nav-button-wrapper a i { 
    margin-right: 8px; 
}

.hamburger-menu {
    display: none; 
    background: none; 
    border: none; 
    color: var(--navbar-font-color); 
    font-size: 1.8rem; 
    cursor: pointer; 
    padding: 0.5rem; 
    margin-left: auto; 
    line-height: 1; 
    z-index: 1005; 
}

/* --- Mega Menu Structure --- */
.mega-menu {
    background-color: var(--current-mega-menu-bg-color); 
    border: 1px solid #2a2a2a; 
    border-top: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); 
    padding: 0;
    position: absolute; 
    top: var(--navbar-actual-height); 
    left: 0; 
    width: 100%;
    display: none; 
    z-index: 999; 
    max-height: calc(100vh - var(--navbar-actual-height) - 2px); 
    overflow-y: auto;
    border-bottom-left-radius: 8px; 
    border-bottom-right-radius: 8px;
    font-family: var(--current-mega-menu-font-family);
    font-size: var(--current-mega-menu-font-size);
    color: var(--current-mega-menu-font-color); 
}
.mega-menu.active { 
    display: block; 
}

/* Pseudo-element for Background Image with Opacity */
.mega-menu::before {
    content: "";
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    background-image: var(--current-mega-menu-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: var(--current-mega-menu-bg-opacity, 1);
    z-index: -1; /* Behind content */
    border-bottom-left-radius: 8px; 
    border-bottom-right-radius: 8px; 
    pointer-events: none;
}

.mega-menu-bg-video {
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%;
    object-fit: cover; 
    z-index: -1; 
    opacity: var(--current-mega-menu-bg-opacity, 1);
}

.mega-menu-header {
    padding: 1rem; 
    background-color: var(--current-mega-header-bg-color, var(--default-mega-header-bg-color)); 
    background-image: var(--current-mega-header-bg-image, var(--default-mega-header-bg-image));
    background-size: cover; 
    background-position: center; 
    text-align: center;
    border-bottom: 1px solid #555; 
    min-height: var(--current-mega-header-height, var(--default-mega-header-height)); 
    height: var(--current-mega-header-height, var(--default-mega-header-height)); 
    display: flex; 
    align-items: center; 
    justify-content: center;
    box-sizing: border-box; 
}
.mega-menu-header h3 { 
    color: var(--current-mega-header-font-color, var(--default-mega-header-font-color)); 
    margin: 0; 
    font-family: var(--current-mega-header-font-family, var(--default-mega-header-font-family));
    font-size: var(--current-mega-header-font-size, var(--default-mega-header-font-size)); 
}

.mega-menu-content { 
    display: grid; 
    gap: 20px; 
    padding: 1.5rem; 
    max-width: 95%; 
    margin: 0 auto; 
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.mega-menu-column {
    padding: 15px; 
    background-size: cover; 
    background-position: center;
    min-width: 0;
    overflow: hidden;
}

.mega-menu-separator { 
    align-self: stretch; 
}

/* --- Standard Content Columns --- */
.mega-menu-video-title, .mega-menu-column h4 {
    font-size: 1.1em; font-weight: bold; color: var(--current-mega-menu-heading-color);
    margin-bottom: 0.75rem; 
}
.video-container-wrapper { margin-bottom: 1rem; }
.video-aspect-ratio-container { 
    position: relative; width: 100%; 
    background-color: #000; border-radius: 5px; overflow: hidden; 
}
.video-aspect-ratio-container.ar-17-22 { padding-bottom: calc(22 / 17 * 100%); }
.video-aspect-ratio-container.ar-16-9 { padding-bottom: calc(9 / 16 * 100%); }
.video-aspect-ratio-container video { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; 
}
.video-snippet { font-size: 0.9em; color: var(--current-mega-menu-text-color); margin-top: 0.5rem;}

.mega-menu-column ul { list-style: none; padding-left: 0; }
.mega-menu-column li { margin-bottom: 1rem; }
.mega-menu-column h4 a { text-decoration: none; color: inherit; transition: color 0.2s; }
.mega-menu-column h4 a:hover { color: var(--current-mega-menu-link-hover-color); }
.mega-menu-column p { 
    font-size: 0.9em; color: var(--current-mega-menu-text-color); 
    padding-left: 24px; margin-top: 0.25rem; line-height: 1.4;
}
.mega-menu-column p a { 
    color: var(--current-mega-menu-link-color); text-decoration: none; 
}
.mega-menu-column p a:hover {
    color: var(--current-mega-menu-link-hover-color); text-decoration: underline;
}

/* --- NEW: Twilio Video Command Center Styles --- */
.twilio-video-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 300px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    padding: 10px;
    box-sizing: border-box;
}

.twilio-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px; 
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between; 
    width: 100%; 
}

.twilio-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: background 0.2s;
    color: white;
}
.twilio-btn-join { background-color: #2980b9; }
.twilio-btn-join:hover { background-color: #3498db; }
.twilio-btn-leave { background-color: #c0392b; display: none; }
.twilio-btn-leave:hover { background-color: #e74c3c; }
.twilio-btn-cam { background-color: #7f8c8d; }
.twilio-status {
    font-size: 0.8em;
    padding: 4px 8px;
    border-radius: 12px;
    background: #555;
    color: #fff;
    margin-left: auto;
}
.twilio-status.connected { background: #27ae60; }
.twilio-status.connecting { background: #f39c12; }

/* Video Stage */
.twilio-stage-container {
    position: relative;
    width: 100%;
    background-color: #000;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}
.twilio-remote-media {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.twilio-remote-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.twilio-remote-media .participant-wrapper {
    position: relative;
    margin: 2px;
    border: 1px solid #333;
}
.twilio-remote-media .participant-label {
    position: absolute; bottom: 0; left: 0;
    background: rgba(0,0,0,0.6);
    color: white; font-size: 10px; padding: 2px 4px;
}
.twilio-local-media {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 120px;
    height: 90px;
    background: #222;
    border: 2px solid #fff;
    border-radius: 4px;
    z-index: 20;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}
.twilio-local-media video {
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scaleX(-1); 
}

/* Chat Interface */
.twilio-chat-container {
    display: flex;
    flex-direction: column;
    height: 350px; 
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}
.twilio-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chat-bubble {
    padding: 6px 10px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 0.9em;
    word-wrap: break-word;
}
.chat-bubble.me {
    align-self: flex-end;
    background-color: #2980b9;
    color: white;
    border-bottom-right-radius: 2px;
}
.chat-bubble.others {
    align-self: flex-start;
    background-color: #444;
    color: #ddd;
    border-bottom-left-radius: 2px;
}
.chat-author {
    font-size: 0.7em;
    color: #888;
    margin-top: 2px;
    align-self: flex-start;
}
.chat-bubble.me + .chat-author { align-self: flex-end; }
.twilio-chat-input-area {
    display: flex;
    padding: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.twilio-chat-input {
    flex: 1;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #555;
    background: #222;
    color: #fff;
    font-size: 0.9em;
}
.twilio-chat-send {
    margin-left: 5px;
    padding: 6px 12px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.twilio-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Guide List Styles */
.guide-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}
.guide-entry {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.05);
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid transparent;
    transition: background 0.2s;
}
.guide-entry:hover { background: rgba(255,255,255,0.1); }
.guide-status-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 12px;
}
.guide-status-available { background-color: #2ecc71; box-shadow: 0 0 5px #2ecc71; }
.guide-status-busy { background-color: #f39c12; }
.guide-status-priority { background-color: #e74c3c; animation: pulse-red 1.5s infinite; }
.guide-status-offline { background-color: #7f8c8d; }

.guide-info { flex: 1; }
.guide-name { font-weight: bold; color: var(--current-mega-menu-heading-color); display: block; }
.guide-sector { font-size: 0.85em; color: var(--current-mega-menu-text-color); display: block; }
.guide-meta { 
    text-align: right; 
    font-size: 0.8em; 
    color: var(--current-mega-menu-link-color); 
}
.guide-wait-time { display: block; margin-bottom: 2px; }

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* Responsive Adjustments 
   UPDATED: Increased breakpoint to 991px to capture Phone Landscape modes 
   and smaller Tablets in the "Hamburger Menu" view.
*/
@media (max-width: 991px) { 
    .nav-links { 
        display: none !important; 
        flex-direction: column; 
        width: 100%; 
        background-color: var(--navbar-bg-color); 
        position: absolute; 
        top: var(--navbar-actual-height); 
        left: 0; 
        z-index: 998; 
        border-top: 1px solid #333; 
        padding: 0; 
        margin-left: 0; 
        height: auto; 
    }
    .navbar.nav-open .nav-links { 
        display: flex !important; /* Forces hamburger menu open */
    } 
    .nav-links li { 
        width: 100%; 
        margin-left: 0 !important;
        flex-wrap: wrap; 
    }
    .nav-button-wrapper { width: 100%; height: auto; border: none !important; }
    .nav-links li:not(:last-child) .nav-button-wrapper { border-bottom: 1px solid #333; }
    .nav-button-wrapper a { width: 100%; justify-content: flex-start; padding: 0.9rem 1rem; height: auto; }
    .hamburger-menu { display: block; } 
    
    .mega-menu-content, .mega-menu-content.five-columns { 
        grid-template-columns: 1fr !important; gap: 20px !important; 
    }
    .mega-menu-separator { display: none !important; }
    .mega-menu-column { border-left: none !important; margin-bottom: 15px; }
    
    .mobile-submenu-container {
        width: 100%;
        border-top: 1px solid #444;
        display: none;
    }
}