/* Améliorations visuelles pour Quote Modal Form */

/* Spinner de chargement */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Bouton en état de chargement */
.submit-btn.loading {
    opacity: 0.8;
    cursor: not-allowed;
    position: relative;
}

.submit-btn.loading:hover {
    transform: none;
}

/* Message de succès */
.success-message {
    text-align: center;
    padding: 60px 20px;
    animation: fadeIn 0.5s ease-out;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    background-color: #4CAF50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

.success-message h3 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.success-message p {
    font-size: 18px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.success-message .reference {
    font-size: 16px;
    color: #95a5a6;
    font-style: italic;
}

/* Indicateur de sauvegarde automatique */
.auto-save-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #2ecc71;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease-out;
    z-index: 10000;
}

.auto-save-indicator.show {
    transform: translateY(0);
    opacity: 1;
}

.auto-save-indicator::before {
    content: '✓';
    margin-right: 8px;
    font-weight: bold;
}

/* Modal d'erreur améliorée */
.error-modal {
    background-color: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.error-modal h4 {
    color: #c53030;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.error-modal ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-modal li {
    color: #742a2a;
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.error-modal li::before {
    content: '•';
    color: #e53e3e;
    font-weight: bold;
    position: absolute;
    left: 8px;
}

/* Amélioration des transitions */
.modal {
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.modal.active {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Validation des champs en temps réel */
input:invalid,
select:invalid,
textarea:invalid {
    border-color: #e53e3e;
}

input:valid:not(:placeholder-shown),
select:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
    border-color: #48bb78;
}

/* Style pour les champs avec erreur */
.field-error {
    border-color: #e53e3e !important;
    background-color: #fff5f5;
    animation: fieldErrorShake 0.3s ease-out;
}

@keyframes fieldErrorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.field-error-message {
    color: #e53e3e;
    font-size: 14px;
    margin-top: 5px;
    display: block;
    animation: errorFadeIn 0.3s ease-out;
    font-weight: 500;
}

@keyframes errorFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Style spécifique pour les groupes de radio buttons */
.radio-group-modern + .field-error-message {
    margin-top: 10px;
}

/* Style pour les messages d'erreur dans les dropdowns */
.session-dropdown-toggle.field-error {
    border-color: #e53e3e !important;
    background-color: #fff5f5;
}

.session-dropdown-container .field-error-message {
    margin-top: 8px;
}

/* Style pour les erreurs globales (comme "aucune formation sélectionnée") */
.selected-formations-wrapper + .field-error-message,
#selectedFormationsContainer + .field-error-message {
    background-color: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.selected-formations-wrapper + .field-error-message::before,
#selectedFormationsContainer + .field-error-message::before {
    content: '⚠';
    font-size: 18px;
    color: #e53e3e;
}

/* Messages d'erreur pour les participants */
.participant-fields .field-error-message {
    font-size: 13px;
    margin-top: 3px;
}

/* Transition smooth quand l'erreur est supprimée */
input:not(.field-error),
select:not(.field-error),
textarea:not(.field-error) {
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

/* Style pour le focus sur les champs en erreur */
.field-error:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.2);
}

/* Amélioration du style du fichier upload */
.file-upload-label {
    transition: all 0.3s ease;
}

.file-upload-label:hover {
    background-color: #f7fafc;
    border-color: #4299e1;
}

.file-name-display {
    color: #2d3748;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .auto-save-indicator {
        bottom: 10px;
        left: 10px;
        right: 10px;
        text-align: center;
    }
    
    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 36px;
    }
    
    .success-message h3 {
        font-size: 24px;
    }
    
    /* Erreurs inline sur mobile */
    .field-error-message {
        font-size: 13px;
    }
}

/* Conteneur d'erreur uniforme */
.error-container {
    background-color: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
    animation: errorSlideDown 0.3s ease-out;
}

.error-container.warning {
    background-color: #fffaf0;
    border-color: #feb062;
}

