/* Custom CSS for OASYS Digital Manager */

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Form Styles - Amélioration de la mise en forme des formulaires */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
}

.form-group label.requiredField::after {
    content: " *";
    color: #ef4444;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #1e293b;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="date"]:focus,
.form-group input[type="password"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input[type="text"]:hover,
.form-group input[type="email"]:hover,
.form-group input[type="number"]:hover,
.form-group input[type="date"]:hover,
.form-group input[type="password"]:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #94a3b8;
}

.form-group input[type="text"]:disabled,
.form-group input[type="email"]:disabled,
.form-group input[type="number"]:disabled,
.form-group input[type="date"]:disabled,
.form-group input[type="password"]:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background-color: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Style unifié pour tous les selects - utilise form-select comme classe principale */
.form-group select,
select.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
    background-position: right 0.875rem center;
    background-repeat: no-repeat;
    background-size: 1.125em 1.125em;
    background-color: #ffffff;
    padding-right: 2.875rem;
    padding-left: 0.875rem;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 0.875rem;
    line-height: 1.5;
    min-height: 2.75rem;
    border-radius: 0.5rem;
}

.form-group select:hover,
select.form-select:hover {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%232563eb'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
    border-color: #94a3b8;
    background-color: #f8fafc;
}

.form-group select:focus,
select.form-select:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%232563eb'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
    border-color: #2563eb;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Style amélioré pour les options - appliqué à tous les selects */
.form-group select option,
select.form-select option {
    padding: 0.75rem 1rem;
    background-color: #ffffff;
    color: #1e293b;
    font-size: 0.875rem;
    line-height: 1.75;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
}

.form-group select option:hover,
.form-group select option:focus,
select.form-select option:hover,
select.form-select option:focus {
    background-color: #f1f5f9;
    color: #1e293b;
}

.form-group select option:checked,
.form-group select option[selected],
select.form-select option:checked,
select.form-select option[selected] {
    background-color: #2563eb !important;
    color: #ffffff !important;
    font-weight: 500;
}

/* Style pour le placeholder/option vide */
.form-group select option[value=""],
select.form-select option[value=""] {
    color: #94a3b8;
    font-style: italic;
}

/* Style pour les selects désactivés - déjà défini plus haut, cette règle est redondante */

/* Style pour les selects avec valeur sélectionnée */
.form-group select.has-value,
select.form-select.has-value,
.form-select.has-value {
    color: #1e293b;
    font-weight: 500;
}

.form-group select:not(.has-value),
select.form-select:not(.has-value),
.form-select:not(.has-value) {
    color: #94a3b8;
}

/* Amélioration visuelle pour les selects avec valeur */
.form-group select.has-value:not(:focus),
select.form-select.has-value:not(:focus),
.form-select.has-value:not(:focus) {
    background-color: #ffffff;
    border-color: #cbd5e1;
}

/* Style spécial pour les selects dans les formulaires */
form select.form-select,
form .form-group select {
    font-weight: 400;
}

form select.form-select:not([value=""]),
form .form-group select:not([value=""]) {
    color: #1e293b;
    font-weight: 500;
}

/* Amélioration de la zone de sélection */
.form-group select,
select.form-select,
.form-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Style pour les options dans le dropdown */
.form-group select option,
select.form-select option,
.form-select option {
    padding: 0.625rem 1rem;
    margin: 0.125rem 0;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
}

.form-group select option:first-child,
select.form-select option:first-child,
.form-select option:first-child {
    margin-top: 0;
}

.form-group select option:last-child,
select.form-select option:last-child,
.form-select option:last-child {
    margin-bottom: 0;
}

/* Amélioration visuelle pour les selects enhanced */
.enhanced-select {
    position: relative;
}

.enhanced-select::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.form-group input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.form-group input[type="checkbox"]:checked {
    background-color: #2563eb;
    border-color: #2563eb;
}

.form-group input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Help text */
.form-group .help-text,
.form-group small,
.form-group .form-text {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: #64748b;
}

/* Error messages */
.form-group .invalid-feedback,
.form-group .errorlist {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: #ef4444;
    list-style: none;
    padding: 0;
}

.form-group .errorlist li {
    margin-bottom: 0.25rem;
}

.form-group input.is-invalid,
.form-group select.is-invalid,
.form-group textarea.is-invalid {
    border-color: #ef4444;
}

