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

:root {
    --bg-primary: #0a0f1a;
    --bg-secondary: #111827;
    --bg-glass: rgba(17, 24, 39, 0.7);
    --bg-glass-hover: rgba(31, 41, 55, 0.8);
    --accent-primary: #10b981;
    --accent-secondary: #059669;
    --accent-glow: rgba(16, 185, 129, 0.3);
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --doctor-bubble: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    --patient-bubble: rgba(31, 41, 55, 0.9);
    --border-color: rgba(55, 65, 81, 0.5);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(16, 185, 129, 0.15);
}

body {
    font-family: 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    background-image: 
        radial-gradient(ellipse at top left, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(20, 184, 166, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, #0a0f1a 0%, #111827 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    color: var(--text-primary);
}

.app-container {
    width: 100%;
    max-width: 480px;
    height: 90vh;
    max-height: 800px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(17, 24, 39, 0.6);
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.doctor-avatar {
    width: 48px;
    height: 48px;
    background: var(--doctor-bubble);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.header-text h1 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.status {
    font-size: 0.75rem;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

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

.new-chat-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-chat-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lang-toggle-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-toggle-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scroll-behavior: smooth;
}

.chat-container::-webkit-scrollbar {
    width: 4px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.welcome-message {
    text-align: center;
    padding: 2rem 1rem;
    animation: fadeIn 0.5s ease;
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.welcome-message h2 {
    font-size: 1.5rem;
    color: var(--accent-primary);
    margin-bottom: 0.75rem;
}

.welcome-message p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.disclaimer {
    font-size: 0.8125rem !important;
    color: var(--text-muted) !important;
    margin-top: 1rem !important;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.message {
    display: flex;
    gap: 0.625rem;
    animation: slideIn 0.3s ease;
}

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

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

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.message.doctor .message-avatar {
    background: var(--doctor-bubble);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.message.patient .message-avatar {
    background: rgba(55, 65, 81, 0.6);
}

.message-bubble {
    max-width: 80%;
    padding: 0.875rem 1rem;
    border-radius: 16px;
    font-size: 0.9375rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.doctor .message-bubble {
    background: var(--doctor-bubble);
    color: white;
    border-bottom-left-radius: 4px;
}

.message.patient .message-bubble {
    background: var(--patient-bubble);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-right-radius: 4px;
}

.message.doctor {
    position: relative;
}

.speak-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.speak-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.3);
}

.typing-indicator {
    display: none;
    align-self: flex-start;
    padding: 0.875rem 1rem;
    background: rgba(13, 148, 136, 0.2);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.typing-indicator.show {
    display: flex;
    gap: 0.25rem;
    animation: slideIn 0.3s ease;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-4px); opacity: 1; }
}

.input-container {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(17, 24, 39, 0.6);
    border-top: 1px solid var(--border-color);
}

.input-container input {
    flex: 1;
    padding: 0.875rem 1rem;
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    outline: none;
    transition: all 0.2s ease;
}

.input-container input::placeholder {
    color: var(--text-muted);
}

.input-container input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.send-btn {
    width: 48px;
    height: 48px;
    background: var(--doctor-bubble);
    border: none;
    border-radius: 16px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

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

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

.mic-btn {
    width: 48px;
    height: 48px;
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mic-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.mic-btn.listening {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    animation: pulse-mic 1s ease-in-out infinite;
}

@keyframes pulse-mic {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
}

.voice-toggle-btn {
    width: 40px;
    height: 40px;
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.voice-toggle-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.voice-toggle-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }

    .app-container {
        height: 100vh;
        max-height: none;
        border-radius: 16px;
    }

    .chat-header {
        padding: 0.875rem 1rem;
    }

    .new-chat-btn span {
        display: none;
    }

    .message-bubble {
        max-width: 85%;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.summary-block {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.summary-block h4 {
    color: var(--accent-primary);
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-block ul {
    list-style: none;
    padding: 0;
}

.summary-block li {
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.25rem 0;
    padding-left: 1rem;
    position: relative;
}

.summary-block li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

.solution-block {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 0.75rem;
}

.solution-block h4 {
    color: #60a5fa;
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.solution-block p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}
