/* Floating Action Buttons & Language Dropdown */

/* ========================================
   Language Dropdown - Clean & Elegant
   ======================================== */

.lang-dropdown {
    position: relative;
    margin-left: 8px;
}

.lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #1a1a1a);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.lang-dropdown-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.6s ease;
}

.lang-dropdown-btn:hover {
    background: rgba(37, 99, 235, 0.12);
    border-color: var(--blue-primary, #2563EB);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.lang-dropdown-btn:hover::before {
    left: 100%;
}

.lang-dropdown.open .lang-dropdown-btn {
    background: rgba(37, 99, 235, 0.18);
    border-color: var(--blue-primary, #2563EB);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15), 0 4px 12px rgba(37, 99, 235, 0.2);
}

.lang-current-flag {
    font-size: 1.1rem;
    line-height: 1;
}

.lang-current-code {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.lang-dropdown-arrow {
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.lang-dropdown.open .lang-dropdown-arrow {
    transform: rotate(180deg);
}

/* Menu déroulant */
.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    padding: 6px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15),
                0 2px 10px rgba(0, 0, 0, 0.08);
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
}

.lang-dropdown.open .lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.lang-dropdown-menu li {
    margin: 0;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text-primary, #333);
    border-radius: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.lang-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.05), transparent);
    transition: left 0.4s ease;
}

.lang-option:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--blue-primary, #2563EB);
    transform: translateX(3px);
}

.lang-option:hover::before {
    left: 100%;
}

.lang-option.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(27, 54, 93, 0.1) 100%);
    color: var(--blue-primary, #2563EB);
    font-weight: 600;
    box-shadow: inset 0 1px 3px rgba(37, 99, 235, 0.1);
}

.lang-flag {
    font-size: 1.25rem;
    line-height: 1;
}

.lang-name {
    flex: 1;
}