.form-group input.is-invalid:focus,
.form-group select.is-invalid:focus,
.form-group textarea.is-invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Crispy Forms Bootstrap 5 compatibility */
.control-label {
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #1e293b;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
    background-position: right 0.875rem center;
    background-repeat: no-repeat;
    background-size: 1.125em 1.125em;
    background-color: #ffffff;
    padding-right: 2.875rem;
    padding-left: 0.875rem;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 0.875rem;
    line-height: 1.5;
    min-height: 2.75rem;
    border-radius: 0.5rem;
}

.form-select:hover {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%232563eb'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
    border-color: #94a3b8;
    background-color: #f8fafc;
}

.form-select:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%232563eb'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
    border-color: #2563eb;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-select:disabled {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
    cursor: not-allowed;
    opacity: 0.6;
    background-color: #f1f5f9;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #2563eb;
    border-color: #2563eb;
}

.form-check-label {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    color: #334155;
}

.text-muted {
    color: #64748b;
    font-size: 0.75rem;
}

/* Amélioration supplémentaire pour les selects dans les formulaires */
select.form-select {
    min-height: 2.75rem;
    line-height: 1.5;
}

select.form-select:not([size]):not([multiple]) {
    height: 2.75rem;
}

/* Style pour les selects avec placeholder */
select.form-select option[value=""] {
    color: #94a3b8;
    font-style: italic;
}

/* Amélioration de l'apparence des selects sur différents navigateurs */
select.form-select::-ms-expand,
.form-group select::-ms-expand {
    display: none;
}

/* Animation pour les selects */
@keyframes selectFocus {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }
}

.form-group select:focus,
select.form-select:focus,
.form-select:focus {
    animation: selectFocus 0.2s ease-in-out;
}

/* Style pour les selects dans les modals et formulaires */
.modal select.form-select,
.modal .form-group select,
form select.form-select,
form .form-group select {
    background-color: #ffffff;
}

.modal select.form-select:focus,
.modal .form-group select:focus,
form select.form-select:focus,
form .form-group select:focus {
    background-color: #ffffff;
}

/* Amélioration de la lisibilité des options */
select.form-select option,
.form-group select option {
    padding: 0.5rem 0.75rem;
    line-height: 1.5;
}

/* Style pour les selects avec de nombreuses options */
select.form-select[size],
select.form-select[multiple],
.form-group select[size],
.form-group select[multiple] {
    min-height: 8rem;
    padding: 0.5rem;
}

select.form-select[multiple] option,
.form-group select[multiple] option {
    padding: 0.5rem;
    margin: 0.25rem 0;
    border-radius: 0.25rem;
}

select.form-select[multiple] option:checked,
.form-group select[multiple] option:checked {
    background-color: #2563eb;
    color: #ffffff;
}

/* Message alerts styles */
.message-alert {
    animation: slideInRight 0.3s ease-out;
    max-width: 100%;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message-alert.hiding {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Responsive messages container */
#messages-container {
    max-width: calc(100% - 2rem);
}

@media (max-width: 640px) {
    #messages-container {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
    
    .message-alert {
        width: 100%;
    }
}

/* Fieldset styles pour les formulaires */
fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: #f8fafc;
    transition: all 0.2s ease-in-out;
}

fieldset:hover {
    border-color: #cbd5e1;
    background-color: #f1f5f9;
}

fieldset legend {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    padding: 0 0.75rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Amélioration des sections du formulaire */
.form-section {
    margin-bottom: 2rem;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

/* Style pour les checkboxes dans les formulaires */
.form-check {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.form-check:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.form-check input[type="checkbox"] {
    margin-right: 0.75rem;
    cursor: pointer;
}

.form-check label {
    cursor: pointer;
    margin-bottom: 0;
    font-weight: 500;
    color: #334155;
}

/* Amélioration de l'espacement dans les formulaires */
.space-y-6 > * + * {
    margin-top: 1.5rem;
}

/* Style pour les colonnes dans les formulaires */
.col-md-4,
.col-md-6,
.col-md-8 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    select {
        border: 1px solid #000 !important;
        background-image: none !important;
    }
    
    #messages-container {
        display: none !important;
    }
    
    fieldset {
        border: 1px solid #000 !important;
        page-break-inside: avoid;
    }
}