@keyframes errorSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-container h4 {
    color: #c53030;
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-container.warning h4 {
    color: #c05621;
}

.error-container h4::before {
    content: '⚠';
    font-size: 18px;
}

.error-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-container li {
    color: #742a2a;
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    font-size: 14px;
}

.error-container.warning li {
    color: #7b341e;
}

.error-container li::before {
    content: '•';
    color: #e53e3e;
    font-weight: bold;
    position: absolute;
    left: 6px;
}

.error-container.warning li::before {
    color: #dd6b20;
}

/* Animation de disparition */
@keyframes errorSlideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.error-container.hiding {
    animation: errorSlideUp 0.3s ease-out forwards;
} 

/* Auto-complétion des entreprises - Styles forcés pour éviter les conflits */
.company-autocomplete-list {
    position: absolute !important;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #ffffff !important; /* Forcer le fond blanc */
    border: 1px solid #b1c0cf !important; /* Bordure explicite */
    border-radius: 4px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 2px;
    list-style: none !important; /* Forcer aucune puce */
    padding: 4px 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    display: none;
    color: #151a23 !important; /* Texte sombre forcé */
}

.company-autocomplete-item {
    padding: 12px 16px !important;
    cursor: pointer;
    color: #151a23 !important; /* Texte sombre forcé */
    background-color: transparent !important; /* Fond transparent forcé */
    font-size: 14px !important;
    line-height: 1.4;
    transition: background-color 0.15s ease, color 0.15s ease;
    border: none !important;
    display: block !important;
    width: 100%;
    text-align: left;
    list-style: none !important; /* Pas de puces */
    margin: 0 !important;
}

.company-autocomplete-item:last-child {
    border-bottom: none !important;
}

.company-autocomplete-item:hover,
.company-autocomplete-item.selected {
    background-color: #f0f3f7 !important; /* Fond hover clair forcé */
    color: #3e54cc !important; /* Couleur primaire forcée */
}

.company-autocomplete-item.no-results {
    color: #878b91 !important; /* Texte clair forcé */
    cursor: default;
    font-style: italic;
    padding: 16px !important;
    text-align: center;
    background-color: transparent !important;
}

.company-autocomplete-item.no-results:hover {
    background-color: transparent !important;
    color: #878b91 !important;
}

/* Positionnement relatif pour le conteneur parent */
#companyNameStep3 {
    position: relative;
}

.form-group:has(#companyNameStep3) {
    position: relative;
}

/* Alternative plus compatible pour le parent du champ entreprise */
#stepCompany .form-group:first-child {
    position: relative;
}

/* Tooltip pour l'aide sur la recherche d'entreprise */
.company-search-tooltip {
    position: absolute;
    background: #2c3e50 !important;
    color: white !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    max-width: 300px !important;
    z-index: 10000 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.3s ease-in-out;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
}

.company-search-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.company-search-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #2c3e50;
}

/* Style pour le champ avec tooltip actif */
#companyNameStep3.tooltip-active {
    border-color: #3498db !important;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2) !important;
}

/* Animation d'entrée plus fluide */
@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.company-search-tooltip.animate-in {
    animation: tooltipFadeIn 0.3s ease-out forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .company-autocomplete-list {
        max-height: 150px !important;
    }
    
    .company-autocomplete-item {
        padding: 14px 16px !important;
        font-size: 15px !important;
    }
}

/* Indicateur de chargement pour la recherche */
.company-search-loading {
    position: relative;
}

.company-search-loading::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #e4e4e7;
    border-top: 2px solid #3e54cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Focus et états accessibles */
.company-autocomplete-item:focus {
    outline: 2px solid #3e54cc !important;
    outline-offset: -2px;
    background-color: #f0f3f7 !important;
}

/* Bouton de partage */
.share-btn {
    margin-right: auto;
}

/* Tooltip personnalisé */
.custom-tooltip {
    position: fixed;
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    max-width: 220px;
    text-align: center;
    z-index: 10001;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(4px);
    transition: all 0.2s ease-in-out;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.custom-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* Modal de partage */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.share-modal {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: shareModalSlide 0.3s ease-out;
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
}

.share-modal-header h3 {
    margin: 0;
    color: var(--color-text);
    font-size: 18px;
    font-weight: 600;
}

.share-modal-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    color: var(--color-text-light);
    transition: all 0.2s ease;
}

