/* ── Explore with Eli — Immersive Full-Screen Chat UI ──
   Layout, glow, backdrop. Message styles in eli-chat.css.
   ── */

/* ── Glow angle registration (enables animating conic-gradient) ── */
@property --explore-glow-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

/* ── Backdrop — dims the page when chat is open ── */
.explore-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 999;
    pointer-events: none;
    transition: background 0.4s ease;
}
.explore-backdrop.visible {
    background: rgba(0, 0, 0, 0.88);
    pointer-events: all;
}

/* ── Floating Trigger — centered bottom pill ── */
.explore-floating-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 100%;
    max-width: 480px;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.explore-floating-container.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

/* ── Input Wrapper — the glow pill ── */
.explore-input-wrapper {
    position: relative;
    background: #0e1017;
    border-radius: 30px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    pointer-events: all;
    z-index: 1;
    cursor: pointer;
}

/* ── Neon Glow — conic-gradient pseudo-element ── */
.explore-input-wrapper::before {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 30px;
    background: conic-gradient(from var(--explore-glow-angle), #d4a853, #4ecdc4, #9b72cf, #d4a853);
    filter: blur(12px);
    opacity: 0.25;
    z-index: -1;
    animation:
        explore-glow-rotate 8s linear infinite,
        explore-glow-breathe 4s ease-in-out infinite;
}

/* Hover — brighter glow */
.explore-input-wrapper:hover::before {
    opacity: 0.55;
    filter: blur(14px);
    animation:
        explore-glow-rotate 6s linear infinite,
        explore-glow-breathe 3s ease-in-out infinite;
}

@keyframes explore-glow-rotate {
    to { --explore-glow-angle: 360deg; }
}

@keyframes explore-glow-breathe {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 0.45; }
}

/* ── Trigger Input Field ── */
.explore-input-field {
    flex: 1;
    background: transparent;
    border: none;
    color: #e8eaf0;
    font-family: 'Source Serif 4', serif;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    outline: none;
    cursor: pointer;
}

.explore-input-field::placeholder {
    color: rgba(196, 200, 212, 0.4);
}

/* ── Chat Window — full-screen immersive ── */
.explore-chat-window {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.explore-chat-window.visible {
    opacity: 1;
    pointer-events: all;
}

/* ── Bottom glow bar — Siri-style animated gradient at bottom edge ── */
.explore-bottom-glow {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    z-index: 1002;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    overflow: visible;
    background: linear-gradient(
        to top,
        rgba(212, 168, 83, 0.12) 0%,
        rgba(78, 205, 196, 0.06) 30%,
        transparent 100%
    );
}
.explore-bottom-glow.visible {
    opacity: 1;
}
/* Animated color sweep — lifted 8px so blur radiates upward into view */
.explore-bottom-glow::before {
    content: "";
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    height: 4px;
    background: conic-gradient(from var(--explore-glow-angle), #d4a853, #4ecdc4, #9b72cf, #d4a853);
    filter: blur(8px);
    opacity: 0.7;
    animation: explore-glow-rotate 6s linear infinite;
}
/* Wider diffuse glow — lifted so the blur bloom stays visible */
.explore-bottom-glow::after {
    content: "";
    position: absolute;
    bottom: 12px;
    left: 5%;
    right: 5%;
    height: 70px;
    background: conic-gradient(from var(--explore-glow-angle), #d4a853, #4ecdc4, #9b72cf, #d4a853);
    filter: blur(45px);
    opacity: 0.25;
    animation: explore-glow-rotate 6s linear infinite;
}

/* ── Close button — top right ── */
.explore-chat-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: 1px solid rgba(196, 200, 212, 0.15);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    color: rgba(196, 200, 212, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: color 0.2s, border-color 0.2s;
}
.explore-chat-close:hover {
    color: #e8eaf0;
    border-color: rgba(212, 168, 83, 0.3);
}

/* ── Chat content area — wide, scrollable ── */
.explore-chat-content {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 2rem 2.5rem;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
}

/* ── EliChat fills the content area ── */
.explore-chat-window .eli-chat {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Spacer pushes messages to bottom when few, collapses when many */
.explore-chat-window .eli-chat__messages::before {
    content: "";
    flex: 1 1 auto;
}

.explore-chat-window .eli-chat__messages {
    max-height: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 1rem 0.5rem 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 168, 83, 0.15) transparent;
}

/* Wider messages in fullscreen */
.explore-chat-window .eli-chat__msg {
    max-width: 95%;
}
.explore-chat-window .eli-chat__msg--eli {
    padding: 0.8rem 1.1rem;
}

/* ── Input in fullscreen — glow treatment ── */
.explore-chat-window .eli-chat__input-row {
    position: relative;
    background: #0e1017;
    border-radius: 24px;
    padding: 0.4rem 0.5rem 0.4rem 0.8rem;
    gap: 0.4rem;
    flex-shrink: 0;
    box-sizing: border-box;
}

.explore-chat-window .eli-chat__input-row::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 26px;
    background: conic-gradient(from var(--explore-glow-angle), #d4a853, #4ecdc4, #9b72cf, #d4a853);
    filter: blur(10px);
    opacity: 0.15;
    z-index: -1;
    animation: explore-glow-rotate 8s linear infinite;
}

.explore-chat-window .eli-chat__input {
    background: transparent;
    border: none;
    border-radius: 0;
}
.explore-chat-window .eli-chat__input:focus {
    box-shadow: none;
    border-color: transparent;
}

.explore-chat-window .eli-chat__send {
    border: none;
    border-radius: 20px;
    width: 2.2rem;
    height: 2.2rem;
}

/* ── When audio mini-player is visible, push trigger above it ── */
body.voice-mini-active .explore-floating-container {
    bottom: calc(2rem + 52px);
}

/* ── Mobile ── */
@media (max-width: 600px) {
    .explore-floating-container {
        bottom: 1rem;
        max-width: calc(100% - 2rem);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .explore-input-wrapper {
        padding: 0.4rem 0.75rem;
    }
    .explore-input-field {
        font-size: 16px; /* prevent iOS zoom — must be exactly 16px, not rem */
    }
    .explore-chat-window {
        /* respect safe areas on notched phones */
        padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
        overflow-x: hidden;
    }
    .explore-chat-content {
        padding: 0.75rem 0.75rem 0.5rem;
        max-width: 100%;
    }
    .explore-chat-close {
        top: 0.6rem;
        right: 0.6rem;
        width: 2.8rem;
        height: 2.8rem;
        /* larger tap target on mobile */
    }
    /* messages area — give room for input above keyboard */
    .explore-chat-window .eli-chat__messages {
        padding: 0.5rem 0.25rem;
    }
    /* input row — taller for thumb-friendly tapping */
    .explore-chat-window .eli-chat__input-row {
        padding: 0.35rem 0.4rem 0.35rem 0.65rem;
        border-radius: 20px;
    }
    .explore-chat-window .eli-chat__input {
        font-size: 16px; /* prevent iOS zoom */
        min-height: 2.2rem;
    }
    .explore-chat-window .eli-chat__send {
        width: 2.4rem;
        height: 2.4rem;
        min-width: 2.4rem;
    }
    /* Eli messages — full width on mobile */
    .explore-chat-window .eli-chat__msg {
        max-width: 100%;
    }
    .explore-chat-window .eli-chat__msg--eli {
        padding: 0.4rem 0;
    }
    /* mini-player offset on mobile — 64px clears the taller mobile mini-player */
    body.voice-mini-active .explore-floating-container {
        bottom: calc(1rem + 64px);
    }
}
