:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --bg-chat: #f0f2f5;
    --bg-bot: #ffffff;
    --bg-user: #0d6efd;
    --text-user: #ffffff;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.chat-container {
    width: 100%;
    max-width: 900px;
    height: 94vh;
    max-height: 860px;
    background: var(--bg-chat);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.bot-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header-badge .badge {
    font-size: 0.75rem;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 5px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

/* System Message */
.system-message {
    text-align: center;
    padding: 8px 16px;
    color: #6c757d;
    font-size: 0.8rem;
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 8px;
    max-width: 75%;
    animation: fadeInUp 0.3s ease-out;
}

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

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

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

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

.bot-message .message-avatar {
    background: var(--primary);
    color: white;
}

.user-message .message-avatar {
    background: #e9ecef;
    color: #495057;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.92rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.bot-message .message-bubble {
    background: var(--bg-bot);
    color: #212529;
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow);
}

.user-message .message-bubble {
    background: var(--bg-user);
    color: var(--text-user);
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    color: #adb5bd;
    margin-top: 4px;
    padding: 0 4px;
}

.user-message .message-time {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 8px;
    padding: 0 16px 8px;
    align-items: center;
}

.typing-dots {
    background: var(--bg-bot);
    padding: 10px 16px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #adb5bd;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

/* Quick Actions */
.quick-actions {
    padding: 8px 16px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 1px solid #e9ecef;
    background: white;
}

.quick-btn {
    font-size: 0.78rem;
    border-radius: 20px;
    white-space: nowrap;
    transition: all 0.2s;
}

.quick-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Input Area */
.chat-input {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}

.chat-input .form-control {
    border-radius: 24px;
    padding: 10px 20px;
    border: 2px solid #e9ecef;
    font-size: 0.92rem;
    transition: border-color 0.2s;
}

.chat-input .form-control:focus {
    border-color: var(--primary);
    box-shadow: none;
}

.chat-input .btn-primary {
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    flex-shrink: 0;
}

.input-footer {
    text-align: center;
    padding-top: 8px;
    font-size: 0.72rem;
}

/* Rating Stars */
.rating-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.rating-star {
    cursor: pointer;
    transition: transform 0.2s;
    opacity: 0.3;
}

.rating-star:hover,
.rating-star.active {
    transform: scale(1.2);
    opacity: 1;
}

/* Responsive */
@media (max-width: 576px) {
    body {
        background: var(--bg-chat);
        align-items: stretch;
    }
    
    .chat-container {
        max-width: 100%;
        height: 100vh;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
    }
}

@media (min-width: 577px) and (max-width: 960px) {
    .chat-container {
        max-width: 95%;
    }
}
