:root {
    --primary-color: #00bcd4;
    /* Cyan-ish for futuristic feel */
    --accent-color: #e0f7fa;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #ffffff;
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.background-glass {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, rgba(0, 188, 212, 0.15) 0%, transparent 60%);
}

.container {
    width: 100%;
    max-width: 800px;
    /* Tablet/Totem size - aumentado para melhor visualização */
    height: 95vh;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    overflow: hidden;
}

.header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    max-height: 40px;
    filter: brightness(0) invert(1);
    /* Ensure logo is white if it's black */
}

.chat-interface {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 0; /* Permite scroll correto */
}

.message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

.ai-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vivi-orb {
    width: 36px;
    height: 36px;
    background: radial-gradient(circle, #00e5ff 0%, #00bcd4 100%);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.6);
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

.bubble {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 18px;
    border-radius: 18px;
    border-top-left-radius: 4px;
    line-height: 1.6;
    font-weight: 300;
}

.bubble p {
    margin: 0;
}

.bubble strong {
    font-weight: 600;
    color: var(--primary-color);
}

.user-message .bubble {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.25) 0%, rgba(0, 151, 167, 0.25) 100%);
    border-top-left-radius: 18px;
    border-top-right-radius: 4px;
    border: 1px solid rgba(0, 188, 212, 0.4);
    backdrop-filter: blur(10px);
}

.input-area {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
}

#chat-form {
    display: flex;
    gap: 10px;
}

#user-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 16px 24px;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

#user-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.15);
}

#user-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.send-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #00acc1 100%);
    border: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 188, 212, 0.5);
}

.send-btn:active {
    transform: scale(0.95);
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(0, 229, 255, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 229, 255, 0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Screensaver */
.screensaver {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    transition: opacity 0.8s ease;
    z-index: 10;
    background: radial-gradient(circle at center, rgba(22, 33, 62, 0.9) 0%, rgba(10, 10, 20, 0.98) 100%);
    backdrop-filter: blur(8px);
}

.screensaver.active {
    opacity: 1;
    pointer-events: all;
}

.infinity-svg {
    width: 90%;
    max-width: 1200px;
    /* Large scale */
    height: auto;
    filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.3));
}

.infinity-path-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    /* Very faint track */
    stroke-width: 3;
}

.infinity-path {
    fill: none;
    stroke: url(#neonGradient);
    stroke-width: 6;
    stroke-linecap: round;
    /* Create a "comet" effect: dash len 800, gap 3200 (total len approx 3000) */
    stroke-dasharray: 800 3200;
    stroke-dashoffset: 4000;
    animation: neon-flow 3s linear infinite;
    filter: url(#glow);
}

@keyframes neon-flow {
    to {
        stroke-dashoffset: 0;
    }
}

.start-btn-neon {
    margin-top: 20px;
    padding: 15px 40px;
    background: transparent;
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    font-size: 1.5rem;
    font-weight: 300;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s ease;
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
    overflow: hidden;
}

.start-btn-neon:hover {
    color: #fff;
    border-color: #00e5ff;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
    background: rgba(0, 229, 255, 0.05);
}

/* Utility to hide UI when screensaver is active */
.ui-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* Quick Options */
.quick-options {
    padding: 16px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    border-top: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    max-height: 200px;
    overflow-y: auto;
}

.option-button {
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.option-button:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, #00acc1 100%);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 188, 212, 0.4);
    color: white;
}

.option-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 188, 212, 0.3);
}

.quick-options::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.quick-options::-webkit-scrollbar-track {
    background: transparent;
}

.quick-options::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}

.quick-options::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}