/* QA: Album Thumbnails
 * - Album opens quickly and shows thumbnails within 1–2s on normal broadband.
 * - Clicking a thumb loads the large image, not the original.
 * - Network tab shows thumbs are small files (tens of KB), not MB.
 * - Existing albums without thumbUrl still work (fallback to original but warn once).
 */
:root {
    --brand-color-rgb: 59, 130, 246; /* Corresponds to #3B82F6, used for tinting */
    --gv-primary: #005f6b;
    --gv-secondary: #008C9E;
    --gv-accent: #ffffff;
    --gv-chat-bg: rgba(255,255,255,0.15);
    --gv-chat-text: #ffffff;
    --gv-button-bg: #005f6b;
    --gv-button-text: #ffffff;
    --gv-chat-opacity: 1;
}

/* --- RESET --- */
* { box-sizing: border-box; }
body { margin: 0; padding: 0; font-family: 'Poppins', sans-serif; overflow: hidden; height: 100vh; background: #000; }

/* --- 1. TOUR LAYER --- */
#tour-view { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
iframe { width: 100%; height: 100%; border: none; }

/* --- 1A. LOADER --- */
.gv-loader {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #000;
    z-index: 120;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.gv-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.gv-loader-mark {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #00B4D8;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gv-loader-spinner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #00B4D8;
    animation: gv-spin 0.9s linear infinite;
}

.gv-loader-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.2px;
}

@keyframes gv-spin {
    to { transform: rotate(360deg); }
}

/* --- 2. PREMIUM TOP BAR (REFACTORED) --- */
.premium-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 10;
    
    background: rgba(var(--brand-color-rgb), 0.08);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(var(--brand-color-rgb), 0.2);
    box-shadow: 0 4px 30px rgba(0,0,0,0.1);
}

.top-bar-left { display: flex; align-items: center; gap: 20px; }
.top-bar-logo { height: 60px; object-fit: contain; filter: none; }
.divider { width: 1px; height: 32px; background: rgba(var(--brand-color-rgb), 0.3); }

.room-title-container { position: relative; height: 28px; overflow: hidden; }
.room-title-text {
    display: block; color: white; font-size: 20px; font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    position: absolute; top: 0; left: 0;
}
.room-title-text.upcoming { transform: translateY(100%); }
.room-title-container.animating .current { transform: translateY(-100%); }
.room-title-container.animating .upcoming { transform: translateY(0); }

.top-bar-right { position: relative; }
.menu-btn {
    background: none; border: none; color: white; font-size: 24px; cursor: pointer;
    padding: 8px; transition: background 0.2s; border-radius: 50%;
}
.menu-btn:hover { background: rgba(var(--brand-color-rgb), 0.2); }

.top-bar-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: 240px;
    background: rgba(var(--brand-color-rgb), 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 12px;
    border: 1px solid rgba(var(--brand-color-rgb), 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    padding: 8px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}
.top-bar-dropdown.active { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.dropdown-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    color: white; text-decoration: none; font-size: 14px; font-weight: 500;
    border-radius: 8px; transition: background-color 0.2s ease-in-out;
}
.dropdown-item:hover { background-color: rgba(var(--brand-color-rgb), 0.2); }
.dropdown-item .fa-fw { width: 20px; text-align: center; opacity: 0.7; }


/* --- 3. WELCOME MODAL --- */
#welcome-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(5px);
    z-index: 100; display: flex; align-items: center; justify-content: center;
    opacity: 1; transition: opacity 0.5s;
}
#welcome-modal.hidden { opacity: 0; pointer-events: none; }
.modal-glass {
    width: 400px; padding: 40px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-radius: 30px; border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center; color: white; display: flex; flex-direction: column; gap: 20px;
}
.modal-title { font-size: 24px; font-weight: 700; margin: 0; text-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.modal-subtitle { font-size: 14px; opacity: 0.9; margin-bottom: 10px; font-weight: 400; line-height: 1.5; }
.choice-btn {
    padding: 15px; border-radius: 12px; border: none; cursor: pointer;
    font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 600;
    transition: transform 0.2s; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-guide { background: #005f6b; color: white; box-shadow: 0 4px 15px rgba(0, 95, 107, 0.3); }
.btn-self { background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.3); }
.choice-btn:hover { transform: scale(1.02); }

/* --- 4. AVA GLASS CARD (The 3-Stack Container) --- */
#ava-card {
    position: absolute; right: 40px; bottom: 40px;
    width: 360px; height: 70vh; max-height: 650px; min-height: 400px;
    display: flex; flex-direction: column;
    background: transparent;
    color: var(--gv-chat-text);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-radius: 30px; border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    z-index: 20; padding: 0 25px 20px 25px; 
    opacity: 0; pointer-events: none; transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
#ava-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--gv-chat-bg);
    opacity: var(--gv-chat-opacity);
    pointer-events: none;
    z-index: 0;
}
#ava-card > .expanded-only,
#ava-card > .minimized-only {
    position: relative;
    z-index: 1;
}
#ava-card.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
#ava-card.minimized .expanded-only { display: none; }
#ava-card:not(.minimized) .minimized-only { display: none; }

