/* Khung chat Philo AI cho website WordPress (class Philo_AI_Frontend_Chatbox) */
.philo-fe, .philo-fe * { box-sizing: border-box; }
.philo-fe { font-family: inherit; font-size: 14px; line-height: 1.5; }

.philo-fe-fab {
    position: fixed; right: 20px; bottom: 20px; z-index: 999999;
    width: 60px; height: 60px; border: 0; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 28px;
    background: linear-gradient(135deg, #0b57d0, #8224e3); color: #fff;
    box-shadow: 0 4px 12px rgba(11, 87, 208, 0.3); transition: transform 0.2s ease;
}
.philo-fe-fab:hover { transform: scale(1.05); }
.philo-fe-fab:focus-visible, .philo-fe button:focus-visible, .philo-fe input:focus-visible { outline: 2px solid #8224e3; outline-offset: 2px; }

.philo-fe-panel {
    position: fixed; right: 20px; bottom: 90px; z-index: 999999;
    width: 360px; height: 520px; max-width: calc(100vw - 32px); max-height: calc(100vh - 110px);
    display: flex; flex-direction: column; overflow: hidden;
    background: #fff; border: 1px solid #eef2f6; border-radius: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}
.philo-fe-panel[hidden] { display: none; }

.philo-fe-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: linear-gradient(135deg, #0b57d0, #8224e3); color: #fff; }
.philo-fe-header h4 { margin: 0; font-size: 16px; color: #fff; }
.philo-fe-close { border: 0; background: none; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }

.philo-fe-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px; background: #f8fafc; }
.philo-fe-msg { max-width: 85%; padding: 9px 13px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.philo-fe-msg--bot { align-self: flex-start; background: #fff; color: #0f172a; border: 1px solid #e2e8f0; border-bottom-left-radius: 2px; }
.philo-fe-msg--staff { align-self: flex-start; background: #ecfdf5; color: #064e3b; border: 1px solid #a7f3d0; border-bottom-left-radius: 2px; }
.philo-fe-msg--user { align-self: flex-end; background: #0b57d0; color: #fff; border-bottom-right-radius: 2px; }
.philo-fe-msg--typing { color: #64748b; animation: philo-fe-pulse 1.2s ease-in-out infinite; }
@keyframes philo-fe-pulse { 50% { opacity: 0.45; } }

.philo-fe-status { margin: 0; padding: 6px 16px; font-size: 12px; color: #047857; background: #ecfdf5; border-top: 1px solid #d1fae5; }
.philo-fe-status[hidden] { display: none; }

.philo-fe-footer { display: flex; gap: 8px; padding: 12px; background: #fff; border-top: 1px solid #eef2f6; margin: 0; }
.philo-fe-footer input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 20px; font: inherit; color: #0f172a; background: #fff; }
.philo-fe-footer button { border: 0; border-radius: 20px; padding: 0 16px; font: inherit; font-weight: 600; color: #fff; background: #0b57d0; cursor: pointer; }

@media (max-width: 480px) {
    .philo-fe-panel { right: 16px; bottom: 86px; height: calc(100vh - 110px); }
}
@media (prefers-reduced-motion: reduce) {
    .philo-fe-fab, .philo-fe-msg--typing { transition: none; animation: none; }
}
