:root {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --accent-color: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(15, 23, 42, 0.6);
    --message-user-bg: rgba(59, 130, 246, 0.2);
    --message-ai-bg: rgba(255, 255, 255, 0.05);
    --blur-text-color: transparent;
    --blur-text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

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

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

.background-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.1) 0%, rgba(15, 23, 42, 0) 50%);
    z-index: -1;
    pointer-events: none;
    animation: pulse 10s infinite ease-in-out;
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 1rem;
}

header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 600;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: #94a3b8;
}

.chat-interface {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 0;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}

.chat-history::-webkit-scrollbar {
    width: 6px;
}

.chat-history::-webkit-scrollbar-thumb {
    background-color: var(--glass-border);
    border-radius: 3px;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: fadeIn 0.3s ease-out;
}

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

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

.message-content {
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    line-height: 1.6;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.user-message .message-content {
    background-color: var(--message-user-bg);
    border-bottom-right-radius: 0.2rem;
    color: #fff;
}

.ai-message .message-content {
    background-color: var(--message-ai-bg);
    border-bottom-left-radius: 0.2rem;
}

/* Hidden text effect */
.ai-message .hidden-text {
    color: var(--blur-text-color);
    text-shadow: var(--blur-text-shadow);
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.ai-message .hidden-text:hover {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.9);
}

.ai-message .hidden-text.revealed {
    color: var(--text-color);
    text-shadow: none;
}

.input-area {
    padding: 1rem;
    border-radius: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.api-key-container {
    width: 100%;
}

.glass-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
    resize: none;
}

.glass-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.input-controls {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

#user-input {
    flex: 1;
}

.glass-btn {
    background: var(--accent-color);
    border: none;
    border-radius: 0.75rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.glass-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

.glass-btn:active {
    transform: translateY(0);
}

.glass-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

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

/* Loading indicator */
.typing-indicator {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
}

.typing-dot {
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--text-color);
    border-radius: 50%;
    opacity: 0.5;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}