/* === STACK 1: THE HEADER (Fixed Top) === */
.expanded-only { display: flex; flex-direction: column; height: 100%; }
.card-header { text-align: center; margin-top: 35px; margin-bottom: 10px; flex-shrink: 0; }
.agent-name { margin: 0; color: var(--gv-chat-text); font-size: 22px; font-weight: 700; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.agent-role { font-size: 10px; color: var(--gv-accent); font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; margin-top: 4px; display: block; }
.avatar-wrapper { position: absolute; top: -40px; left: 25px; z-index: 25; transition: all 0.5s; }
.avatar-img {
    width: 80px; height: 80px; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); object-fit: cover; background: var(--gv-primary);
}
.control-bar { position: absolute; top: 15px; right: 15px; display: flex; gap: 8px; z-index: 30; }
.icon-btn {
    background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.2); 
    cursor: pointer; color: var(--gv-chat-text); width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s; backdrop-filter: blur(4px);
}
.icon-btn:hover { background: rgba(255,255,255,0.3); transform: scale(1.05); }

/* === STACK 2: THE SCROLLABLE WINDOW (Middle) === */
#card-body { display: flex; flex-direction: column; flex-grow: 1; min-height: 0; overflow: hidden; position: relative; margin-bottom: 10px; }
#chat-history {
    flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
    padding: 10px 5px; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15px, black 95%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 15px, black 95%, transparent 100%);
}
#chat-history::-webkit-scrollbar { display: none; }

.message .text { padding: 14px 18px; border-radius: 20px; font-size: 14px; line-height: 1.5; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.message.ava .text { background: rgba(255, 255, 255, 0.16); color: var(--gv-chat-text); border-top-left-radius: 4px; animation: popInLeft 0.6s forwards; }
.message.user { align-self: flex-end; }
.message.user .text { background: linear-gradient(135deg, var(--gv-primary) 0%, var(--gv-secondary) 100%); color: var(--gv-button-text); border-top-right-radius: 4px; animation: popInRight 0.6s forwards; }
@keyframes popInLeft { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
@keyframes popInRight { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }

.ava-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 8px 6px 0 6px;
}
.ava-chip-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.72);
}
.ava-chip {
    border: 1px solid rgba(255,255,255,0.28);
    background: var(--gv-button-bg);
    color: var(--gv-button-text);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
}
.ava-chip:hover {
    background: var(--gv-secondary);
    box-shadow: 0 6px 14px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}
.ava-chip:active { transform: translateY(0); }

/* === STACK 3: THE CONTROLS (Fixed Bottom) === */
.input-container { flex-shrink: 0; width: 100%; z-index: 10; margin-top: auto; }
.input-pill {
    background: rgba(255, 255, 255, 0.2); border-radius: 24px; padding: 6px;
    display: flex; align-items: flex-end; box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border: 1px solid var(--gv-accent); width: 100%;
}
.mic-icon {
    width: 40px; height: 40px; background: var(--gv-secondary); color: var(--gv-button-text); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; margin-bottom: 2px;
}
#user-input {
    flex: 1; border: none; outline: none; background: transparent;
    padding: 10px 12px; font-size: 14px; color: var(--gv-chat-text); font-weight: 500;
    font-family: 'Poppins', sans-serif; resize: none; max-height: 80px; overflow-y: auto; line-height: 1.4;
}
#user-input::placeholder { color: rgba(255,255,255,0.65); }
#send-btn {
    width: 40px; height: 40px; background: var(--gv-button-bg); color: var(--gv-button-text); border: none; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-bottom: 2px;
}
.powered-by { text-align: center; font-size: 10px; color: rgba(255,255,255,0.5); margin-top: 5px; font-weight: 500; letter-spacing: 0.5px; }

