/* Floating Chat Bubble and Chat Panel Styles */
:root {
  --chat-primary: #10b981; /* emerald */
  --chat-primary-dark: #0ea371;
  --chat-shadow: 0 12px 30px rgba(0,0,0,.18);
}

.pkya-chat-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
  z-index: 99999;
  display: none !important;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(255,255,255,0.2);
}

.pkya-chat-bubble:hover { transform: translateY(-2px); background: var(--chat-primary-dark); box-shadow: 0 16px 36px rgba(0,0,0,.22); }
.pkya-chat-bubble:active { transform: translateY(0); }
.pkya-chat-bubble .pkya-badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 6px;
  background: #ef4444; color:#fff; border-radius: 9999px; font-size: 12px; font-weight: 700; display:flex; align-items:center; justify-content:center;
  box-shadow: 0 6px 14px rgba(239,68,68,.35);
}

@keyframes pkya-pop-in { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pkya-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* Chat Panel */
.pkya-chat-panel {
  position: fixed;
  bottom: 88px;
  right: 20px;
  width: 380px;
  height: 520px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  z-index: 99998;
  display: none !important;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.1);
}

.pkya-chat-panel.pkya-open { display: flex; flex-direction: column; }

@keyframes pkya-panel-in { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.pkya-chat-header {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pkya-chat-header .pkya-title { font-size: 14px; font-weight: 800; letter-spacing: .3px; }
.pkya-chat-header .pkya-actions { display:flex; gap:6px; }
.pkya-icon-btn { background: rgba(255,255,255,.18); border: none; color: #fff; width: 28px; height: 28px; display:flex; align-items:center; justify-content:center; border-radius: 8px; cursor:pointer; }
.pkya-icon-btn:hover { background: rgba(255,255,255,.28); }

.pkya-chat-body { flex: 1; background: #f8fafc; }
.pkya-chat-iframe { width: 100%; height: 100%; border: 0; background: #fff; }

/* Simple placeholder body (if no iframe) */
.pkya-chat-empty { height: 100%; display:flex; align-items:center; justify-content:center; color:#475569; font-size:14px; padding: 16px; text-align:center; }

/* Small screens: push up panel height */
@media (max-width: 420px) {
  .pkya-chat-panel { bottom: 100px; height: 76vh; right: 16px; }
  .pkya-chat-bubble { right: 16px; bottom: 84px; width: 56px; height: 56px; }
}

/* Ajuste adicional para móviles pequeños y medianos */
@media (max-width: 480px) {
  .pkya-chat-bubble { right: 16px; bottom: 84px; width: 56px; height: 56px; }
  .pkya-chat-panel { right: 16px; bottom: 100px; }
}

/* Ocultar chat bubble cuando el reproductor de radio esté expandido */
.radio-bubble.expanded ~ .pkya-chat-bubble,
body:has(.radio-bubble.expanded) .pkya-chat-bubble {
  display: none !important;
}

.radio-bubble.expanded ~ .pkya-chat-panel,
body:has(.radio-bubble.expanded) .pkya-chat-panel {
  display: none !important;
}
