:root {
    --primary-red: #B71C1C;
    --dark-red: #7f0000;
    --black: #000000;
    --grey-bg: #f9f9f9;
    --white: #FFFFFF;
    --shadow: 0 4px 15px rgba(0,0,0,0.15);
    --bot-gradient: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
    --header-gradient: linear-gradient(135deg, #B71C1C 0%, #000000 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: transparent;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#chat-container {
    width: 100%;
    height: 100vh;
    max-width: 450px;
    background:#6d6d6d;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    position: relative;
    border-radius: 12px;
}

/* Header Styling */
.chat-header {
    padding: 15px 20px;
    background: var(--header-gradient);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 10;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

#bot-logo {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
}

.header-info h1 {
    font-size: 1.1rem;
    font-weight: 600;
}

.status {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.9;
}

.status i {
    color: #4CAF50;
    font-size: 0.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-actions button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-actions button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.header-actions button.active {
    background: white;
    color: var(--primary-red);
}

#lang-select {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
    font-weight: 500;
}

#lang-select option {
    background: var(--dark-red);
    color: white;
}

/* Chat Body */
#chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: var(--grey-bg);
    background-image: url('doodle_bg.png');
    background-size: 300px;
    background-repeat: repeat;
    background-blend-mode: overlay;
}

.message {
    max-width: 80%;
    margin-bottom: 5px;
    display: flex;
    flex-direction: column;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

.message-time {
    font-size: 0.65rem;
    color: #888;
    margin-top: 4px;
    padding: 0 5px;
}

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

.bot-message .message-content {
    background: #f9f9f9;
    color: var(--black);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.bot-message .message-content h3 {
    color: var(--primary-red);
    font-size: 1.05rem;
    margin: 10px 0 5px 0;
    font-weight: 700;
}

.bot-message .message-content strong {
    color: var(--dark-red);
    font-weight: 600;
}

.bot-message .message-content p {
    margin-bottom: 5px;
}

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

.user-message .message-content {
    background: var(--header-gradient);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.2);
}

/* Suggestions */
.suggestions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.suggestion-chip {
    padding: 8px 15px;
    background: white;
    border: 1px solid var(--primary-red);
    color: var(--primary-red);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-chip:hover {
    background: var(--primary-red);
    color: white;
    transform: translateY(-2px);
}

/* Footer & Input */
.chat-footer {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #eee;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #f0f2f5;
    border-radius: 25px;
    padding: 5px 5px 5px 15px;
}

#mic-btn {
    background: none;
    border: none;
    color: #7f8c8d;
    font-size: 1.1rem;
    cursor: pointer;
    margin-right: 5px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mic-btn:hover {
    color: var(--primary-red);
}

#mic-btn.recording {
    color: var(--primary-red);
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

#user-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 0.95rem;
    outline: none;
    color: var(--black);
}

#send-btn {
    width: 35px;
    height: 35px;
    border: none;
    background: var(--primary-red);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s;
}

#send-btn:hover {
    transform: scale(1.1);
    background: var(--dark-red);
}

.footer-credit {
    text-align: center;
    font-size: 0.7rem;
    color: #888;
    margin-top: 12px;
    letter-spacing: 0.5px;
}

.footer-credit b {
    color: var(--primary-red);
    font-weight: 600;
}

/* Autocomplete Box */
.autocomplete-box {
    position: absolute;
    bottom: 80px;
    left: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.2);
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 9999;
    border: 1px solid #ddd;
}

.autocomplete-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f9f9f9;
    font-size: 0.9rem;
    color: #333;
    transition: background 0.2s;
}

.autocomplete-item:hover {
    background: #fdf2f2;
    color: var(--primary-red);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

/* Animations */
.fadeIn {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Custom Scrollbar */
#chat-body::-webkit-scrollbar {
    width: 5px;
}

#chat-body::-webkit-scrollbar-track {
    background: transparent;
}

#chat-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

/* Responsive Upgrades */
@media (max-width: 480px) {
    #chat-container {
        max-width: 100%;
        border-radius: 0;
    }
    
    .chat-header {
        border-radius: 0;
        padding: 12px 15px;
    }

    .header-info h1 {
        font-size: 1rem;
    }

    .header-actions {
        gap: 8px;
    }

    .header-actions button {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .message-content {
        font-size: 0.9rem;
        padding: 10px 14px;
    }

    .footer-credit {
        font-size: 0.6rem;
    }

    .autocomplete-box {
        left: 10px;
        right: 10px;
    }
}

/* Small heights (e.g. landscape mode) */
@media (max-height: 500px) {
    .chat-header {
        padding: 5px 15px;
    }
    
    #bot-logo {
        width: 35px;
        height: 35px;
    }

    .chat-footer {
        padding: 10px 15px;
    }
}