/* --- MINIMIZED STATE --- */
#ava-card.minimized {
    width: auto; height: auto; right: 30px; bottom: 30px;
    border-radius: 50px; padding: 10px;
    background: transparent;
    backdrop-filter: blur(25px) saturate(180%);
    cursor: pointer; min-height: unset;
}
#ava-card.minimized .minimized-only { display: flex; }
.minimized-only { align-items: center; gap: 8px; }
.mini-controls-col { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.mini-btn {
    width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.3); background: rgba(0,0,0,0.2);
    color: white; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.2s;
}
.mini-btn:hover { background: rgba(255,255,255,0.3); }
.mini-btn.active-mic { background: #FFC107; color: #333; border: none; }
.mini-avatar {
    width: 60px; height: 60px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.9);
    object-fit: cover; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.msg-badge {
    position: absolute; top: 0; right: 0;
    width: 18px; height: 18px; background: #FF3B30; color: white;
    border-radius: 50%; border: 2px solid white;
    font-size: 10px; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    transform: scale(0); opacity: 0; transition: all 0.3s;
    z-index: 50;
}
.msg-badge.visible { transform: scale(1); opacity: 1; }

/* --- 5. INTERACTIVE OPTIONS (Suggestion Chips) --- */
.options-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; justify-content: flex-end; padding-bottom: 5px; }
.option-chip {
    background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.4);
    color: var(--gv-button-text); padding: 8px 16px; border-radius: 20px; font-size: 12px;
    font-weight: 500; cursor: pointer; transition: all 0.2s ease;
    backdrop-filter: blur(5px); animation: popInRight 0.5s forwards;
}
.option-chip:hover {
    background: var(--gv-button-bg); border-color: var(--gv-button-bg);
    transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}



/* --- Ava Design Classes --- */
body.gv-rounded #ava-card,
body.gv-rounded #ava-card.minimized {
    border-radius: 34px;
}
body.gv-square #ava-card,
body.gv-square #ava-card.minimized {
    border-radius: 12px;
}
body.gv-rounded .input-pill {
    border-radius: 22px;
}
body.gv-square .input-pill {
    border-radius: 10px;
}
body.gv-rounded .ava-chip,
body.gv-rounded .option-chip {
    border-radius: 16px;
}
body.gv-square .ava-chip,
body.gv-square .option-chip {
    border-radius: 8px;
}
body.gv-rounded #send-btn,
body.gv-rounded .mic-icon,
body.gv-rounded .icon-btn {
    border-radius: 14px;
}
body.gv-square #send-btn,
body.gv-square .mic-icon,
body.gv-square .icon-btn {
    border-radius: 8px;
}

body.gv-shadow #ava-card,
body.gv-shadow #ava-card.minimized {
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.35);
}
body.gv-no-shadow #ava-card,
body.gv-no-shadow #ava-card.minimized {
    box-shadow: none;
}

body.gv-glass #ava-card,
body.gv-glass #ava-card.minimized {
    backdrop-filter: blur(32px) saturate(185%);
    -webkit-backdrop-filter: blur(32px) saturate(185%);
}
body.gv-glass #ava-card::before {
    background: rgba(0, 0, 0, 0.5);
}
body.gv-solid #ava-card,
body.gv-solid #ava-card.minimized {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
body.gv-solid #ava-card::before {
    background: var(--gv-chat-bg);
    opacity: 1;
}

body.gv-chat-logo-hidden .avatar-wrapper {
    display: none;
}
body.gv-chat-logo-hidden .card-header {
    margin-top: 16px;
}
body.gv-chat-logo-center .avatar-wrapper {
    left: 50%;
    transform: translateX(-50%);
}
body.gv-chat-logo-center .card-header {
    margin-top: 48px;
}

