/* Typographie */
@font-face {
    font-family: 'pranasapio';
    src: url('/fonts/pranasapio.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'pranasapio-bold';
    src: url('/fonts/pranasapio-bold.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'pranasapio', sans-serif;
}

b {
    font-family: 'pranasapio-bold', sans-serif;
}

/* Ajustements pour les histoires avec image */
.-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--pico-spacing);
    align-items: start;
}



/* Header avec nom du site bien visible */
.site-header {
    text-align: center;
    padding: var(--pico-spacing) 0;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

.site-tagline {
    font-size: 1rem;
    color: var(--pico-muted-color);
    margin: 0.5rem 0 0 0;
}

/* Formulaire */
.site-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;

    .flex-line {
        display: flex;
        align-items: center;
        gap: 8px;
    }
}

.site-form.disabled {
    opacity: 0.7;
    pointer-events: none;
}

/* Labels */
.site-form label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--pico-color, #4a5568);
    margin-bottom: -0.5rem;
}

/* Champs de saisie */
.site-form input[type="text"],
.site-form input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--pico-form-border-color, #e2e8f0);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--pico-form-background, #ffffff);
    color: var(--pico-color, #1a202c);
}

.site-form input[type="text"]:focus,
.site-form input[type="password"]:focus {
    outline: none;
    border-color: var(--pico-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.site-form input[type="text"]:disabled,
.site-form input[type="password"]:disabled {
    background: var(--pico-muted-background, #f7fafc);
    color: var(--pico-muted-color, #a0aec0);
    cursor: not-allowed;
}

/* ==========================
   Boutons "submit" (principaux)
   ========================== */
button[type="submit"] {
    width: auto;
    display: flex;
    justify-content: center;
}

.site-form button[type="submit"] {
    margin: 0rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Cercle d'animation au hover */
.site-form button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.site-form button[type="submit"]:hover::before {
    width: 300px;
    height: 300px;
}

.site-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.site-form button[type="submit"]:active {
    transform: translateY(0);
}

.site-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==========================
   Boutons "button" (secondaires)
   ========================== */
.site-form button[type="button"] {
    background-color: transparent;
    border: 1px solid #718096;
    color: #718096;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Hover pour boutons secondaires */
.site-form button[type="button"]:hover {
    background-color: #e2e8f0;
    color: #667eea;
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 640px) {

    .site-form input[type="text"],
    .site-form input[type="password"] {
        padding: 0.625rem 0.875rem;
        font-size: 0.9375rem;
    }

    .site-form button {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }

    .form-container {
        padding: 0;
        margin: 0 !important;
    }

    .info-icon[data-tooltip]::before {
        bottom: auto;
        top: 125%;
    }

    .info-icon[data-tooltip]::after {
        bottom: auto;
        top: 125%;
        border-color: transparent transparent #1f2937 transparent;
    }
}

@media (max-width: 480px) {
    .site-form {
        gap: 1rem;
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {

    .site-form label {
        color: var(--pico-color, #cbd5e0);
    }

    .site-form input[type="text"],
    .site-form input[type="password"] {
        background: var(--pico-form-background, #1a202c);
        border-color: var(--pico-form-border-color, #4a5568);
        color: var(--pico-color, #f7fafc);
    }

    .site-form input[type="text"]:focus,
    .site-form input[type="password"]:focus {
        border-color: var(--pico-primary, #9f7aea);
        box-shadow: 0 0 0 3px rgba(159, 122, 234, 0.2);
    }

    .site-form input[type="text"]:disabled,
    .site-form input[type="password"]:disabled {
        background: var(--pico-muted-background, #2d3748);
        color: var(--pico-muted-color, #718096);
    }
}

/* Footer */
.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--pico-spacing);
}

.footer-credits {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--pico-spacing);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-tertiary,
.btn-danger {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--pico-muted-background, #e2e8f0);
    color: var(--pico-color, #4a5568);
}

.btn-secondary:hover {
    background: var(--pico-card-border-color, #cbd5e0);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Tooltip CSS moderne */
.info-icon {
    position: relative !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    background: #e5e7eb;
    color: #4b5563;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
    transition: all 0.2s ease;
    flex-shrink: 0;
    z-index: 1;
}

.info-icon:hover {
    background: #3b82f6;
    color: white;
    transform: scale(1.05);
}

/* Tooltip avec position fixed pour sortir du flux */
.info-icon {
    position: relative !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    background: #e5e7eb;
    color: #4b5563;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
    transition: all 0.2s ease;
    flex-shrink: 0;
    z-index: 1;
}

.info-icon:hover {
    background: #3b82f6;
    color: white;
    transform: scale(1.05);
}

/* Tooltip - version qui s'élargit selon le texte */
.info-icon[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute !important;
    transform: translateX(-50%) !important;
    margin-bottom: 8px !important;
    padding: 0.5rem 0.75rem !important;
    background: #1f2937 !important;
    color: white !important;
    font-size: 0.75rem !important;
    white-space: normal !important;
    /* Changé : permet le retour à la ligne */
    word-wrap: break-word !important;
    /* Coupe les mots trop longs */
    max-width: 280px !important;
    /* Largeur maximale avant retour ligne */
    min-width: 120px !important;
    /* Largeur minimale */
    width: max-content !important;
    /* S'élargit selon le contenu */
    border-radius: 0.375rem !important;
    pointer-events: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.2s ease, visibility 0.2s ease !important;
    z-index: 999999 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    line-height: 1.4 !important;
    text-align: center !important;
}

/* Positionnement différent si la tooltip dépasse à droite */
.info-icon[data-tooltip]:hover::before {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.published {
    background: #c6f6d5;
    color: #22543d;
}

.status-badge.draft {
    background: #fed7d7;
    color: #822727;
}

.status-badge.scheduled {
    background: #c4def9;
    color: #275082;
}

/* Message d'erreur */
.error-icon {
    font-size: 1rem;
    line-height: 1.5;
}

.error-content {
    flex: 1;
    font-size: 0.875rem;
}

.error-content ul {
    margin: 0;
    padding-left: 1rem;
}

.error-content li {
    margin-bottom: 0.25rem;
}

.error-content li:last-child {
    margin-bottom: 0;
}


/* Section des formulaires */
.form-section-full {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--pico-card-border-color, #e2e8f0);
}

.form-section-full h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--pico-color, #2d3748);
}

/* Sections de traduction */
.form-section {
    background: var(--pico-card-background-color, #ffffff);
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid var(--pico-card-border-color, #e2e8f0);
}

.form-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    margin-top: 0;
    color: var(--pico-color, #2d3748);
}

.form-container {
    margin: 0 5%;
}

/* Styles spécifiques pour le groupe de boutons */
.form-submit-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
}

/* Bouton Enregistrer - gardez vos styles existants ou utilisez celui-ci */
.form-submit-group button[type="submit"] {
    padding: 0.75rem 1.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-submit-group button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(102, 126, 234, 0.3);
}

/* Bouton Annuler - style épuré avec bordure */
.form-submit-group .btn-cancel {
    padding: 0.75rem 1.75rem;
    background: transparent;
    color: #6c757d;
    border: 2px solid #dee2e6;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.form-submit-group .btn-cancel:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
    transform: translateY(-2px);
    text-decoration: none;
}

.form-separator {
    margin: 2rem 0;
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, #cbd5e1, #e2e8f0, transparent);
}

/* Version avec motif */
.form-separator-dotted {
    margin: 2rem 0;
    border: 0;
    border-top: 2px dotted #cbd5e1;
}

/* Version avec double ligne */
.form-separator-double {
    margin: 2rem 0;
    border: 0;
    border-top: 3px double #cbd5e1;
}

/* Version avec icône au centre */
.separator-with-icon {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 2rem 0;
}

.separator-with-icon::before,
.separator-with-icon::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.separator-with-icon::before {
    margin-right: 1rem;
}

.separator-with-icon::after {
    margin-left: 1rem;
}

.separator-with-icon span {
    font-size: 0.875rem;
    color: #718096;
    background: white;
    padding: 0 1rem;
}

/* Formulaire rows et groupes */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--pico-color, #4a5568);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--pico-card-border-color, #e2e8f0);
    border-radius: 0.5rem;
    background: var(--pico-form-background, #ffffff);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--pico-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="file"] {
    padding: 0.5rem;
    border: 1px dashed var(--pico-card-border-color, #e2e8f0);
    border-radius: 0.5rem;
    background: var(--pico-muted-background, #f7fafc);
}

.form-group input[type="datetime-local"] {
    width: 50%;
    /* padding: 0.75rem; */
    border: 1px solid var(--pico-card-border-color, #e2e8f0);
    border-radius: 0.5rem;
    /* background: var(--pico-form-background, #ffffff); */
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-group input[type="datetime-local"]:focus {
    outline: none;
    border-color: var(--pico-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group-about-photos {
    display: flex;
    gap: 20px;
}

/* Pour que tout l'input soit cliquable */
input[type="datetime-local"] {
    cursor: pointer;
    position: relative;
}

/* Cache l'icône native du navigateur si besoin */
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    opacity: 0;
    /* Rend l'icône invisible mais cliquable partout */
}

/* Alternative : garder l'icône mais étendre la zone cliquable */
input[type="datetime-local"] {
    cursor: pointer;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    width: 100%;
    height: 100%;
    cursor: pointer;
    background-size: auto;
    /* Garde l'icône visible */
    background-position: right center;
    background-repeat: no-repeat;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0;
    overflow: visible !important;
    /* Pour l'affichage de la tooltip */
}

.checkbox-group>div {
    overflow: visible !important;
    position: static !important;
}

.checkbox-group input[type="checkbox"] {
    /* width: auto; */
    margin: 0;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
}

.form-group.has-error label {
    color: #dc2626;
}

.form-group.has-error .form-control,
.form-group.has-error .custom-file-upload {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px #dc2626;
}

/* Style pour les champs en erreur */
.form-control.error,
input.error,
textarea.error,
select.error {
    border-color: #dc2626;
    background-color: #fef2f2;
}

.form-textarea {
    width: 100%;
    max-width: 800px;
    min-width: 450px;
}

.form-divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    gap: 1rem;
}

.form-divider hr {
    flex: 1;
    border: none;
    border-top: 1px solid #e5e7eb;
}

.form-divider span {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Message d'erreur moderne */
.form-error-modern {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #fee2e2;
    border-radius: 0.375rem;
    color: #dc2626;
}

.form-error,
.form-alerte,
.form-success {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Message d'erreur (rouge) */
.form-error {
    background: #fee2e2;
    border-left: 4px solid #dc2626;
    color: #991b1b;
}

/* Message d'alerte (jaune) */
.form-alerte {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

/* Message de succès (vert) */
.form-success {
    background: #d1fae5;
    border-left: 4px solid #10b981;
    color: #065f46;
}

/* Icônes sur la même ligne */
.form-error::before {
    content: "❌";
    font-size: 1rem;
    display: inline-block;
    flex-shrink: 0;
}

.form-alerte::before {
    content: "⚠️";
    font-size: 1rem;
    display: inline-block;
    flex-shrink: 0;
}

.form-success::before {
    content: "✅";
    font-size: 1rem;
    display: inline-block;
    flex-shrink: 0;
}

/* Petits textes dans les messages */
.form-error small,
.form-alerte small,
.form-success small {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-left: 0.5rem;
}

/* Animation d'entrée */
.form-error,
.form-alerte,
.form-success {
    animation: slideIn 0.3s ease;
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}


/* Responsive */
@media (max-width: 768px) {

    .form-error,
    .form-alerte,
    .form-success {
        padding: 0.75rem;
        font-size: 0.75rem;
        gap: 0.5rem;
    }

    .form-error-modern {
        padding: 0.625rem 0.875rem;
        font-size: 0.813rem;
    }


    .form-section {
        padding: 1rem;
    }

    .form-section-full h2,
    .form-section h2 {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }

    .form-group input[type="datetime-local"] {
        width: 100%;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {

    .form-group input[type="text"],
    .form-group input[type="number"],
    .form-group textarea,
    .form-group select {
        background: #1a202c;
        border-color: #4a5568;
        color: #f7fafc;
    }

    .btn-secondary {
        background-color: var(--pico-background-color) !important;
        border: 1px solid grey;
    }
}


/* Ajouter un effet de chargement */
.modal-body .loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

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

    100% {
        transform: rotate(360deg);
    }
}