/*! GL Simulator IA — assets/simulator.css
 *  GyverLabs v5.x
 *  Interfaz del popup de simulación IA (Groq).
 */

/* ── Root ── */
#gl-sim-root {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Overlay backdrop ── */
#gl-sim-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
#gl-sim-overlay.gl-sim-open {
    opacity: 1;
    pointer-events: all;
}

/* ── Panel ── */
#gl-sim-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    overflow: hidden;
}
#gl-sim-panel.gl-sim-open {
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}

/* ── Header ── */
#gl-sim-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 14px;
    border-bottom: 1px solid #1f1f1f;
    flex-shrink: 0;
}
#gl-sim-title {
    font-size: 14px;
    font-weight: 600;
    color: #E8E0D0;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}
#gl-sim-title::before {
    content: '🤖';
    font-size: 16px;
}
#gl-sim-close {
    width: 32px;
    height: 32px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #888;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s, color 0.2s;
}
#gl-sim-close:hover { background: #2a2a2a; color: #E8E0D0; }

/* ── Messages ── */
#gl-sim-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    -webkit-overflow-scrolling: touch;
}
.gl-sim-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: #E8E0D0;
}
.gl-sim-msg-user {
    align-self: flex-end;
    background: #C9A84C22;
    border: 1px solid #C9A84C44;
}
.gl-sim-msg-ai {
    align-self: flex-start;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
}
.gl-sim-typing {
    display: flex;
    gap: 5px;
    padding: 14px 18px;
    align-self: flex-start;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
}
.gl-sim-dot {
    width: 7px;
    height: 7px;
    background: #C9A84C;
    border-radius: 50%;
    animation: gl-sim-bounce 1.2s infinite;
}
.gl-sim-dot:nth-child(2) { animation-delay: 0.2s; }
.gl-sim-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes gl-sim-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* ── Input ── */
#gl-sim-form {
    display: flex;
    gap: 10px;
    padding: 14px 24px 20px;
    border-top: 1px solid #1f1f1f;
    flex-shrink: 0;
}
#gl-sim-input {
    flex: 1;
    background: #111;
    border: 1px solid #2a2a2a;
    color: #E8E0D0;
    border-radius: 10px;
    padding: 11px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    min-height: 44px;
    max-height: 120px;
}
#gl-sim-input:focus { border-color: #C9A84C55; }
#gl-sim-input::placeholder { color: #555; }
#gl-sim-send {
    width: 44px;
    height: 44px;
    background: #C9A84C;
    color: #080808;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    transition: background 0.2s, transform 0.15s;
}
#gl-sim-send:hover { background: #d4b05e; transform: scale(1.05); }
#gl-sim-send:disabled { background: #333; color: #666; cursor: not-allowed; transform: none; }

/* ── Error / no-key state ── */
#gl-sim-nokey {
    padding: 32px 24px;
    text-align: center;
    color: #888;
    font-size: 13px;
    line-height: 1.8;
}
#gl-sim-nokey strong { color: #E8E0D0; display: block; margin-bottom: 8px; font-size: 15px; }
#gl-sim-nokey a { color: #C9A84C; text-decoration: none; }

/* ── Mobile ── */
@media (max-width: 480px) {
    #gl-sim-panel { max-width: 100%; border-radius: 14px 14px 0 0; }
    #gl-sim-messages { padding: 16px; }
    #gl-sim-form { padding: 12px 16px 18px; }
    #gl-sim-header { padding: 16px; }
}