/* -- FIX: Mute Icon Color -- */
.icon-btn.muted, .mini-btn.muted { 
    background: rgba(100, 116, 139, 0.5); /* Neutral gray/slate */
    color: rgba(255, 255, 255, 0.9);
}

/* -- FIX: "Ava is Talking" Animation -- */
@keyframes sound-wave-pulse {
  0% { transform: scale(1.0); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1.0); }
}
/* -- UNIFIED "Is Listening" Pulse Animation -- */
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
    70% { box-shadow: 0 0 0 12px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.is-listening {
    background-color: #4CAF50 !important; /* Green background */
    animation: pulse-green 2s infinite;
    border: none !important;
}

/* -- UNIFIED "Is Talking" Animation -- */
@keyframes sound-wave-pulse {
  0% { transform: scale(1.0); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1.0); }
}
.is-speaking {
    animation: sound-wave-pulse 0.7s infinite ease-in-out;
}


@media (max-width: 600px) {
    #ava-card:not(.minimized) { right: 0; left: 0; bottom: 0; width: 100%; border-radius: 24px 24px 0 0; }
}

/* --- 7. COOKIE BANNER --- */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 24px;
    
    /* Dark Glass */
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    
    color: white;
    z-index: 10000;
    transition: opacity 0.5s, transform 0.5s;
}

.cookie-banner.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

.cookie-banner p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.cookie-btn {
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}
.cookie-btn:hover {
    transform: scale(1.05);
}

.cookie-btn.decline {
    background: #555;
    color: white;
}

.cookie-btn.accept {
    background: #005f6b;
    color: white;
}

/* --- 8. SLEEP & VOICE-MODE STATES --- */

/* -- FIX: Hide mini controls when in deep sleep -- */
#ava-card.deep-sleep .mic-mini,
#ava-card.deep-sleep .speaker-mini {
    display: none !important;
}

