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

body {
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    background:
        radial-gradient(1200px 700px at 18% 20%, rgba(106, 17, 203, 0.20), transparent 60%),
        radial-gradient(1000px 650px at 82% 18%, rgba(37, 117, 252, 0.18), transparent 55%),
        linear-gradient(135deg, #0b1220, #0f1a33);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Voice Welcome Overlay */
.voice-welcome {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(6px);
    z-index: 9999;
}

.voice-welcome.hidden {
    display: none;
}

.voice-card {
    width: 100%;
    max-width: 520px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
    padding: 18px 18px 16px;
}

.voice-title {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 6px;
}

.voice-subtitle {
    font-size: 13px;
    line-height: 1.45;
    color: rgba(17, 24, 39, 0.75);
    margin-bottom: 12px;
}

.voice-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.voice-btn {
    appearance: none;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #ffffff;
    color: #111827;
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 700;
    cursor: pointer;
}

.voice-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}

.voice-btn-primary {
    border: none;
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: #fff;
}

.voice-btn-primary:hover {
    filter: brightness(1.03);
}

/* Chat Container */
.chat-container {
    width: 100%;
    max-width: 720px;
    min-height: 560px;
    background: rgba(255,255,255,0.92);
    border-radius: 28px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(10px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: #fff;
    padding: 18px 22px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.16);
}

.chat-header h2 {
    font-size: 1.65rem;
    margin: 0;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #4caf50;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 1.5s infinite;
}

.status-text {
    font-size: 0.9rem;
    color: #e0e0e0;
}

@keyframes pulse {
    0% { transform: scale(0.95); }
    50% { transform: scale(1.1); }
    100% { transform: scale(0.95); }
}

/* Chat Box */
.chat-box {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: rgba(17,24,39,0.03);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Chat Messages */
.message {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 15px;
    position: relative;
    animation: fadeIn 0.3s ease-in-out;
    white-space: pre-wrap;
}

.user-message {
    background: #6a11cb;
    color: #fff;
    align-self: flex-end;
}

.ai-message {
    background: rgba(0,0,0,0.06);
    color: rgba(17,24,39,0.92);
    align-self: flex-start;
}

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

/* Chat Input */
.chat-input {
    display: flex;
    align-items: center;
    padding: 10px;
    background: rgba(255,255,255,0.98);
    border-top: 1px solid rgba(0,0,0,0.06);
}

.chat-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid rgba(0,0,0,0.14);
    border-radius: 25px;
    outline: none;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.chat-input input:focus {
    border-color: #6a11cb;
}

.chat-input button {
    background: #6a11cb;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    box-shadow: 0 10px 22px rgba(106, 17, 203, 0.28);
}

.chat-input button:hover {
    background: #2575fc;
}

/* Responsive Design */
@media (max-width: 600px) {
    .chat-container {
        border-radius: 0;
        min-height: 76vh;
        max-width: 100%;
    }

    .chat-header {
        border-radius: 0;
    }
}