.lang-check {
    color: var(--blue-primary, #2563EB);
    flex-shrink: 0;
}

/* Dark theme support */
[data-theme="dark"] .lang-dropdown-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

[data-theme="dark"] .lang-dropdown-btn:hover {
    background: rgba(37, 99, 235, 0.2);
    border-color: var(--blue-light, #3B82F6);
}

[data-theme="dark"] .lang-dropdown-menu {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .lang-option {
    color: #e2e8f0;
}

[data-theme="dark"] .lang-option:hover {
    background: rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .lang-option.active {
    background: rgba(37, 99, 235, 0.25);
}

/* Mobile */
@media (max-width: 992px) {
    .lang-dropdown {
        position: fixed;
        bottom: 156px; /* Adjusted to avoid overlap with floating buttons (56px + 56px + 12px + 20px + 12px buffer) */
        right: 16px;
        z-index: 9997;
        margin: 0;
    }

    .lang-dropdown-btn {
        padding: 10px 14px;
        min-height: 44px; /* Touch-friendly size */
        min-width: 44px; /* Touch-friendly size */
        background: white;
        border: 2px solid var(--blue-primary, #2563EB);
        box-shadow: 0 4px 20px rgba(27, 54, 93, 0.2);
    }

    .lang-dropdown-menu {
        bottom: calc(100% + 8px);
        top: auto;
        right: 0;
        transform-origin: bottom right;
    }

    .lang-dropdown.open .lang-dropdown-menu {
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   Floating Action Buttons (WhatsApp & Reserve)
   ======================================== */

.floating-buttons {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9998;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Animation d'entrée au chargement */
.floating-buttons.animate-in {
    animation: floatIn 0.6s ease-out;
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.fab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.fab-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.fab-btn:active::before {
    width: 300px;
    height: 300px;
}

.fab-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.fab-btn:hover svg {
    transform: scale(1.1) rotate(5deg);
}

/* WhatsApp Button */
.fab-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: 2px solid transparent;
}

.fab-whatsapp:hover {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 10px 35px rgba(37, 211, 102, 0.5), 0 0 0 3px rgba(37, 211, 102, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.fab-whatsapp:active {
    transform: translateY(-2px) scale(1.01);
}

/* Reservation Button */
.fab-reservation {
    background: linear-gradient(135deg, var(--blue-primary, #2563EB) 0%, var(--blue-navy, #1B365D) 100%);
    color: white;
    border: 2px solid transparent;
}

.fab-reservation:hover {
    background: linear-gradient(135deg, var(--blue-light, #3B82F6) 0%, var(--blue-primary, #2563EB) 100%);
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 10px 35px rgba(37, 99, 235, 0.5), 0 0 0 3px rgba(37, 99, 235, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.fab-reservation:active {
    transform: translateY(-2px) scale(1.01);
}

/* Animation pulse subtile pour WhatsApp */
.fab-whatsapp::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50px;
    background: inherit;
    z-index: -1;
    opacity: 0.7;
    animation: pulse-whatsapp 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes pulse-whatsapp {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
        opacity: 0;
    }
}

/* Animation pulse pour Reservation */
.fab-reservation::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50px;
    background: inherit;
    z-index: -1;
    opacity: 0.6;
    animation: pulse-reservation 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    animation-delay: 0.5s;
}

@keyframes pulse-reservation {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.08);
        opacity: 0;
    }
}

/* Mobile: icons only */
@media (max-width: 768px) {
    .floating-buttons {
        bottom: 20px;
        right: 16px;
        gap: 12px;
        z-index: 9996; /* Lower z-index to avoid overlap with language dropdown */
    }

    .fab-label {
        display: none;
    }

    .fab-btn {
        padding: 14px;
        border-radius: 50%;
        width: 56px;
        height: 56px;
        min-height: 56px; /* Touch-friendly size */
        min-width: 56px; /* Touch-friendly size */
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
    }

    .fab-btn:hover {
        transform: translateY(-3px) scale(1.05);
    }

    .fab-btn:active {
        transform: translateY(-1px) scale(1.02);
    }

    /* Réduire les animations pulse sur mobile pour performance */
    .fab-whatsapp::after,
    .fab-reservation::after {
        animation-duration: 4s;
    }
}

/* Hide on contact page */
body.page-contact .floating-buttons {
    display: none;
}

/* ========================================
   Accessibilité & Focus States
   ======================================== */

/* Focus visible pour tous les boutons flottants */
.fab-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3), 0 8px 30px rgba(0, 0, 0, 0.3);
}

.lang-dropdown-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.lang-option:focus-visible {
    outline: none;
    background: rgba(37, 99, 235, 0.15);
    box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.3);
}

/* Préférences utilisateur - réduction mouvement */
@media (prefers-reduced-motion: reduce) {
    .fab-btn,
    .lang-dropdown-btn,
    .lang-option,
    .nav-link[href="devenir-chauffeur.php"] {
        transition: none !important;
    }

    .fab-btn::before,
    .fab-btn::after,
    .lang-dropdown-btn::before,
    .lang-option::before,
    .nav-link[href="devenir-chauffeur.php"]::before {
        animation: none !important;
        transition: none !important;
    }

    .fab-whatsapp::after,
    .fab-reservation::after {
        animation: none !important;
    }

    .fab-btn:hover,
    .lang-dropdown-btn:hover,
    .lang-option:hover {
        transform: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .fab-btn {
        border: 2px solid white;
    }

    .lang-dropdown-btn {
        border: 2px solid var(--blue-primary);
    }

    .lang-option {
        border: 1px solid transparent;
    }

    .lang-option:hover,
    .lang-option.active {
        border-color: var(--blue-primary);
    }
}

/* ========================================
   Navigation Highlight for Recruitment
   ======================================== */

.nav-link[href="devenir-chauffeur.php"] {
    background: linear-gradient(135deg, var(--blue-primary) 0%, var(--blue-royal) 100%);
    color: white !important;
    padding: 8px 16px;
    border-radius: 24px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-link[href="devenir-chauffeur.php"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.6s ease;
}

.nav-link[href="devenir-chauffeur.php"]:hover {
    background: linear-gradient(135deg, var(--blue-light) 0%, var(--blue-primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.nav-link[href="devenir-chauffeur.php"]:hover::before {
    left: 100%;
}

.nav-link[href="devenir-chauffeur.php"]:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
}

/* Focus state pour accessibilité */
.nav-link[href="devenir-chauffeur.php"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}
