/* Chatbot & Cookie Banner Unified Styles */
/* ============ COOKIE BANNER ============ */
.cookie-banner{position:fixed;left:0;right:0;bottom:0;z-index:3000;background:#1f2937;color:#fff;font-family:'Prompt','Kanit','Sarabun',sans-serif;box-shadow:0 -2px 10px rgba(0,0,0,.25);transform:translateY(100%);transition:transform .35s ease; padding:12px 18px}
.cookie-banner.show{transform:translateY(0)}
.cookie-banner *{box-sizing:border-box}
.cookie-banner .cookie-banner-content{display:flex;flex-wrap:wrap;gap:14px;align-items:center;justify-content:space-between;max-width:1200px;margin:0 auto}
.cookie-banner .cookie-text{flex:1 1 420px;min-width:260px;font-size:13px;line-height:1.45}
.cookie-banner h5{margin:0 0 4px;font-size:15px;font-weight:600;display:flex;align-items:center;gap:6px}
.cookie-banner a{color:#60a5fa!important;text-decoration:underline}
.cookie-buttons{display:flex;gap:8px;flex-wrap:wrap}
.cookie-btn{cursor:pointer;border:none;border-radius:6px;font-size:13px;font-weight:600;padding:8px 14px;display:inline-flex;align-items:center;gap:6px;background:#374151;color:#fff;transition:background .2s ease,transform .15s ease}
.cookie-btn:hover{background:#4b5563}
.cookie-btn:active{transform:translateY(1px)}
.cookie-btn-accept{background:#059669}.cookie-btn-accept:hover{background:#10b981}
.cookie-btn-settings{background:#2563eb}.cookie-btn-settings:hover{background:#1d4ed8}
.cookie-btn-reject{background:#dc2626}.cookie-btn-reject:hover{background:#b91c1c}

/* ============ COOKIE MODAL ============ */
.cookie-modal{position:fixed;inset:0;z-index:4000;background:rgba(0,0,0,.55);display:none;align-items:flex-start;justify-content:center;padding:60px 20px 40px;overflow:auto}
.cookie-modal.show{display:flex}
.cookie-modal-content{width:100%;max-width:760px;background:#fff;border-radius:18px;padding:28px 30px 30px;box-shadow:0 12px 40px -4px rgba(0,0,0,.25);position:relative;animation:cookieModalFade .35s ease;font-family:'Prompt','Kanit','Sarabun',sans-serif}
@keyframes cookieModalFade{from{opacity:0;transform:translateY(15px)}to{opacity:1;transform:translateY(0)}}
.cookie-modal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.cookie-modal-title{font-size:20px;font-weight:600;margin:0;color:#111827}
.cookie-close{background:transparent;border:none;font-size:20px;cursor:pointer;color:#6b7280;padding:4px;border-radius:6px}
.cookie-close:hover{background:#f3f4f6;color:#111827}
.cookie-modal-body{max-height:60vh;overflow:auto;padding-right:6px}
.cookie-category{background:#f9fafb;border:1px solid #e5e7eb;padding:14px 16px 12px;border-radius:12px;margin-bottom:14px}
.cookie-category-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.cookie-category-title{font-size:15px;font-weight:600;margin:0;color:#1f2937}
.cookie-category-description{font-size:13px;color:#4b5563;margin:0;line-height:1.45}
.cookie-toggle{width:44px;height:24px;background:#d1d5db;border-radius:999px;position:relative;cursor:pointer;transition:background .25s ease;flex-shrink:0}
.cookie-toggle:before{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;background:#fff;border-radius:50%;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .25s ease}
.cookie-toggle.active{background:#2563eb}
.cookie-toggle.active:before{transform:translateX(20px)}
.cookie-toggle.disabled{filter:grayscale(.4);cursor:not-allowed}
.cookie-modal-footer{display:flex;gap:10px;flex-wrap:wrap;padding-top:10px;border-top:1px solid #e5e7eb;margin-top:18px}

/* ============ CHATBOT ============ */
.ai-chatbot{position:fixed;bottom:20px;right:20px;z-index:3500;font-family:'Prompt','Kanit','Sarabun',sans-serif;}
.ai-chatbot.left-position{left:20px;right:auto}
.chatbot-toggle{background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;border:none;padding:14px 18px;border-radius:16px;font-weight:600;cursor:pointer;display:flex;align-items:center;gap:8px;box-shadow:0 6px 18px -4px rgba(37,99,235,.55);transition:transform .2s ease,box-shadow .25s ease;font-size:16px}
.chatbot-toggle i{font-size:18px}
.chatbot-toggle:hover{transform:translateY(-3px);box-shadow:0 10px 25px -5px rgba(37,99,235,.65)}
.chatbot-toggle.active{background:linear-gradient(135deg,#1d4ed8,#1e40af)}
.notification-badge{background:#ef4444;color:#fff;font-size:11px;font-weight:700;line-height:1;border-radius:999px;padding:4px 6px;position:absolute;top:-6px;right:-6px;box-shadow:0 0 0 2px #2563eb}

.chatbot-window{position:absolute;bottom:70px;right:0;width:380px;max-height:560px;background:#ffffff;border:1px solid #e5e7eb;border-radius:22px;box-shadow:0 18px 50px -8px rgba(0,0,0,.35);display:none;flex-direction:column;overflow:hidden;font-size:13px}
.ai-chatbot.left-position .chatbot-window{right:auto;left:0}
.chatbot-window.show{display:flex;animation:chatbotPopup .35s cubic-bezier(.4,.0,.2,1)}
@keyframes chatbotPopup{from{opacity:0;transform:translateY(12px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}
.chatbot-header{background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;padding:10px 14px;font-weight:600;display:flex;align-items:center;justify-content:space-between;}
.chatbot-header-info{display:flex;align-items:center;gap:10px}
.chatbot-avatar{width:38px;height:38px;border-radius:12px;background:#1e40af;display:flex;align-items:center;justify-content:center;font-size:20px;box-shadow:0 4px 10px -2px rgba(0,0,0,.35)}
.chatbot-info h4{margin:0;font-size:15px;font-weight:600}
.chatbot-status{display:flex;align-items:center;gap:6px;font-size:11px;color:#dbeafe}
.status-dot{width:10px;height:10px;background:#10b981;border-radius:50%;box-shadow:0 0 0 3px rgba(16,185,129,.25)}
.chatbot-controls button{background:rgba(255,255,255,.15);border:none;color:#fff;width:30px;height:30px;border-radius:8px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:background .2s ease}
.chatbot-controls button:hover{background:rgba(255,255,255,.3)}

.chatbot-messages{padding:14px 16px;flex:1 1 auto;overflow:auto;background:#f3f4f6;display:flex;flex-direction:column;gap:12px;scrollbar-width:thin}
.chatbot-messages::-webkit-scrollbar{width:8px}
.chatbot-messages::-webkit-scrollbar-track{background:transparent}
.chatbot-messages::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:20px}

.message{display:flex;flex-direction:column;gap:4px}
.message-bubble{background:#2563eb;color:#fff;padding:10px 14px;border-radius:16px 16px 16px 4px;line-height:1.5;max-width:82%;box-shadow:0 2px 4px rgba(0,0,0,.08);font-size:13px;}
.message.user .message-bubble{background:#ffffff;color:#1f2937;border:1px solid #e5e7eb;border-radius:16px 16px 4px 16px}
.message-time{font-size:10px;color:#64748b;padding:0 4px}

/* Welcome block */
.welcome-message h3{margin:0 0 4px;font-size:18px;font-weight:700;color:#1f2937}
.welcome-message p{margin:0 0 12px;color:#475569;font-size:13px;line-height:1.5}
.suggestions,.quick-actions{display:flex;flex-wrap:wrap;gap:8px;margin:6px 0 4px}
.suggestion,.quick-action{background:#e2e8f0;color:#1e293b;border:none;padding:6px 12px;font-size:12px;border-radius:999px;cursor:pointer;font-weight:600;transition:background .2s ease,transform .15s ease}
.suggestion:hover,.quick-action:hover{background:#cbd5e1}
.suggestion:active,.quick-action:active{transform:translateY(1px)}

/* Typing indicator */
.typing-indicator{display:flex;align-items:center;}
.typing-dots{display:flex;gap:5px}
.typing-dot{width:8px;height:8px;background:#2563eb;border-radius:50%;animation:typingBlink .9s linear infinite}
.typing-dot:nth-child(2){animation-delay:.15s}.typing-dot:nth-child(3){animation-delay:.3s}
@keyframes typingBlink{0%,80%,100%{opacity:.2}40%{opacity:1}}

.chatbot-input{display:flex;align-items:flex-end;padding:12px 14px;gap:10px;border-top:1px solid #e5e7eb;background:#ffffff}
.attachment-button,.voice-button,.send-button{background:#e2e8f0;border:none;color:#334155;width:40px;height:40px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;font-size:16px;cursor:pointer;transition:background .2s ease,transform .15s ease}
.attachment-button:hover,.voice-button:hover,.send-button:hover{background:#cbd5e1}
.attachment-button:active,.voice-button:active,.send-button:active{transform:translateY(1px)}
.send-button[disabled]{opacity:.5;cursor:not-allowed}
.input-wrapper{flex:1}
.message-input{width:100%;border:1px solid #d1d5db;border-radius:12px;padding:10px 12px;font-size:13px;resize:none;line-height:1.4;max-height:80px;background:#fff}

/* Responsive */
@media (max-width:640px){
  .chatbot-window{width:92vw;bottom:78px}
  .chatbot-toggle{padding:12px 16px;font-size:15px}
  .welcome-message h3{font-size:16px}
}
