/**
 * Bottle Button Styles V2 - Interface Progressive Minimaliste
 * 
 * Design élégant avec bouton flottant et pilule progressive
 * 
 * @author EMOCARD
 * @version 2.0.0
 */

/* ==========================================
   Variables CSS
   ========================================== */
:root {
    --bottle-copper: #aa7b4c;
    --bottle-gold: #ffe7a0;
    --bottle-dark: #1a1a1a;
    --bottle-dark-alt: #2d2d2d;
    --bottle-white: #ffffff;
    --bottle-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --bottle-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   🔥 FORCE TEXTE BLANC - Override mode sombre
   ========================================== */
.bottle-pill-container *,
.bottle-pill-container *::before,
.bottle-pill-container *::after,
.bottle-pill *,
.bottle-floating-btn *,
.bottle-floating-btn *::before,
.bottle-floating-btn *::after {
    color: #ffffff !important;
}

/* Exception pour les placeholders */
.bottle-pill-container input::placeholder,
.bottle-pill-container textarea::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Exception pour les titres qui doivent être cuivre */
.bottle-pill h2,
.bottle-pill h3,
.bottle-step-title {
    color: var(--bottle-copper) !important;
}

/* ==========================================
   💌 WRAPPER BOTTOM-NAV : Pill-nav + Bouton côte à côté
   ========================================== */
.bottom-nav-wrapper {
    /* Position fixe en bas centré */
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    
    /* Flexbox : les enfants sont côte à côte */
    display: flex;
    align-items: center;
    gap: 12px; /* Espacement entre pill-nav et bouton 💌 */
    
    /* Transition smooth pour animations */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   💌 CONTAINER BOUTON : Suit le flux flex
   ========================================== */
#bottle-feedback-container {
    /* Position relative pour suivre le flux flex */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 🎯 HAUTEUR FIXE : cohérente avec pill-nav (logo 40px + padding 16px = 56px) */
    min-height: 56px;
    min-width: 56px;
    flex-shrink: 0;
}

/* ==========================================
   Bouton Flottant - À CÔTÉ de pill-nav (poussé dynamiquement)
   ========================================== */
.bottle-floating-btn {
    /* 🎯 POSITIONNEMENT : dans le flux flex, pas absolu */
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* 🎯 TAILLE : alignée sur hauteur pill-nav (56px) */
    width: 56px;
    height: 56px;
    /* 🎨 STYLE PREMIUM : transparent et cohérent */
    background: rgba(170, 123, 76, 0.15);
    border: 1px solid rgba(170, 123, 76, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-button, 28px); /* 🎯 Harmonisé avec système design */
    box-shadow: 
        0 4px 16px rgba(170, 123, 76, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    cursor: pointer;
    z-index: 1;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    /* 🎯 MARGES : retiré margin-left car géré par gap du wrapper */
    flex-shrink: 0;
}

/* État visible : toujours dans pill-nav */
.bottle-floating-btn.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    /* � ANIMATION PULSE ÉLÉGANTE : attire l'œil sans être intrusive */
    animation: bottlePulse 3s ease-in-out infinite;
}

/* 🎨 ANIMATION PULSE SUBTILE ET PREMIUM */
@keyframes bottlePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 4px 16px rgba(170, 123, 76, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 
            0 6px 24px rgba(170, 123, 76, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}

.bottle-floating-btn:hover {
    transform: scale(1.15);
    background: rgba(170, 123, 76, 0.25);
    border-color: rgba(170, 123, 76, 0.5);
    box-shadow: 
        0 8px 28px rgba(170, 123, 76, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: none; /* Pause pulse au hover */
}

.bottle-floating-btn:active {
    transform: scale(1.0);
}

.bottle-btn-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* 🎯 HARMONISATION : Cohérence avec parent et système design */
    border-radius: inherit; /* Hérite du border-radius du parent */
}

/* Texte highlight intro - élégant avec bordure dorée */
.bottle-intro-highlight {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    background: linear-gradient(135deg, rgba(170, 123, 76, 0.08), rgba(255, 231, 160, 0.05));
    padding: 16px 20px;
    border-radius: 16px;
    border: 1.5px solid var(--bottle-gold);
    margin: 15px 0;
    box-shadow: 
        0 4px 20px rgba(170, 123, 76, 0.2),
        0 1px 3px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 231, 160, 0.1);
    position: relative;
    overflow: hidden;
}

.bottle-intro-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--bottle-gold), transparent);
    opacity: 0.6;
}

