/* ========================================
   BOUTON FLOTTANT DE RENDEZ-VOUS
   ======================================== */

/* Bouton principal */
.appointment-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 110px; /* Décalé pour le bouton gototop */
    z-index: 1001;
    cursor: pointer;
    background: linear-gradient(135deg, #d9cbc4 0%, #d9cbc4 100%);
    color: #2E4053;
    padding: 16px 28px;
    border-radius: 50px;
    box-shadow: 0 8px 24px rgba(217, 203, 196, 0.5), 
                0 4px 8px rgba(0, 0, 0, 0.15);
    font-family: 'Trebuchet MS', Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    animation: slideIn 0.8s ease-out, breathe 4s ease-in-out infinite;
}

.appointment-floating-btn:hover,
.appointment-floating-btn:focus {
    transform: translateY(-3px) scale(1.08) !important;
    background: linear-gradient(135deg, #d9cbc4 0%, #d9cbc4 100%);
    color: #1a2530;
    box-shadow: 0 12px 32px rgba(217, 203, 196, 0.7), 
                0 8px 16px rgba(0, 0, 0, 0.2),
                0 0 30px rgba(217, 203, 196, 0.4);
    text-decoration: none;
    animation-play-state: paused;
}

.appointment-floating-btn:active {
    transform: translateY(-1px) scale(1.05) !important;
}

.appointment-floating-btn i {
    font-size: 20px;
}

/* Texte complet visible par défaut */
.btn-text-full {
    display: inline;
}

/* Texte court caché par défaut */
.btn-text-mobile {
    display: none;
}

/* Animation de respiration douce (zoom in/out très subtil) */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.04);
    }
}

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

/* ========================================
   MODAL CAL.COM
   ======================================== */

/* Tailles et positionnement selon écrans */
#calModal .modal-dialog {
    max-width: 900px;
    max-height: calc(100vh - 60px);
    margin: 0;
    position: fixed;
    right: 110px;
    bottom: 30px;
    transform-origin: bottom right;
    z-index: 100000;
}

#calModal.fade .modal-dialog {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

#calModal.fade:not(.in) .modal-dialog {
    transform: scale(0.1);
    opacity: 0;
}

#calModal.fade.in .modal-dialog {
    transform: scale(1);
    opacity: 1;
}

@media (min-width: 1400px) {
    #calModal .modal-dialog {
        max-width: 1100px;
    }
}

@media (min-width: 769px) and (max-width: 991px) {
    #calModal .modal-dialog {
        max-width: 700px;
        right: 100px;
    }
}

@media (min-width: 992px) and (max-width: 1399px) {
    #calModal .modal-dialog {
        max-width: 800px;
    }
}

/* Z-index pour passer au-dessus du menu mobile */
#calModal {
    z-index: 99999 !important;
}

#calModal .modal-backdrop {
    z-index: 99998 !important;
}

/* Contenu de la modal */
#calModal .modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 100000;
}

/* Header de la modal */
.cal-modal-header {
    background: linear-gradient(135deg, #d9cbc4 0%, #d9cbc4 100%);
    color: #2E4053;
    border-bottom: 3px solid #2E4053;
    padding: 24px 35px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(217, 203, 196, 0.3);
}

.cal-modal-header h4 {
    font-size: 26px;
    font-weight: 400;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: 'Trebuchet MS', Arial, sans-serif;
    color: #2E4053;
    text-shadow: none;
    letter-spacing: 1px;
}

.cal-modal-header i {
    font-size: 24px;
    color: #2E4053;
    opacity: 0.85;
}

.cal-modal-close {
    color: #2E4053;
    opacity: 0.8;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    transition: all 0.3s ease;
    background: rgba(46, 64, 83, 0.08);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: none;
}

.cal-modal-close:hover {
    background: rgba(46, 64, 83, 0.2);
    transform: rotate(90deg) scale(1.1);
    color: #1a2530;
}

.cal-modal-close span {
    display: block;
    line-height: 1;
}

/* Body de la modal */
.cal-modal-body {
    padding: 25px 25px 40px 25px;
    background: #ffffff;
    position: relative;
    min-height: 600px;
    max-height: none;
    overflow-y: auto;
    flex: 1;
}

@media (min-width: 1400px) {
    .cal-modal-body {
        min-height: 700px;
    }
}

/* Loader */
.cal-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.cal-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #d9cbc4;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cal-loader p {
    color: #2E4053;
    font-size: 16px;
    font-weight: 500;
}

