/* MIKA — Hudhud Smart Assistant (FAB + panel) */

#hudhud-fab {
  position: fixed;
  bottom: 80px;
  left: 20px;
  z-index: 9999;
  cursor: pointer;
  user-select: none;
}

#hudhud-fab-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E8449, #27AE60);
  border: 3px solid #F9CA24;
  box-shadow: 0 4px 20px rgba(39, 174, 96, 0.35), 0 2px 8px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  animation: hudhudFloat 3s ease-in-out infinite;
  transition: all 0.3s ease;
  overflow: hidden;
}

#hudhud-fab-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#hudhud-fab-label {
  text-align: center;
  margin-top: 4px;
  font-family: 'Cairo', sans-serif;
  font-size: 10px;
  font-weight: 900;
  color: #1A1A1A;
}

#hudhud-notif-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #F9CA24;
  border: 2px solid #FFFFFF;
  animation: notifPulse 2s ease-in-out infinite;
}

#hudhud-fab-ring1,
#hudhud-fab-ring2 {
  display: none;
  position: absolute;
  border-radius: 50%;
  border: 2px solid #27AE60;
  pointer-events: none;
}

#hudhud-fab-ring1 { inset: -8px; animation: fabRing1 1.2s ease-out infinite; }
#hudhud-fab-ring2 { inset: -16px; animation: fabRing2 1.2s ease-out infinite 0.4s; }

#hudhud-fab.is-speaking #hudhud-fab-ring1,
#hudhud-fab.is-speaking #hudhud-fab-ring2 { display: block; }

#hudhud-fab-toast {
  display: none;
  position: absolute;
  bottom: 72px;
  left: 0;
  min-width: 200px;
  max-width: 260px;
  padding: 10px 12px;
  background: #FFFFFF;
  border: 2px solid #F9CA24;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #1A1A1A;
  line-height: 1.5;
  direction: rtl;
  animation: bubblePop 0.3s ease-out;
}

#hudhud-panel {
  display: none;
  position: fixed;
  bottom: 150px;
  left: 16px;
  width: 320px;
  max-height: 75vh;
  background: #FFFFFF;
  border: 2px solid #C8E6C9;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  z-index: 9998;
  flex-direction: column;
  overflow: hidden;
  overflow-y: auto;
  font-family: 'Cairo', sans-serif;
  direction: rtl;
}

.hha-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 2px solid #E8F8EE;
  background: #F0FBF4;
}

.hha-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #E8F8EE;
  border: 2px solid #27AE60;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  animation: hudhudFloat 3s ease-in-out infinite;
}

.hha-header-title {
  color: #1A1A1A;
  font-weight: 900;
  font-size: 14px;
  margin: 0;
}

.hha-header-sub {
  color: #3D5C3D;
  font-size: 11px;
  font-weight: 700;
  margin: 0;
}

.hha-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #C8E6C9;
  color: #1A1A1A;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hha-speak-wrap { padding: 10px 14px 6px; }

#hudhud-speak-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: #FFFDE7;
  border: 2px solid #F9CA24;
  color: #1A1A1A;
  font-family: 'Cairo', sans-serif;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

#hudhud-speak-btn.is-speaking {
  background: #FFEBEE;
  border-color: #C62828;
  color: #B71C1C;
}

#hudhud-speak-rings {
  display: none;
  text-align: center;
  margin-top: 6px;
  font-size: 11px;
  color: #27AE60;
  font-weight: 800;
  animation: speakPulse 0.8s ease-in-out infinite;
}

#hudhud-answer-bubble {
  display: none;
  margin: 6px 14px;
  padding: 10px 14px;
  background: #E8F8EE;
  border: 2px solid #27AE60;
  border-radius: 14px;
  color: #1A2E1A;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.65;
  direction: rtl;
}

.hha-section-label {
  color: #5A7A5A;
  font-size: 11px;
  font-weight: 800;
  margin: 0 0 8px;
  text-align: right;
}

.hha-buttons { padding: 8px 14px 6px; }

.hha-quick-btn {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 2px solid #C8E6C9;
  color: #1A1A1A;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: 12px;
  text-align: right;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
  margin-bottom: 6px;
}

.hha-quick-btn:hover {
  background: #E8F8EE;
  border-color: #27AE60;
}

.hha-input-wrap { padding: 8px 14px 14px; }

.hha-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

#hudhud-free-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 2px solid #C8E6C9;
  color: #1A1A1A;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  direction: rtl;
}

#hudhud-free-input::placeholder { color: #5A7A5A; }

#hudhud-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #27AE60;
  border: none;
  color: #FFFFFF;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.page--summer #hudhud-fab {
  display: block !important;
}

#hudhud-panel::-webkit-scrollbar { width: 4px; }
#hudhud-panel::-webkit-scrollbar-thumb { background: #C8E6C9; border-radius: 2px; }

@keyframes hudhudFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

@keyframes hudhudTalk {
  from { transform: scale(1) rotate(-3deg); }
  to { transform: scale(1.08) rotate(3deg); }
}

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

@keyframes bubblePop {
  0% { transform: scale(0.9); opacity: 0; }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes speakPulse {
  from { opacity: 0.5; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1.05); }
}

@keyframes notifPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

@keyframes fabRing1 {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes fabRing2 {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(2); opacity: 0; }
}

@media (max-width: 380px) {
  #hudhud-panel { width: calc(100vw - 32px); left: 16px; }
}