/* Icon SVG */
.bottle-icon-svg {
    color: var(--bottle-white);
    animation: floatSvg 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(170, 123, 76, 0.3));
}

.bottle-icon-png {
    animation: floatSvg 3s ease-in-out infinite;
}

@keyframes floatSvg {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Badge notification */
.bottle-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ff4757;
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bottle-white);
    animation: pulseNotification 2s ease-in-out infinite;
}

/* Animation badge avec shake */
@keyframes pulseNotification {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(255, 71, 87, 0);
    }
}

/* Shake au hover si notification */
.bottle-floating-btn.fixed:has(.bottle-badge[style*="display: flex"]):hover {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0) scale(1.15); }
    25% { transform: translateX(-5px) rotate(-5deg) scale(1.15); }
    75% { transform: translateX(5px) rotate(5deg) scale(1.15); }
}

/* ==========================================
   Container Pilule
   ========================================== */
.bottle-pill-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    transition: opacity var(--bottle-transition);
    padding: 1rem;
}

.bottle-pill-container.visible {
    opacity: 1;
}

/* ==========================================
   Pilule Progressive
   ========================================== */
.bottle-pill {
    background: linear-gradient(135deg, var(--bottle-dark) 0%, var(--bottle-dark-alt) 100%);
    border: 2px solid var(--bottle-copper);
    border-radius: 24px;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideInPill 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInPill {
    from {
        transform: translateY(40px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.bottle-pill-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottle-pill-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--bottle-white);
    transform: rotate(90deg);
}

/* ==========================================
   Étapes
   ========================================== */
.bottle-step {
    animation: fadeInStep 0.4s ease;
}

.bottle-step.fade-out {
    animation: fadeOutStep 0.3s ease forwards;
}

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

@keyframes fadeOutStep {
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

/* Icône étape */
.bottle-step-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(170, 123, 76, 0.15);
    border-radius: 50%;
}

.bottle-step-icon .bottle-icon-svg {
    width: 36px;
    height: 36px;
    color: var(--bottle-copper);
}

/* Titres et textes */
.bottle-step h3 {
    color: var(--bottle-copper);
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.bottle-step p {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Labels */
.bottle-label {
    display: block;
    color: var(--bottle-white);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.bottle-optional {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    font-size: 0.85rem;
}

/* Inputs */
.bottle-input {
    width: 100%;
    padding: 0.875rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(170, 123, 76, 0.3);
    border-radius: 12px;
    color: var(--bottle-white);
    font-size: 0.95rem;
    font-family: inherit;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    resize: none;
}

.bottle-input:focus {
    outline: none;
    border-color: var(--bottle-copper);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(170, 123, 76, 0.1);
}

.bottle-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Hints */
.bottle-hint {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

/* Boutons */
.bottle-btn-primary,
.bottle-btn-secondary {
    width: 100%;
    padding: 0.875rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.bottle-btn-primary {
    background: linear-gradient(135deg, var(--bottle-copper) 0%, #8b6238 100%);
    color: var(--bottle-white);
    box-shadow: 0 4px 12px rgba(170, 123, 76, 0.3);
}

.bottle-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(170, 123, 76, 0.4);
}

.bottle-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.bottle-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bottle-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bottle-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--bottle-white);
}

/* Actions multiples */
.bottle-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.bottle-actions .bottle-btn-primary,
.bottle-actions .bottle-btn-secondary {
    flex: 1;
    margin-top: 0;
}

/* ==========================================
   Étape Succès
   ========================================== */
.bottle-step-success {
    text-align: center;
}

.bottle-success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================
   🌊 État d'attente (message déjà envoyé)
   ========================================== */
.bottle-step-waiting {
    text-align: center;
    padding: 2rem 1.5rem;
}

.bottle-waiting-message {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

/* Animation points ... */
.bottle-dots {
    display: inline-block;
    animation: dotsPulse 1.5s ease-in-out infinite;
}

@keyframes dotsPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Animation vagues océan */
.bottle-waiting-animation {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 8px;
    height: 60px;
    margin: 2rem 0;
}

.bottle-wave {
    width: 8px;
    height: 20px;
    background: linear-gradient(180deg, var(--bottle-copper) 0%, var(--bottle-gold) 100%);
    border-radius: 4px;
    animation: wave 1.2s ease-in-out infinite;
}

.bottle-wave:nth-child(2) {
    animation-delay: 0.2s;
    height: 30px;
}

.bottle-wave:nth-child(3) {
    animation-delay: 0.4s;
    height: 25px;
}

@keyframes wave {
    0%, 100% {
        transform: scaleY(1);
        opacity: 0.7;
    }
    50% {
        transform: scaleY(1.5);
        opacity: 1;
    }
}

.bottle-waiting-tip {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    padding: 1rem;
    background: rgba(170, 123, 76, 0.1);
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid rgba(170, 123, 76, 0.2);
}

/* ==========================================
   Bouton Navbar (après premier message)
   ========================================== */
.bottle-nav-btn {
    position: relative;
    background: rgba(170, 123, 76, 0.15);
    border: 1px solid rgba(170, 123, 76, 0.3);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 1rem;
}

.bottle-nav-btn:hover {
    background: rgba(170, 123, 76, 0.25);
    transform: scale(1.05);
}

.bottle-nav-btn .bottle-icon-svg {
    width: 22px;
    height: 22px;
    color: var(--bottle-copper);
}

.bottle-nav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4757;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bottle-dark);
}

/* ==========================================
   Responsive Mobile
   ========================================== */
@media (max-width: 768px) {
    /* 🎯 WRAPPER : Ajuster pour mobile - MÊME BOTTOM QUE PILL-NAV */
    .bottom-nav-wrapper {
        bottom: 15px; /* Même valeur que pill-nav en mobile */
        gap: 12px; /* ✅ Augmenté pour cohérence */
    }
    
    /* 🎯 CONTAINER : Cohérent avec pill-nav mobile (logo 36px + padding 16px = 52px) */
    #bottle-feedback-container {
        min-height: 52px; /* ✅ Recalculé : 36px logo + 8px×2 padding = 52px */
        min-width: 52px;
    }
    
    .bottle-floating-btn {
        width: 52px;  /* ✅ Aligné avec nouvelle hauteur pill-nav mobile */
        height: 52px;
        border-radius: var(--radius-button-mobile, 30px); /* 🎯 Harmonisé mobile */
    }
    
    .bottle-pill {
        padding: 1.5rem;
        border-radius: 20px;
        max-width: 95%;
    }
    
    .bottle-step h3 {
        font-size: 1.3rem;
    }
    
    .bottle-input {
        font-size: 16px; /* Éviter zoom iOS */
    }
}

@media (max-width: 480px) {
    .bottle-pill-container {
        padding: 0.5rem;
    }
    
    .bottle-pill {
        padding: 1.25rem;
    }
    
    .bottle-step-icon {
        width: 56px;
        height: 56px;
    }
    
    /* 🎯 HARMONISATION : Bouton bottle mobile étroit */
    .bottle-floating-btn {
        border-radius: var(--radius-button-small, 26px);
    }
}

/* ==========================================
   Accessibilité
   ========================================== */
.bottle-pill *:focus-visible {
    outline: 2px solid var(--bottle-copper);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .bottle-floating-btn,
    .bottle-pill,
    .bottle-step,
    .bottle-icon-svg {
        animation: none !important;
        transition: none !important;
    }
}

@media (prefers-contrast: high) {
    .bottle-pill {
        border-width: 3px;
    }
    
    .bottle-input {
        border-width: 2px;
    }
}
