* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Poppins', system-ui, sans-serif;
}

body {
    background: radial-gradient(circle at 20% 30%, #8c15f4, #18badb);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    margin: 0;
}

.chat-container {
    width: 100%;
    max-width: 820px;
    height: 90vh;
    max-height: 700px;
    background: rgb(11, 197, 230);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgb(149, 0, 255);
    border-radius: 48px 48px 32px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(80, 140, 255, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    padding: 20px 28px;
    background: linear-gradient(145deg, rgba(177, 8, 255, 0.94), rgba(5, 8, 20, 0.9));
    border-bottom: 1px solid rgba(100, 180, 255, 0.25);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.avatar {
    background: radial-gradient(circle at 30% 30%, #c830ff, #2a3f8a);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    box-shadow: 0 0 20px #3f7bff88, 0 0 60px #1f4fcf44;
    border: 1px solid #a387ff;
}

.title-group {
    flex: 1;
}

.title-group h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #d6e6ff, #a0c8ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 1.5px;
    text-shadow: 0 0 20px #3a7eff66;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.title-group h1 i {
    font-size: 1.4rem;
    color: #f2ffb3;
    text-shadow: 0 0 30px #3f7bff;
}

.subtitle {
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: #98e7f0;
    opacity: 0.7;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.subtitle i {
    color: #7aa9ff;
}

.infinity-icon {
    color: #8bb4ff80;
    font-size: 1.6rem;
    margin-left: auto;
}

.chat-messages {
    flex: 1;
    padding: 24px 22px 12px 22px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgba(102, 3, 214, 0.692);
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: #0b0f1f;
    border-radius: 12px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: #118a67;
    border-radius: 12px;
    box-shadow: 0 0 20px #3f7bff88;
}

.message {
    max-width: 82%;
    padding: 14px 20px;
    border-radius: 28px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
    animation: fadeSlide 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 21, 21, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #1b2f6e, #0f1d4a);
    color: #06ff6e;
    border-bottom-right-radius: 8px;
    border: 1px solid #3a6adf55;
    box-shadow: 0 0 20px #1f77cf33;
}

.message.bot {
    align-self: flex-start;
    background: rgba(20, 30, 60, 0.8);
    backdrop-filter: blur(4px);
    color: #2bbc0a;
    border-bottom-left-radius: 8px;
    border: 1px solid #6f9eff44;
    box-shadow: 0 0 20px #3f7bff22;
}

.message.bot i {
    color: #44ef10;
    margin-right: 6px;
}

.message .code-block {
    background: #0a0e1f;
    border-left: 4px solid #3f7bff;
    padding: 12px 16px;
    border-radius: 12px;
    margin-top: 10px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-all;
    color: #17aebc;
    box-shadow: inset 0 0 20px #00000066;
    border: 1px solid #2f5fcf55;
    overflow-x: auto;
}

@keyframes fadeSlide {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.typing-indicator {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 8px 16px;
    background: rgba(10, 18, 40, 0.6);
    border-radius: 40px;
    width: fit-content;
    border: 1px solid #3f7bff33;
    margin-bottom: 4px;
}
.typing-indicator span {
    width: 10px;
    height: 10px;
    background: #8bb4ff;
    border-radius: 50%;
    animation: pulseDot 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulseDot {
    0%, 60%, 100% { opacity: 0.2; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1.2); }
}

.input-area {
    padding: 16px 22px 22px 22px;
    background: rgba(2, 5, 18, 0.7);
    backdrop-filter: blur(8px);
    border-top: 1px solid #2f4f8f55;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.input-area input {
    flex: 1;
    padding: 16px 20px;
    border-radius: 60px;
    border: 1px solid #3a6adf66;
    background: rgba(10, 18, 40, 0.8);
    color: #dfecff;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
    box-shadow: inset 0 0 20px #00000055;
    min-width: 160px;
}
.input-area input::placeholder {
    color: #8ba3d0;
    opacity: 0.6;
    letter-spacing: 0.5px;
}
.input-area input:focus {
    border-color: #6f9eff;
    box-shadow: 0 0 30px #3f7bff44, inset 0 0 20px #00000088;
}

.input-area button {
    background: radial-gradient(circle at 30% 30%, #4f7fff, #1f3f8f);
    border: none;
    padding: 0 28px;
    height: 58px;
    border-radius: 60px;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.25s;
    box-shadow: 0 0 30px #3f7bff66;
    border: 1px solid #7aa9ff88;
    letter-spacing: 1px;
}
.input-area button i {
    font-size: 1.2rem;
}
.input-area button:hover {
    transform: scale(1.03);
    background: radial-gradient(circle at 30% 30%, #6f9eff, #2f4faf);
    box-shadow: 0 0 50px #3f7bffaa;
}
.input-area button:active {
    transform: scale(0.96);
}

.voice-btn {
    background: rgba(14, 155, 207, 0.6);
    border: 1px solid #731ce5f7;
    border-radius: 60px;
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #0acfbc;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 0 20px #1f89cfa2;
}
.voice-btn:hover {
    background: #11c75ac1;
    color: rgb(164, 231, 22);
    box-shadow: 0 0 40px #3f7bff88;
}
.voice-btn.listening {
    background: #4f2f7f;
    border-color: #bf7fff;
    color: #ffd966;
    box-shadow: 0 0 60px #9f4fffaa;
    animation: pulseGlow 1s infinite;
}
@keyframes pulseGlow {
    0% { box-shadow: 0 0 20px #9f4fff66; }
    50% { box-shadow: 0 0 60px #bf7fffff; }
    100% { box-shadow: 0 0 20px #9f4fff66; }
}

.footer-note {
    text-align: center;
    font-size: 0.6rem;
    color: #4f6faf;
    padding: 6px 0 0 0;
    opacity: 0.5;
    letter-spacing: 2px;
}

@media (max-width: 600px) {
    .chat-container { height: 95vh; max-height: 700px; border-radius: 28px; }
    .header { padding: 14px 18px; }
    .title-group h1 { font-size: 1.4rem; }
    .input-area { padding: 12px 16px 18px; }
    .input-area button { padding: 0 18px; font-size: 0.9rem; height: 50px; }
    .voice-btn { width: 50px; height: 50px; font-size: 1.3rem; }
    .message { max-width: 92%; }
}