/* ===== PLANYO INTEGRATION STYLES ===== */

/* Modal Nautique */
#nautique-modal {
    z-index: 10000;
}

#nautique-modal .modal-content {
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
}

.nautique-services {
    padding: 20px 0;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.service-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: var(--primary-color, #1e3c72);
}

.service-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.service-card:hover .service-image img {
    transform: scale(1.05);
}

.service-info {
    padding: 20px;
}

.service-info h4 {
    color: var(--primary-color, #1e3c72);
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.service-info p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.service-btn {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 1rem;
}

.service-btn:hover {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30,60,114,0.3);
}

/* Section réservation Planyo */
.planyo-booking-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-top: 20px;
}

.planyo-booking-section h3 {
    color: var(--primary-color, #1e3c72);
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.planyo-widget-wrapper {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.planyo-widget-wrapper iframe {
    width: 100%;
    min-height: 600px;
    border: none;
}

.planyo-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.planyo-loading i {
    font-size: 2rem;
    color: var(--primary-color, #1e3c72);
    margin-bottom: 15px;
}

.planyo-loading p {
    font-size: 1.1rem;
}

.planyo-error {
    text-align: center;
    padding: 40px 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
}

.planyo-error p {
    margin-bottom: 15px;
}

.planyo-error .btn-primary {
    background: var(--primary-color, #1e3c72);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    margin: 10px 0;
}

.planyo-error small {
    color: #666;
    font-style: italic;
}

/* Modals spécifiques aux services */
[id*="planyo-"][id*="-modal"] {
    z-index: 10001;
}

[id*="planyo-"][id*="-modal"] .modal-content {
    max-width: 1000px;
    max-height: 90vh;
}

.service-details h3 {
    color: var(--primary-color, #1e3c72);
    font-size: 1.3rem;
    margin-bottom: 20px;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

/* Améliorations responsives */
@media (max-width: 768px) {
    .service-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    #nautique-modal .modal-content,
    [id*="planyo-"][id*="-modal"] .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .planyo-booking-section {
        padding: 20px;
        margin: 15px;
    }
    
    .planyo-widget-wrapper iframe {
        min-height: 500px;
    }
}

@media (max-width: 480px) {
    .service-info {
        padding: 15px;
    }
    
    .service-info h4 {
        font-size: 1.1rem;
    }
    
    .service-btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    .planyo-booking-section h3 {
        font-size: 1.3rem;
    }
}

/* Intégration avec le thème existant */
.modal.show {
    display: flex !important;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Notification Toast */
.notification.toast {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Indicateur de service sélectionné */
.service-card.selected {
    border-color: var(--success-color, #28a745);
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
}

.service-card.selected .service-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

/* Amélioration de l'accessibilité */
.service-btn:focus,
.modal-close:focus {
    outline: 2px solid var(--primary-color, #1e3c72);
    outline-offset: 2px;
}

/* Loading states */
.planyo-widget-wrapper.loading {
    position: relative;
    min-height: 400px;
}

.planyo-widget-wrapper.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.planyo-widget-wrapper.loading::after {
    content: '\f110';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: var(--primary-color, #1e3c72);
    animation: fa-spin 1s infinite linear;
    z-index: 11;
}

/* ===== MODAL PLANYO STYLES ===== */
.planyo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.planyo-modal.active {
    display: flex;
}

.planyo-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.planyo-modal .modal-content {
    position: relative;
    background: white;
    border-radius: 15px;
    width: 95vw;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    z-index: 10000;
}

.planyo-modal .modal-header {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.planyo-modal .modal-header h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.planyo-modal .modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.planyo-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.planyo-modal .modal-body {
    padding: 0;
}

.planyo-modal iframe {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: 0;
    /* Optimisations mobile */
    will-change: contents;
    contain: content;
}

@media (max-width: 768px) {
    .planyo-modal .modal-content {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        overflow: hidden;
    }
    
    .planyo-modal .modal-body {
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        position: relative;
    }
    
    .planyo-modal .modal-header {
        padding: 15px 20px;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        flex-shrink: 0;
    }
    
    .planyo-modal .modal-header h3 {
        font-size: 1.4rem;
    }
    
    .planyo-modal iframe {
        height: calc(100vh - 70px);
        min-height: 500px;
        /* Attribut loading géré en HTML, pas CSS */
    }
    
    /* Message de chargement optimisé mobile */
    .planyo-loading {
        min-height: 300px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px 20px;
    }
    
    .planyo-loading i {
        font-size: 3rem;
        color: #3498db;
        margin-bottom: 20px;
    }
    
    .planyo-loading p {
        font-size: 1.1rem;
        color: #666;
        text-align: center;
    }
}

/* ===== MODAL PLANYO DYNAMIQUE ===== */
.planyo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.planyo-modal.active {
    display: flex;
    opacity: 1;
}

.planyo-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.planyo-modal .modal-content {
    position: relative;
    background: white;
    border-radius: 15px;
    width: 95vw;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    z-index: 10001;
}

.planyo-modal .modal-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.planyo-modal .modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.planyo-modal .modal-header h3 i {
    margin-right: 10px;
}

.planyo-modal .modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.planyo-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.planyo-modal .modal-body {
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(90vh - 80px);
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.planyo-modal #planyo-iframe {
    width: 100%;
    height: 600px;
    border: none;
    display: none;
}

.planyo-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.planyo-loading i {
    font-size: 2.5rem;
    color: #1e3c72;
    margin-bottom: 15px;
    display: block;
}

.planyo-loading p {
    font-size: 1.1rem;
    margin: 0;
}

.planyo-error {
    text-align: center;
    padding: 40px 20px;
}

.planyo-error i {
    font-size: 2rem;
    color: #dc3545;
    margin-bottom: 15px;
    display: block;
}

.planyo-error p {
    color: #666;
    margin-bottom: 20px;
}

.planyo-error .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Responsive Planyo Modal */
@media (max-width: 768px) {
    .planyo-modal .modal-content {
        width: 98vw;
        max-height: 95vh;
        border-radius: 10px;
    }
    
    .planyo-modal .modal-header {
        padding: 15px 20px;
    }
    
    .planyo-modal .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .planyo-modal #planyo-iframe {
        height: 500px;
    }
}
