.haeros-template {
    display: none;
}

/* Modal overlay */
.hr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    display: none;
}

.hr-modal-overlay.active {
    display: block;
}

/* Modal */
.hr-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    display: none;
}

.hr-modal.active {
    display: block;
}

/* Modal header */
.hr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.hr-modal-title {
    margin: 0;
    font-size: 1.5em;
}

.hr-modal-close {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hr-modal-close:hover {
    color: #000;
}

/* Modal body */
.hr-modal-body {
    padding: 20px;
}

/* Boutons */
.hr-btn-add, .hr-btn {
    background: #dca54a;
    color: #333;
    font-weight: 600;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 15px;
}
.hr-btn-add:hover, .hr-btn:hover {
    background: #1c1c1c;
    color: white;
}

.hr-btn-primary {
    background: #dca54a;
    color: #333;
    font-weight: 600;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    margin-right: 10px;
}

.hr-btn-primary:hover {
    background: #005a87;
    color: white;
}

.hr-btn-secondary {
    background: #dbd5c3;
    color: #333;
}

.hr-btn-secondary:hover {
    color: #fff;
}

.hr-form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 24px;
}

.hr-form-actions #hr-submit-btn {
    text-transform: uppercase;
}

.hr-form-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Conteneur d'entités (flex) */
.hr-entity-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
    min-height: 60px;
    padding: 10px;
    border: 1px dashed #ccc;
    border-radius: 4px;
}

.hr-entity-container:empty::after {
    content: "Vide. Cliquez sur \"Ajouter\".";
    color: #999;
    font-style: italic;
    display: block;
    width: 100%;
    text-align: center;
}

/* Rectangle d'entité */
.hr-entity-item {
    position: relative;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    min-width: 150px;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.2s;
}

.hr-entity-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Titre de l'entité (max 2 lignes) */
.hr-entity-title {
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    margin-bottom: 5px;
}

.hr-entity-price {
    font-size: 12px;
    font-weight: 600;
    color: #dca54a;
    margin-top: 5px;
}

.hr-entity-description {
    font-size: 12px;
    line-height: 1.3;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Croix de suppression */
.hr-entity-remove {
    position: absolute;
    top: 5px;
    right: 5px;
}
.hr-entity-remove, .hr-file-remove {
    background: #dc3232;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
}

.hr-entity-remove:hover, .hr-file-remove:hover {
    background: #a00;
    transform: scale(1.1);
}

/* Messages d'erreur */
.hr-error {
    color: #dc3232;
    font-size: 13px;
    margin-top: 5px;
    display: none;
}

.hr-error-message {
    background: #dc3232;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

.hr-success {
    background: #46b450;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

/* Loading */
.hr-loading {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Form items */
.hr-form-item {
    margin-bottom: 36px;
}

.hr-form-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size:18px;
}
.hr-form-item label.button {
    display: flex;
    width: fit-content;
    font-size: 16px;
    justify-content: center;
}

.hr-form-item input[type="text"],
.hr-form-item input[type="number"],
.hr-form-item input[type="date"],
.hr-form-item input[type="email"],
.hr-form-item textarea,
.hr-form-item select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--ast-border-color);
    border-radius: 0px !important;
    font-size: 16px;
    transition: border-color 0.5s, border-width 0.1s;
}
input[type=text]:focus, 
textarea:focus, 
input[type=number]:focus, 
input[type=email]:focus, 
input[type=date]:focus {
    border-color: #d09a40 !important;
    border-width: 2px;
}

.hr-form-item input[type="file"] {
    display: block;
    margin-top: -3px;
}

.hr-form-item textarea {
    min-height: 100px;
    resize: vertical;
}

.hr-form-item small {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

.required {
    color: #dc3232;
}

.help-text {
    color: #666;
    font-size: 12px;
    font-weight: normal;
}

/* File upload container - flex layout */
.hr-file-upload-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.hr-file-upload-control {
    flex: 0 0 auto;
}

/* File preview */
.hr-file-preview {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    min-width: 0;
}

/* En mobile, le preview passe en dessous */
@media (max-width: 767px) {
    .hr-file-upload-container {
        flex-direction: column;
    }

    .hr-file-preview {
        flex: 1 1 100%;
        margin-top: 10px;
    }
}

.hr-file-preview img {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
}

.hr-file-preview-item {
    position: relative;
    background: transparent;
    width: 120px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hr-file-preview-item img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}

.hr-file-preview-item .hr-file-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hr-file-preview-item .hr-file-name span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #333;
}

.hr-file-box {
    display: inline-block;
    padding: 20px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    min-width: 150px;
}

.hr-file-name {
    display: flex;
    flex-wrap: nowrap;
    column-gap: 16px;
}
button:hover {
    color: white;
}
.hr-file-preview-item > img {
    margin-bottom: 10px;
}