/* --- PROFESSIONAL THEME VARIABLES --- */
:root {
    --primary: #4f46e5;
    --bg-color: #f1f5f9;
    --white: #ffffff;
    --text-dark: #1e293b;
    --msg-sent: #4f46e5;
    --msg-received: #ffffff;
    --border: #e2e8f0;
}

body, html { margin: 0; padding: 0; height: 100%; font-family: 'Inter', sans-serif; background: var(--bg-color); }

/* Centered Layout Container */
.chat-layout {
    display: flex; flex-direction: column;
    height: 100vh; max-width: 100%; margin: 0 auto;
    background: var(--bg-color);
}

/* --- HEADER --- */
.chat-header {
    height: 70px; background: var(--white);
    display: flex; align-items: center; padding: 0 20px; gap: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); z-index: 10;
}

.profile-pic {
    width: 45px; height: 45px; border-radius: 50%;
    object-fit: cover; border: 2px solid #e0e7ff;
}

.header-info h3 { margin: 0; font-size: 17px; color: var(--text-dark); display: flex; align-items: center; gap: 6px; }
.header-info span { font-size: 13px; color: #10b981; font-weight: 500; display: flex; align-items: center; gap: 5px; }
.header-info span::before { content: ""; width: 8px; height: 8px; background: #10b981; border-radius: 50%; }

.verified-icon { color: var(--primary); font-size: 16px; }

/* --- MESSAGES AREA --- */
.messages-container {
    flex: 1; padding: 20px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 12px;
    background-color: #f8fafc;
    /* Subtle Dot Pattern */
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 24px 24px;
}

.loading-state {
    display: flex; flex-direction: column; align-items: center; 
    justify-content: center; height: 100%; color: #94a3b8;
}
.loading-state i { font-size: 30px; margin-bottom: 10px; }

/* Date Divider */
.date-badge {
    align-self: center; background: #e2e8f0; color: #64748b;
    padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 500; margin: 10px 0;
}

/* Bubbles */
.msg {
    max-width: 75%; padding: 12px 16px; border-radius: 14px;
    font-size: 15px; line-height: 1.5; position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); word-wrap: break-word;
}

/* Sent by User (Right) */
.msg.sent {
    align-self: flex-end;
    background: var(--msg-sent); color: white;
    border-bottom-right-radius: 2px;
}

/* Received from Admin (Left) */
.msg.received {
    align-self: flex-start;
    background: var(--msg-received); color: var(--text-dark);
    border-bottom-left-radius: 2px; border: 1px solid #e2e8f0;
}

.msg-time {
    display: block; font-size: 11px; margin-top: 5px;
    opacity: 0.7; text-align: right;
}

/* --- FOOTER INPUT --- */
.chat-footer {
    padding: 15px 20px; background: var(--white);
    border-top: 1px solid #e2e8f0;
}

#chatForm {
    display: flex; width: 100%; gap: 15px; align-items: center;
}

.input-wrapper {
    flex: 1; background: #f1f5f9; border-radius: 24px;
    padding: 5px 20px; display: flex; align-items: center;
    border: 1px solid transparent; transition: 0.2s;
}
.input-wrapper:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }

.input-wrapper input {
    flex: 1; border: none; background: transparent; padding: 10px 0;
    font-size: 15px; outline: none; color: var(--text-dark);
}

.btn-send {
    width: 50px; height: 50px; background: var(--primary); border: none;
    border-radius: 50%; color: white; font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3); transition: 0.2s;
}
.btn-send:hover { transform: scale(1.05); background: #4338ca; }
.btn-send:active { transform: scale(0.95); }