.share-modal-close:hover {
    background: var(--color-hover);
    color: var(--color-text);
}

.share-modal-body {
    padding: 24px;
}

.share-modal-body p {
    margin: 0 0 16px 0;
    color: var(--color-text);
    line-height: 1.5;
}

.share-url-container {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.share-url-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    background: var(--color-background);
    color: var(--color-text);
    font-size: 14px;
    font-family: monospace;
    width: 100%;
    word-break: break-all;
}

.share-url-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(49, 196, 141, 0.1);
}

.share-copy-btn {
    padding: 12px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: none;
}

.share-copy-btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

.share-copy-btn svg {
    flex-shrink: 0;
}

.share-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--color-info-bg);
    border: 1px solid var(--color-info-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--color-info-text);
    margin: 0;
}

.share-info svg {
    margin-top: 2px;
    flex-shrink: 0;
    color: var(--color-info-icon);
}

/* Notifications de partage */
.share-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-notification.show {
    transform: translateX(0);
}

.share-notification.success {
    background: var(--color-success);
}

.share-notification.error {
    background: var(--color-error);
}

.share-notification.info {
    background: var(--color-primary);
}

/* Animation pour la modal */
@keyframes shareModalSlide {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Variables de couleur pour les nouvelles fonctionnalités */
:root {
    --color-info-bg: #f0f9ff;
    --color-info-border: #bae6fd;
    --color-info-text: #0c4a6e;
    --color-info-icon: #0284c7;
    --color-success: #10b981;
    --color-error: #ef4444;
}

/* Responsive pour la modal de partage */
@media (max-width: 640px) {
    .share-modal {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .share-url-container {
        flex-direction: column;
    }
    
    .share-copy-btn {
        justify-content: center;
    }
    
    .share-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Adaptation du layout de navigation avec le bouton de partage */
.form-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
}

.form-navigation .share-btn {
    margin-right: auto;
}

/* Barre de scroll visible pour les multi-select */
.session-dropdown-list {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

/* Force l'affichage de la scrollbar partout (méthode globale efficace) */
::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 8px;
}

::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: #cbd5e0;
    border: 1px solid #f7fafc;
    -webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);
}

::-webkit-scrollbar-thumb:hover {
    background-color: #a0aec0;
}

::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 4px;
}

/* Composant de gestion des participants */
.participants-management-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.participants-management-card .form-group {
    margin-bottom: 16px;
}

.participants-management-card .form-group:last-child {
    margin-bottom: 0;
}

/* Style pour la checkbox personnalisée */
.checkbox-container {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    line-height: 1.5;
    font-size: 14px;
    color: #2d3748;
    gap: 12px;
    width: 100%;
    margin: 0;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    background-color: #fff;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
}

.checkbox-container:hover .checkmark {
    border-color: #3e54cc;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background-color: #3e54cc;
    border-color: #3e54cc;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label {
    font-weight: 500;
    flex: 1;
}

/* Animation pour la section détaillée */
#participantsDetailSection {
    transition: all 0.3s ease;
    overflow: hidden;
}

#participantsDetailSection.show {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 

/* Styles pour l'upload de fichier */
.upload-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.upload-loading {
    color: #0073aa;
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-success {
    color: #28a745;
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-success a {
    color: #0073aa;
    text-decoration: underline;
}

.upload-success a:hover {
    text-decoration: none;
}

.upload-error {
    color: #dc3545;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Animation pour le chargement */
@keyframes upload-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.upload-loading {
    animation: upload-pulse 1.5s infinite;
} 

/* Correctif pour la croix de fermeture sur mobile */
@media (max-width: 560px) {
    .modal-header {
        position: relative;
        padding-right: 50px; /* Espace pour le bouton */
    }

    .close-modal-btn {
        position: absolute;
        top: 50%;
        right: 15px;
        transform: translateY(-50%);
        z-index: 10; /* S'assure qu'il est au-dessus du titre */
    }
} 

/* Cache le header principal sur mobile quand la modale est ouverte */
@media (max-width: 768px) { /* Cible les tablettes et en dessous */
    body.modal-open header.header-principal.size13.uppercase.typo7 {
        display: none !important;
    }
} 