/* ============================================
   SergioLino AI Voice Assistant Widget
   ============================================ */

/* ---------- Floating Action Button ---------- */
.sergiolino-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99998;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px 20px 12px 14px;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(198, 155, 93, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  animation: sergiolino-fab-pulse 3s infinite;
}

.sergiolino-fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 4px rgba(198, 155, 93, 0.2);
}

@keyframes sergiolino-fab-pulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(198, 155, 93, 0.4); }
  50% { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), 0 0 0 8px rgba(198, 155, 93, 0); }
}

.sergiolino-fab-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #c69b5d, #d4a95e);
  border-radius: 50%;
  flex-shrink: 0;
}

.sergiolino-fab-icon svg {
  width: 20px;
  height: 20px;
  color: #1a1a2e;
}

.sergiolino-fab-ai-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #4ade80;
  color: #0a2e1a;
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.sergiolino-fab-label {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* Hide label on small screens */
@media (max-width: 480px) {
  .sergiolino-fab {
    padding: 14px;
    border-radius: 50%;
  }
  .sergiolino-fab-label {
    display: none;
  }
}

/* ---------- Panel ---------- */
.sergiolino-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 99999;
  width: 370px;
  max-height: 540px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: sergiolino-slide-up 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes sergiolino-slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
  .sergiolino-panel {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 80px;
    max-height: calc(100vh - 120px);
  }
}

.sergiolino-hidden {
  display: none !important;
}

/* ---------- Panel Header ---------- */
.sergiolino-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
}

.sergiolino-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sergiolino-panel-logo {
  font-size: 28px;
  line-height: 1;
}

.sergiolino-panel-title strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #c69b5d;
}

.sergiolino-panel-subtitle {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
}

.sergiolino-panel-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #94a3b8;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.sergiolino-panel-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* ---------- Panel Body ---------- */
.sergiolino-panel-body {
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Idle State (Mic Button) ---------- */
.sergiolino-mic-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 10px 0 24px;
}

.sergiolino-mic-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #c69b5d 0%, #d4a95e 100%);
  color: #1a1a2e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(198, 155, 93, 0.4);
}

.sergiolino-mic-btn svg {
  width: 34px;
  height: 34px;
}

.sergiolino-mic-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(198, 155, 93, 0.5);
}

.sergiolino-mic-btn:active {
  transform: scale(0.96);
}

.sergiolino-mic-label {
  text-align: center;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.sergiolino-mic-label small {
  color: #94a3b8;
  font-size: 12px;
}

/* ---------- Features row ---------- */
.sergiolino-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.sergiolino-features span {
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: #475569;
  white-space: nowrap;
}

/* ---------- Active Call State ---------- */
.sergiolino-call-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.sergiolino-avatar {
  position: relative;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sergiolino-avatar-inner {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  z-index: 2;
  position: relative;
}

.sergiolino-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid #c69b5d;
  animation: sergiolino-pulse-anim 1.5s ease-out infinite;
  opacity: 0;
}

.sergiolino-pulse-ring.speaking {
  animation: sergiolino-pulse-anim 0.8s ease-out infinite;
  border-color: #4ade80;
}

@keyframes sergiolino-pulse-anim {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.sergiolino-call-status {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  margin: 0;
}

.sergiolino-call-timer {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

/* ---------- Transcript ---------- */
.sergiolino-transcript {
  width: 100%;
  max-height: 160px;
  overflow-y: auto;
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.sergiolino-transcript::-webkit-scrollbar {
  width: 4px;
}

.sergiolino-transcript::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.sergiolino-transcript-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.sergiolino-msg {
  padding: 8px 12px;
  border-radius: 12px;
  max-width: 88%;
  word-wrap: break-word;
}

.sergiolino-msg.assistant {
  background: #e2e8f0;
  color: #1e293b;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.sergiolino-msg.user {
  background: linear-gradient(135deg, #c69b5d, #d4a95e);
  color: #1a1a2e;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* ---------- End Call Button ---------- */
.sergiolino-end-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.sergiolino-end-btn:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.sergiolino-end-btn svg {
  color: #fff;
}

/* ---------- Connecting dots ---------- */
.sergiolino-connecting-dots::after {
  content: '';
  animation: sergiolino-dots 1.5s infinite;
}

@keyframes sergiolino-dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}