/* Conteneur Cal.com */
.cal-inline {
    width: 100%;
    min-height: 550px;
    padding-bottom: 20px;
}

@media (min-width: 1400px) {
    .cal-inline {
        min-height: 650px;
    }
}

/* Forcer la visibilité de Cal.com */
.cal-inline,
.cal-inline > *,
.cal-inline iframe {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Masquer les éléments non pertinents de Cal.com */
/* Ciblage agressif pour masquer timezone et format d'heure */
.cal-inline iframe [data-testid*="timezone"],
.cal-inline iframe [data-testid*="time-format"],
.cal-inline [data-testid*="timezone"],
.cal-inline [data-testid*="time-format"],
.cal-inline [class*="timezone"],
.cal-inline [class*="TimeZone"],
.cal-inline [class*="timeformat"],
.cal-inline [class*="TimeFormat"],
.cal-inline [class*="time-format"],
.cal-inline select,
.cal-inline button[role="switch"],
.cal-inline div:has(> select),
.cal-inline div:has(> button[role="switch"]) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Masquer via injection CSS dans l'iframe si possible */
cal-inline::after {
    content: "";
    display: block;
}

/* Styles additionnels pour forcer le masquage */
.cal-inline * [class*="tz"],
.cal-inline * [class*="Tz"] {
    display: none !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .appointment-floating-btn {
        bottom: 100px;
        right: 20px;
        padding: 12px 18px;
        font-size: 14px;
        gap: 8px;
    }
    
    /* Cacher le texte complet */
    .btn-text-full {
        display: none;
    }
    
    /* Afficher le texte court */
    .btn-text-mobile {
        display: inline;
        font-weight: 700;
    }
    
    .appointment-floating-btn i {
        font-size: 18px;
    }
    
    #calModal .modal-dialog {
        max-width: 95%;
        max-height: calc(100vh - 120px);
        right: 20px;
        bottom: 100px;
        transform-origin: bottom right;
    }
    
    .cal-modal-header {
        padding: 18px 20px;
    }
    
    .cal-modal-header h4 {
        font-size: 20px;
        font-weight: 400;
        gap: 12px;
    }
    
    .cal-modal-header i {
        font-size: 20px;
    }
    
    .cal-modal-close {
        width: 38px;
        height: 38px;
        font-size: 26px;
        font-weight: 300;
    }
    
    .cal-modal-body {
        min-height: 400px;
        padding: 15px 15px 30px 15px;
    }
    
    .cal-inline {
        min-height: 400px;
    }
}

@media (max-width: 480px) {
    .appointment-floating-btn {
        bottom: 90px;
        right: 15px;
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .appointment-floating-btn i {
        font-size: 16px;
    }
    
    #calModal .modal-dialog {
        max-width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
        right: 10px;
        bottom: 10px;
        left: 10px;
        margin: 0;
    }
    
    .cal-modal-header {
        padding: 15px 15px;
    }
    
    .cal-modal-header h4 {
        font-size: 18px;
        font-weight: 400;
        gap: 10px;
    }
    
    .cal-modal-header i {
        font-size: 18px;
    }
    
    .cal-modal-close {
        width: 35px;
        height: 35px;
        font-size: 24px;
        font-weight: 300;
    }
    
    .cal-modal-body {
        padding: 10px 10px 30px 10px;
        min-height: 300px;
    }
    
    .cal-inline {
        min-height: 300px;
    }
}

/* Z-index du bouton gototop */
.gototop {
    z-index: 1000 !important;
}

/* Z-index du backdrop Bootstrap pour la modal Cal.com uniquement */
#calModal .modal-backdrop,
#calModal + .modal-backdrop {
    z-index: 99998 !important;
}

/* S'assurer que les modals des compétences fonctionnent correctement */
.portfolio-modal {
    z-index: 1050 !important;
}

.portfolio-modal .modal-backdrop {
    z-index: 1040 !important;
}

/* Forcer le header de la modal au-dessus de tout sur mobile */
.cal-modal-header {
    position: relative;
    z-index: 100001 !important;
}

.cal-modal-close {
    position: relative;
    z-index: 100002 !important;
}

