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

html, body {
    height: 100%;
    width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Main Chat Container */
.chat-main-container {
    height: 90vh;
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
}

/* ===== HEADER SECTION ===== */
.chat-header {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 80px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    position: relative;
    z-index: 10;
}

/* Golden bottom border accent */
.chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #ffc107 0%, #ffb300 50%, #ffc107 100%);
}

/* Header Left - Flipkart Logo */
.header-left {
    flex: 1;
    display: flex;
    align-items: center;
}

.flipkart-branding {
    display: flex;
    align-items: center;
    gap: 6px;
}

.flipkart-text-logo {
    font-size: 34px;
    font-style: italic;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

.flipkart-logo-clean {
    height: 44px;
    width: auto;
    object-fit: contain;
}

/* Header Middle - Title */
.header-middle {
    flex: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffc107;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Header Right - Agent Info */
.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.agent-info-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.agent-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.agent-name {
    font-size: 18px;
    font-weight: 700;
    color: white;
    text-align: right;
}

.agent-subtitle {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

.agent-avatar-container {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.agent-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
    display: block;
    background: transparent;
}

.online-status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background-color: #4caf50;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.8);
}

/* ===== CHAT WRAPPER ===== */
.chat-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Chat Messages Container */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    background-color: #f9f9f9;
    scroll-behavior: smooth;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #1976d2;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #1565c0;
}

/* TODAY Label */
.today-label {
    text-align: center;
    color: #1976d2;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 16px 0 32px 0;
    padding: 0 20px;
}

/* ===== MESSAGE GROUPS ===== */
.message-group {
    display: flex;
    margin-bottom: 24px;
    align-items: flex-end;
    animation: slideIn 0.3s ease-in-out;
}

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

.message-group.user-group {
    justify-content: flex-end;
}

/* Bot Avatar in Messages */
.bot-avatar-msg {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 16px;
    flex-shrink: 0;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bot-avatar-msg .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* User Avatar in Chat */
.user-avatar-chat {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 16px;
    margin-right: 0;
    flex-shrink: 0;
    font-weight: 700;
    color: white;
    font-size: 18px;
    border: 4px solid #ffc107;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}

/* User Avatar in Input */
.user-avatar-input {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
}

.user-avatar-input .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ===== MESSAGES ===== */
.message {
    max-width: 60%;
    padding: 16px 20px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
    word-wrap: break-word;
    animation: messageAppear 0.3s ease-in-out;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bot Message */
.bot-message {
    background-color: #e8f5e9;
    color: #1b5e20;
    border-radius: 18px 18px 18px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.bot-message p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.6;
}

.bot-message p:last-child {
    margin-bottom: 0;
}

/* User Message */
.user-message {
    background-color: #e8f5e9;
    color: #1b5e20;
    border-radius: 18px 18px 0 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.user-message p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.6;
}

.user-message p:last-child {
    margin-bottom: 0;
}

/* Bot Response Content */
.bot-response {
    word-wrap: break-word;
    line-height: 1.6;
}

.bot-response b,
.bot-response strong {
    color: #1565c0;
    font-weight: 700;
}

.bot-response ul,
.bot-response ol {
    margin: 12px 0;
    padding-left: 24px;
}

.bot-response li {
    margin: 8px 0;
    line-height: 1.6;
}

.bot-response br {
    display: block;
    content: "";
    margin: 8px 0;
}

/* Error Message */
.message.error {
    background-color: #ffebee;
    color: #c62828;
}

/* Message Time */
.message-time {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
    display: block;
    text-align: right;
    font-weight: 500;
}

.bot-message .message-time {
    color: #558b2f;
}

.user-message .message-time {
    color: #558b2f;
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 12px 0;
}

.typing-indicator span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #1565c0;
    animation: typing 1.4s infinite;
}

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

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

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

/* ===== INPUT AREA ===== */
.chat-input-area {
    background-color: #f9f9f9;
    padding: 16px 20px;
    border-top: 1px solid #e8e8e8;
    min-height: 80px;
    display: flex;
    align-items: center;
}

.message-input-form {
    width: 100%;
}

.input-wrapper {
    display: flex;
    gap: 16px;
    align-items: center;
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 32px;
    padding: 12px 20px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: #1976d2;
    box-shadow: 0 0 20px rgba(25, 118, 210, 0.15);
}

.message-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: #333;
    font-family: inherit;
    background-color: transparent;
    height: 24px;
}

.message-input::placeholder {
    color: #999;
    font-size: 14px;
}

.message-input:focus::placeholder {
    color: #bbb;
}

.send-button {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.25);
}

.send-button:hover {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.35);
}

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

/* ===== RESPONSIVE DESIGN ===== */
/* Responsive rules removed as it's a fixed size widget now */