/* Green pulse animation for the avatar border */
@keyframes pulse-green-border {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(74, 222, 128, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

/* Apply pulse animation when minimized but NOT sleeping (i.e., Voice Mode) */
#ava-card.minimized.voice-mode .mini-avatar {
    animation: pulse-green-border 2s infinite;
}

/* --- 9. NEW: CONTENT DOCK --- */
.content-dock {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;

    display: flex;
    gap: 0.75rem; /* 12px */
    padding: 0.75rem; /* 12px */

    /* Glassmorphism Pill */
    background: var(--gv-chat-bg);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border-radius: 9999px;
    border: 1px solid var(--gv-accent);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* Hide dock when an overlay (album) is open */
body.gv-overlay-open .content-dock {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
}

.dock-btn {
    position: relative;
    background: var(--gv-button-bg);
    border: 1px solid var(--gv-accent);
    color: var(--gv-button-text);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.dock-btn.visible {
    display: flex; /* Shown by JS */
}
.dock-btn:hover, .dock-btn.active {
    background: var(--gv-secondary);
    transform: translateY(-15px) scale(1.2);
}

.rise-up-menu {
    position: absolute;
    bottom: 120%; /* Position above the button */
    left: 50%;
    transform: translateX(-50%);
    
    display: none; /* Hidden by default */
    flex-direction: column;
    gap: 8px;
    padding: 8px;

    width: 200px; /* Example width */
    background: var(--gv-chat-bg);
    backdrop-filter: blur(12px) saturate(180%);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.dock-btn:hover .rise-up-menu {
    display: flex; /* Show on hover for now */
}
.rise-up-item {
    color: var(--gv-chat-text);
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    transition: background 0.2s;
}
.rise-up-item:hover {
    background: var(--gv-secondary);
}

/* === ALBUM OVERLAY === */
.gv-album {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(env(safe-area-inset-top), 18px)
             max(env(safe-area-inset-right), 18px)
             max(env(safe-area-inset-bottom), 120px)
             max(env(safe-area-inset-left), 18px);
    box-sizing: border-box;
    z-index: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.gv-album:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

/* Glass Card matching Ava */
.gv-album-card {
    width: min(1100px, 92vw);
    height: min(80vh, 700px);
    max-height: calc(100vh - 180px);
    display: flex;
    flex-direction: column;

    background: var(--gv-chat-bg);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-radius: 30px;
    border: 1px solid var(--gv-accent);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    overflow: hidden;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.4s cubic-bezier(.19,1,.22,1);
}

.gv-album:not(.hidden) .gv-album-card {
    transform: translateY(0) scale(1);
}

/* Header */
.gv-album-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gv-accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--gv-chat-text);
}

.gv-album-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.gv-album-close {
    background: var(--gv-button-bg);
    border: none;
    color: var(--gv-button-text);
    font-size: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
}

/* Body Layout */
.gv-album-body {
    flex: 1;
    display: flex;
    gap: 30px;
    padding: 24px;
    overflow: hidden;
}

.gv-album-text {
    width: 32%;
    color: var(--gv-chat-text);
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
}

.gv-album-viewer {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: 10px;
}

.gv-album-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.gv-album-caption {
    font-size: 13px;
    color: var(--gv-chat-text);
    text-align: center;
    max-width: 90%;
    padding: 0 12px;
}

.gv-album-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gv-button-bg);
    border: none;
    color: var(--gv-button-text);
    font-size: 26px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
}

.gv-album-nav.prev { left: 10px; }
.gv-album-nav.next { right: 10px; }

/* Thumbnail Dock */
.gv-album-thumbs {
    display: flex;
    gap: 10px;
    padding: 14px 24px;
    justify-content: center;
    align-items: flex-end;
    background: var(--gv-chat-bg);
}

.gv-album-thumb-wrap {
    position: relative;
    display: inline-flex;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: transform 0.25s ease;
}

.gv-album-thumb {
    height: 60px;
    border-radius: 10px;
    cursor: pointer;
}

.gv-album-thumb-wrap:hover {
    transform: scale(1.6) translateY(-8px);
    z-index: 2;
}

.gv-album-thumb-wrap[data-caption]::after {
    content: attr(data-caption);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 70px;
    background: var(--gv-chat-bg);
    color: var(--gv-chat-text);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.gv-album-thumb-wrap[data-caption]:hover::after {
    opacity: 1;
}

@media (max-width: 900px) {
    .gv-album {
        align-items: flex-start;
    }
    .gv-album-card {
        width: 100%;
        height: calc(100vh - 160px);
        max-height: calc(100vh - 160px);
        border-radius: 22px;
    }
    .gv-album-body {
        flex-direction: column;
    }
    .gv-album-text {
        width: 100%;
        max-height: 140px;
    }
    .gv-album-thumbs {
        overflow-x: auto;
        justify-content: flex-start;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .gv-album-thumbs::-webkit-scrollbar { display: none; }
}

/* === CONTENT OVERLAY (VIDEO/DOCS) === */
.gv-content-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(env(safe-area-inset-top), 18px)
             max(env(safe-area-inset-right), 18px)
             max(env(safe-area-inset-bottom), 120px)
             max(env(safe-area-inset-left), 18px);
    box-sizing: border-box;
    z-index: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.gv-content-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}
.gv-content-card {
    width: min(980px, 92vw);
    height: min(75vh, 640px);
    max-height: calc(100vh - 180px);
    display: flex;
    flex-direction: column;
    background: var(--gv-chat-bg);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-radius: 26px;
    border: 1px solid var(--gv-accent);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    overflow: hidden;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.4s cubic-bezier(.19,1,.22,1);
}
.gv-content-overlay:not(.hidden) .gv-content-card {
    transform: translateY(0) scale(1);
}
.gv-content-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gv-accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--gv-chat-text);
}
.gv-content-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}
.gv-content-close {
    background: var(--gv-button-bg);
    border: none;
    color: var(--gv-button-text);
    font-size: 18px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
}
.gv-content-body {
    flex: 1;
    padding: 16px 20px 20px;
    overflow: auto;
    color: var(--gv-chat-text);
}
.gv-content-body iframe,
.gv-content-body video {
    width: 100%;
    height: 100%;
    min-height: 260px;
    border: 0;
    border-radius: 16px;
    background: rgba(0,0,0,0.5);
}
@media (max-width: 900px) {
    .gv-content-overlay {
        align-items: flex-start;
    }
    .gv-content-card {
        width: 100%;
        height: calc(100vh - 160px);
        max-height: calc(100vh - 160px);
        border-radius: 22px;
    }
}
