/*--------- Chatbot Interface Styles (Dynamic & Premium) ----------*/
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(15px, 4vw, 25px);
}

.message-container {
    margin-top: clamp(1.5rem, 4vw, 2.5rem);
}

.alert {
    padding: clamp(12px, 3vw, 20px) clamp(35px, 5vw, 25px) clamp(12px, 3vw, 20px) clamp(12px, 3vw, 20px);
    border-radius: clamp(8px, 2vw, 12px);
    text-align: center;
    position: relative;
    font-weight: 700;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.alert-danger { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }

.btn-close {
    background: transparent;
    border: none;
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: inherit;
    transition: transform 0.3s ease;
}
.btn-close:hover { transform: translateY(-50%) scale(1.2); }

.chatbot-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: clamp(40px, 8vw, 80px) 0;
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
}

.chat-row {
    display: flex;
    justify-content: center;
    width: 100%;
}

.chat-column {
    width: 100%;
    max-width: 850px;
    perspective: 1000px;
}

.chat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: clamp(20px, 4vw, 30px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.1), inset 0 0 0 1px rgba(255,255,255,0.8);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: clamp(550px, 80vh, 850px);
    animation: chatEntrance 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.chat-header {
    background: linear-gradient(135deg, var(--primary-brown, #8d6e63), var(--dark-coffee, #3e2723));
    color: var(--pure-white, #ffffff);
    padding: clamp(1.2rem, 3vw, 1.8rem);
    text-align: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    z-index: 10;
}

.chat-title {
    margin: 0 0 clamp(5px, 1.5vw, 0.8rem) 0;
    font-weight: 900;
    font-size: clamp(1.6rem, 4vw, 2rem);
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.chat-subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: clamp(0.95rem, 1.8vw, 1.05rem);
    font-weight: 500;
}

.chat-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

#chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: url('../images/chat-bg-pattern.png') repeat, rgba(255, 255, 255, 0.6);
    background-blend-mode: overlay;
}

.bot-intro {
    text-align: center;
    padding: clamp(1rem, 3vw, 1.5rem);
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    flex-shrink: 0;
    backdrop-filter: blur(5px);
}

.intro-badge {
    background: linear-gradient(135deg, #e0f7fa, #b2ebf2);
    color: #006064;
    padding: clamp(6px, 1.5vw, 8px) clamp(15px, 3vw, 20px);
    border-radius: 50px;
    font-size: clamp(0.85rem, 1.5vw, 0.95rem);
    font-weight: 700;
    display: inline-block;
    box-shadow: 0 2px 10px rgba(0, 188, 212, 0.15);
}

#chat-log {
    flex-grow: 1;
    padding: clamp(20px, 5vw, 40px);
    overflow-y: auto;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Chat Messages */
.message {
    max-width: 80%;
    padding: clamp(12px, 3vw, 16px) clamp(16px, 4vw, 22px);
    word-wrap: break-word;
    font-size: clamp(0.95rem, 1.8vw, 1.05rem);
    line-height: 1.6;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    animation: messagePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: bottom;
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 20px 20px 0 20px;
    transform-origin: bottom right;
}

.message.bot {
    align-self: flex-start;
    background: var(--pure-white, #ffffff);
    color: var(--dark-coffee, #3e2723);
    border-radius: 20px 20px 20px 0;
    border: 1px solid rgba(0,0,0,0.05);
    transform-origin: bottom left;
}

/* Typing Indicator */
.typing-indicator {
    align-self: flex-start;
    background: var(--pure-white, #ffffff);
    padding: clamp(14px, 3vw, 18px) clamp(20px, 4vw, 25px);
    border-radius: 20px 20px 20px 0;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    display: flex;
    gap: 8px;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
}

.typing-dot {
    width: 10px;
    height: 10px;
    background: var(--primary-brown, #8d6e63);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite cubic-bezier(0.4, 0, 0.2, 1) both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

/* Input Area */
.chat-input-area {
    padding: clamp(1.2rem, 3vw, 2rem);
    background: rgba(255,255,255,0.95);
    border-top: 1px solid rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.input-group {
    display: flex;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border-radius: 50px;
    overflow: hidden;
    width: 100%;
    background: white;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--primary-brown);
    box-shadow: 0 8px 25px rgba(141, 110, 99, 0.2);
}

.chat-input {
    flex-grow: 1;
    border: none;
    padding: clamp(1rem, 3vw, 1.2rem) clamp(1.5rem, 4vw, 2rem);
    font-size: clamp(1rem, 1.8vw, 1.1rem);
    background: transparent;
    outline: none;
    min-width: 0;
    color: var(--dark-coffee);
}

.btn-send {
    background: linear-gradient(135deg, var(--primary-brown), var(--dark-coffee));
    color: white;
    border: none;
    padding: 0 clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 800;
    font-size: clamp(1rem, 1.8vw, 1.1rem);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-send:hover, .btn-send:focus {
    filter: brightness(1.1);
    transform: scale(1.05);
    outline: none;
}

.btn-send:active {
    transform: scale(0.95);
}

/* Animations */
@keyframes chatEntrance {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes messagePop {
    from { opacity: 0; transform: scale(0.8) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6) translateY(0); opacity: 0.4; }
    40% { transform: scale(1.1) translateY(-6px); opacity: 1; }
}

@media (max-width: 576px) {
    .message { max-width: 90%; }
    .send-text { display: none; }
    .btn-send { padding: 0 clamp(1rem, 3vw, 1.5rem); }
}