/* futuristic-ai-ui.css */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap');

:root {
    --bg-color: #1a1a2e;
    --primary-glow: #00bcd4;
    --secondary-glow: #e91e63;
    --text-color: #f0f0f0;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.2);
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    margin: 0;
    transition: background-image 0.5s ease-in-out, background-color 0.5s ease-in-out;
}

#chat-container {
    width: 100%;
    height: 100vh; /* Fallback for older browsers */
    height: 100dvh; /* Resizes dynamically when keyboard appears */
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#chat-header {
    background: linear-gradient(90deg, var(--primary-glow), var(--secondary-glow));
    color: white;
    padding: 15px 20px;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

#chat-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 1px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

#theme-switcher {
    display: flex;
    gap: 8px;
}

.theme-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: transform 0.2s ease;
}
.theme-btn:hover {
    transform: scale(1.2);
}

#close-chat-btn {
    color: white;
    text-decoration: none;
    font-size: 2.2rem;
    font-weight: 300;
    line-height: 1;
    transition: transform 0.2s ease;
}
#close-chat-btn:hover {
    transform: scale(1.2);
}

#chat-log {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-glow) transparent;
}
#chat-log::-webkit-scrollbar { width: 8px; }
#chat-log::-webkit-scrollbar-thumb { background-color: var(--primary-glow); border-radius: 4px; }

.message {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 20px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: messageFadeIn 0.5s ease;
}

.user-message {
    background: linear-gradient(45deg, #e91e63, #c2185b);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.ai-message {
    background: var(--glass-bg);
    color: var(--text-color);
    align-self: flex-start;
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 5px;
}

.ai-message .more-link {
    display: block;
    margin-top: 10px;
    font-weight: 600;
    color: var(--primary-glow);
    text-decoration: none;
}
.ai-message .more-link:hover {
    text-decoration: underline;
}

#input-form {
    display: flex;
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

#user-input {
    flex-grow: 1;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: 25px;
    outline: none;
    transition: all 0.3s ease;
}
#user-input:focus {
    border-color: var(--primary-glow);
    box-shadow: 0 0 10px var(--primary-glow);
}

#input-form button {
    background: var(--primary-glow);
    color: white;
    border: none;
    padding: 0 25px;
    margin-left: 10px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}
#input-form button:hover {
    background: var(--secondary-glow);
    box-shadow: 0 0 15px var(--secondary-glow);
    transform: translateY(-2px);
}

/* --- FUTURISTIC THEME DEFINITIONS --- */
/* Cyberpunk Neon */
body.theme-dark {
    background-image: linear-gradient(145deg, #0d0221 0%, #0c164f 100%);
    --text-color: #e0e0e0;
}
/* Quantum Glass */
body.theme-light {
    background-image: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    --text-color: #212529;
}
/* Galactic Void */
body.theme-purple {
    background-image: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    --text-color: #d8d8d8;
}
/* Matrix Code */
body.theme-green {
    background-image: linear-gradient(180deg, #000000 0%, #0a2208 100%);
    --text-color: #39ff14; /* A classic matrix green */
}
/* Plasma Core */
body.theme-orange {
    background-image: radial-gradient(circle at center, #4d0000 0%, #1a0000 100%);
    --text-color: #ffc107; /* A fiery gold */
}

/* --- THEME BUTTON COLORS --- */
.theme-btn[data-theme="theme-dark"] { background: #0c164f; }
.theme-btn[data-theme="theme-light"] { background: #D1D1D1; }
.theme-btn[data-theme="theme-purple"] { background: #1b2735; }
.theme-btn[data-theme="theme-green"] { background: #0a2208; }
.theme-btn[data-theme="theme-orange"] { background: #4d0000; }


/* --- TYPING INDICATOR --- */
.typing-indicator { display: flex; align-items: center; padding: 5px 0; }
.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #9E9E9E;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }

/* --- ANIMATIONS --- */
@keyframes messageFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

