/* ═══════════════════════════════════════════════════════════════
   Droplet FABs — Estetica gota de agua para VoiceLytiks + LytikBot
   ═══════════════════════════════════════════════════════════════

   DECISIONES DE DISENO:
   ─────────────────────
   Forma:    border-radius asimetrico → forma organica de gota
   Material: glassmorphism (backdrop-filter: blur + fondo semi-transparente)
   Click:    scale + morph → la gota "crece" como si absorbiese liquido
   Idle:     animacion sutil de flotacion → parece que flota en agua
   Hover:    brillo interior + escala ligera → respuesta tactil
   Grabando: pulsacion roja + onda expansiva → indica actividad

   Compatibilidad: backdrop-filter soportado en Chrome 76+, Safari 9+,
   Firefox 103+. Fallback: fondo solido semi-opaco.
   ═══════════════════════════════════════════════════════════════ */

/* ── Base droplet shape ──────────────────────────────────────── */
.droplet {
    position: relative;
    width: 58px;
    height: 58px;
    /* Gota: esquina sup-izq mas redondeada que las demas */
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    overflow: visible;

    /* Glassmorphism */
    background: rgba(61, 140, 122, 0.25);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    box-shadow:
        0 8px 32px rgba(61, 140, 122, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.2),
        inset 0 -1px 1px rgba(0, 0, 0, 0.1);

    /* Animacion de flotacion idle */
    animation: droplet-float 6s ease-in-out infinite;
    transition:
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-radius 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.3s ease,
        box-shadow 0.3s ease;
}

/* Fallback para navegadores sin backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
    .droplet {
        background: rgba(61, 140, 122, 0.85);
    }
}

/* Brillo interior (reflexion de la gota) */
.droplet::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 10px;
    width: 14px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(
        ellipse at center,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0) 70%
    );
    transition: opacity 0.3s;
    pointer-events: none;
}

/* Onda expansiva al hacer click */
.droplet::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    transform: translate(-50%, -50%) scale(1);
    background: transparent;
    border: 2px solid rgba(61, 140, 122, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: none;
}
.droplet.ripple::after {
    animation: droplet-ripple 0.6s ease-out;
}

/* ── Flotacion ───────────────────────────────────────────────── */
@keyframes droplet-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ── Onda expansiva ──────────────────────────────────────────── */
@keyframes droplet-ripple {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.8);
        opacity: 0;
    }
}

/* ── Hover: crece + brillo ───────────────────────────────────── */
.droplet:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow:
        0 12px 40px rgba(61, 140, 122, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 1px rgba(0, 0, 0, 0.1);
    animation: none;
}
.droplet:hover::before {
    opacity: 1;
}

/* ── Active (click): se aplasta y crece ──────────────────────── */
.droplet:active {
    transform: scale(0.92);
    transition-duration: 0.1s;
}

/* ── Estado abierto: morph a circulo mas grande ──────────────── */
.droplet.open {
    border-radius: 50%;
    transform: scale(0.85);
    background: rgba(100, 116, 139, 0.35);
    animation: none;
}

/* ── Icono SVG dentro de la gota ─────────────────────────────── */
.droplet svg,
.droplet .droplet-icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}
.droplet.open svg,
.droplet.open .droplet-icon {
    transform: rotate(90deg);
}

/* ══════════════════════════════════════════════════════════════
   VoiceLytiks — variante microfono (derecha)
   ══════════════════════════════════════════════════════════════ */
.droplet-vlk {
    /* Gota orientada abajo-derecha */
    border-radius: 70% 30% 30% 70% / 30% 30% 70% 70%;
    background: rgba(61, 140, 122, 0.28);
}
.droplet-vlk::before {
    top: 7px;
    left: auto;
    right: 10px;
}

/* Grabando: cambia a rojo translucido + pulso */
.droplet-vlk.recording {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.3);
    animation: droplet-recording-pulse 1.5s ease-in-out infinite;
    box-shadow:
        0 8px 32px rgba(239, 68, 68, 0.35),
        inset 0 1px 1px rgba(255, 255, 255, 0.15);
}
.droplet-vlk.recording::before {
    background: radial-gradient(
        ellipse at center,
        rgba(255, 200, 200, 0.5) 0%,
        rgba(255, 200, 200, 0) 70%
    );
}
/* Aro exterior pulsante mientras graba */
.droplet-vlk.recording::after {
    animation: droplet-rec-ring 2s ease-out infinite;
    border-color: rgba(239, 68, 68, 0.4);
}

/* Pausado */
.droplet-vlk.paused {
    background: rgba(245, 158, 11, 0.3);
    border-color: rgba(245, 158, 11, 0.3);
    animation: droplet-float 6s ease-in-out infinite;
    box-shadow:
        0 8px 32px rgba(245, 158, 11, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

@keyframes droplet-recording-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 32px rgba(239, 68, 68, 0.35), inset 0 1px 1px rgba(255,255,255,.15);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 10px 40px rgba(239, 68, 68, 0.5), inset 0 1px 1px rgba(255,255,255,.2);
    }
}

@keyframes droplet-rec-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
        border-width: 2px;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.2);
        opacity: 0;
        border-width: 1px;
    }
}

/* ══════════════════════════════════════════════════════════════
   LytikBot — variante chat (izquierda)
   ══════════════════════════════════════════════════════════════ */
.droplet-lbot {
    /* Gota orientada abajo-izquierda (inversa) */
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: rgba(61, 140, 122, 0.22);
}

/* Badge de notificaciones */
.droplet-lbot .lbot-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: rgba(239, 68, 68, 0.9);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: lbot-badge-pop 0.3s ease;
    z-index: 2;
}
.droplet-lbot .lbot-badge:empty,
.droplet-lbot .lbot-badge[data-count="0"] {
    display: none;
}

@keyframes lbot-badge-pop {
    0% { transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ══════════════════════════════════════════════════════════════
   Panel VoiceLytiks — glassmorphism
   ══════════════════════════════════════════════════════════════ */
.vlk-panel-glass {
    background: rgba(26, 26, 26, 0.75);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    color: #fff;
    padding: 14px 16px;
    font-size: 12px;
    width: 280px;
}

/* ══════════════════════════════════════════════════════════════
   Panel LytikBot — glassmorphism
   ══════════════════════════════════════════════════════════════ */
.lbot-panel {
    background: rgba(20, 30, 45, 0.8);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@supports not (backdrop-filter: blur(1px)) {
    .vlk-panel-glass { background: rgba(26, 26, 26, 0.95); }
    .lbot-panel { background: rgba(20, 30, 45, 0.95); }
}

/* ══════════════════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .droplet {
        width: 50px;
        height: 50px;
    }
    .droplet svg,
    .droplet .droplet-icon {
        width: 20px;
        height: 20px;
    }
}
