/* ============================================
   98 - POPUP AI BASE
   Styles communs à tous les popups
   Dark mode glassmorphisme mega corp
   ============================================ */

/* ============================================
   VARIABLES
   ============================================ */
:root {
    --popup-bg-dark: rgba(15, 23, 42, 0.98);
    --popup-backdrop: rgba(0, 0, 0, 0.85);
    --popup-border: rgba(79, 195, 247, 0.15);
    --popup-glass-bg: rgba(30, 41, 59, 0.7);
    --popup-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.5);

    --accent-blue: #4FC3F7;
    --accent-green: #66BB6A;
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);

    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   POPUP TOGGLE (checkbox caché)
   ============================================ */
.popup-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

/* ============================================
   FLOATING BUTTON (bouton flottant)
   ============================================ */
.floating-contact-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9998;

    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.75rem;

    background: linear-gradient(135deg, var(--accent-blue), #26C6DA);
    color: white;
    border-radius: 50px;

    font-weight: 600;
    font-size: 1rem;
    font-family: var(--font-texte, 'Open Sans', sans-serif);

    box-shadow:
        0 8px 24px rgba(79, 195, 247, 0.4),
        0 0 0 0 rgba(79, 195, 247, 0.4);

    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);

    border: none;
    text-decoration: none;
    user-select: none;
}

.floating-contact-btn:hover {
    transform: translateY(-3px);
    box-shadow:
        0 12px 32px rgba(79, 195, 247, 0.5),
        0 0 0 8px rgba(79, 195, 247, 0.1);
}

.floating-contact-btn:active {
    transform: translateY(-1px);
}

.floating-contact-btn .btn-icon {
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1;
    transition: transform 0.3s ease;
}

.floating-contact-btn:hover .btn-icon {
    transform: rotate(90deg);
}

/* Animation pulse subtile */
@keyframes pulse-subtle {

    0%,
    100% {
        box-shadow:
            0 8px 24px rgba(79, 195, 247, 0.4),
            0 0 0 0 rgba(79, 195, 247, 0.4);
    }

    50% {
        box-shadow:
            0 8px 24px rgba(79, 195, 247, 0.4),
            0 0 0 12px rgba(79, 195, 247, 0);
    }
}

.floating-contact-btn {
    animation: pulse-subtle 3s ease-in-out infinite;
}

/* ============================================
   POPUP OVERLAY (fond + centrage)
   ============================================ */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;

    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;

    background: transparent;
    backdrop-filter: blur(0px);

    opacity: 0;
    pointer-events: none;

    transition: all 0.3s var(--transition-smooth);
}

/* État ouvert - CHAQUE POPUP SÉPARÉMENT */
#contact-popup-toggle:checked~.popup-overlay:not(.popup-carriere):not(.popup-legal):not(.popup-animation):not(.popup-direction) {
    opacity: 1;
    pointer-events: all;
    background: var(--popup-backdrop);
    backdrop-filter: blur(10px);
}

#carriere-popup-toggle:checked~.popup-overlay.popup-carriere {
    opacity: 1;
    pointer-events: all;
    background: var(--popup-backdrop);
    backdrop-filter: blur(10px);
}

#legal-popup-toggle:checked~.popup-overlay.popup-legal {
    opacity: 1;
    pointer-events: all;
    background: var(--popup-backdrop);
    backdrop-filter: blur(10px);
}

#animation-popup-toggle:checked~.popup-overlay.popup-animation {
    opacity: 1;
    pointer-events: all;
    background: var(--popup-backdrop);
    backdrop-filter: blur(10px);
}

#direction-popup-toggle:checked~.popup-overlay.popup-direction {
    opacity: 1;
    pointer-events: all;
    background: var(--popup-backdrop);
    backdrop-filter: blur(10px);
}

/* ============================================
   POPUP CONTAINER (boîte principale)
   ============================================ */
.popup-container {
    position: relative;

    max-width: 550px;
    width: 100%;
    max-height: 90vh;

    background: var(--popup-bg-dark);
    backdrop-filter: blur(30px) saturate(180%);

    border: 1px solid var(--popup-border);
    border-radius: 20px;

    box-shadow: var(--popup-shadow);

    display: flex;
    flex-direction: column;

    transform: scale(0.9) translateY(20px);
    opacity: 0;

    transition: all 0.4s var(--transition-smooth);

    overflow: hidden;
}

/* Container ouvert - CHAQUE POPUP SÉPARÉMENT */
#contact-popup-toggle:checked~.popup-overlay:not(.popup-carriere):not(.popup-legal):not(.popup-animation):not(.popup-direction) .popup-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

#carriere-popup-toggle:checked~.popup-overlay.popup-carriere .popup-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

#legal-popup-toggle:checked~.popup-overlay.popup-legal .popup-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

#animation-popup-toggle:checked~.popup-overlay.popup-animation .popup-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

#direction-popup-toggle:checked~.popup-overlay.popup-direction .popup-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ============================================
   POPUP CLOSE BUTTON (X)
   ============================================ */
.popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 100;

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;

    color: var(--text-secondary);
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1;

    cursor: pointer;
    transition: all 0.2s ease;

    text-decoration: none;
}

.popup-close:hover {
    background: rgba(244, 67, 54, 0.15);
    border-color: rgba(244, 67, 54, 0.3);
    color: #F44336;
    transform: rotate(90deg);
}

.popup-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* ============================================
   SCROLLBAR CUSTOM
   ============================================ */
.popup-container *::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.popup-container *::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.popup-container *::-webkit-scrollbar-thumb {
    background: rgba(79, 195, 247, 0.3);
    border-radius: 10px;
}

.popup-container *::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 195, 247, 0.5);
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .floating-contact-btn {
        bottom: 1rem;
        right: 1rem;
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }

    .floating-contact-btn .btn-text {
        display: none;
    }

    .floating-contact-btn .btn-icon {
        font-size: 1.75rem;
        margin: 0;
    }

    .popup-overlay {
        padding: 0.5rem;
    }

    .popup-container {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 16px;
    }

    .popup-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 32px;
        height: 32px;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .floating-contact-btn {
        bottom: 0.75rem;
        right: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .popup-container {
        border-radius: 12px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.floating-contact-btn:focus-visible,
.popup-close:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Réduire animations si préférence utilisateur */
@media (prefers-reduced-motion: reduce) {

    .floating-contact-btn,
    .popup-overlay,
    .popup-container,
    .popup-close {
        transition: none;
        animation: none;
    }
}

/* ============================================
   PRINT (cacher popups à l'impression)
   ============================================ */
@media print {

    .floating-contact-btn,
    .popup-overlay {
        display: none !important;
    }
}