
/* ============================================
   MATERIAL INPUT - gestion des espacements
   ============================================ */
.myheight {
    height: 43px;
}

/* Margin général pour espacer les champs */
input, select, .specialSelect {
    margin-bottom: 5px;
}

/* Dans un groupe : pas de margin sur les éléments internes */
.mat-select-group input,
.mat-select-group select {
    margin-bottom: 0;
}

/* Pas de margin sur les éléments invisibles/structurels */
input[type="hidden"],
.tag-list {
    margin-bottom: 0 !important;
}

/* Le dernier élément VISIBLE de chaque section */
.form-section > *:last-child,
.formBlock > *:last-child {
    margin-bottom: 0;
}

/* Titre de section Material */
.section-title {
    color: #1976d2;
    margin: 20px 0 10px 0;
    font-size: 18px;
}

/* ============================================
   MATERIAL INPUT - Label dans l'input qui monte
   ============================================ */
.input-with-button {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mat-input {
    position: relative;
    /*flex: 1;*/
}

.mat-input:first-of-type {
    clear: both; /* Force un retour à la ligne propre */
}

.mat-input input[type="text"],
.mat-input input[type="number"],
.mat-input input[type="date"],
.mat-input input[type="datetime-local"],
.mat-input input[type="search"],
.mat-input select,
.mat-input textarea {
    width: 100%;
    padding: 12px 14px 8px 14px;
    font-size: 14px;
    border: 2px solid #bdbdbd;
    border-radius: 8px;
    background: white;
    transition: all 0.3s;
    outline: none;
    box-sizing: border-box;
}

.mat-input label {
    position: absolute;
    left: 16px;
    top: 12px;
    font-size: 16px;
    color: #757575;
    pointer-events: none;
    transition: all 0.3s;
    line-height: 1; /* CRUCIAL : empêche le débordement vertical */
}

.mat-input select.has-value + label {
    top: 4px;
    font-size: 12px;
    color: #1976d2;
    background: white;
    padding: 0 4px;
}

/* Hauteur minimum pour les textarea */
.mat-input textarea {
    resize: vertical;
    font-family: Arial, sans-serif;
}

/* Label monte */
.mat-input input:focus ~ label,
.mat-input input:not(:placeholder-shown) ~ label,
.mat-input textarea:focus ~ label,
.mat-input textarea:not(:placeholder-shown) ~ label {
    top: 4px;
    font-size: 10px;
    color: #1976d2;
    font-weight: 600;
}

/* Bordure change de couleur au focus */
.mat-input input:focus,
.mat-input select:focus,
.mat-input textarea:focus {
    border-color: #1976d2;
}

/* Input requis */
.mat-input.required label::after {
    content: ' *';
    color: #ff5252;
}

/* Corriger le positionnement de la liste */
#res {
    position: relative;
    z-index: 1000;
}

#possibleArtworks {
    position: relative;
    z-index: 1000;
}

/* =======================================
            Checkbox Material Design
   ===================================== */

.mat-checkbox {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 5px;
}

.mat-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 30px;
    height: 30px;
    margin: 0;
    z-index: 2; /* Au-dessus du carré visuel */
}

.mat-checkbox .checkbox-box {
    width: 30px;
    height: 30px;
    border: 2px solid #bdbdbd;
    border-radius: 4px;
    background-color: white;
    margin-right: 12px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mat-checkbox input[type="checkbox"]:checked + .checkbox-box {
    background: #1976d2;
    border-color: #1976d2;
}

.mat-checkbox input[type="checkbox"]:checked + .checkbox-box::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.mat-checkbox:hover .checkbox-box {
    border-color: #1976d2;
}

.mat-checkbox input[type="checkbox"]:focus + .checkbox-box {
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2);
}

.mat-checkbox label {
    cursor: pointer;
    user-select: none;
    margin: 0;
}

/* =======================================
            Date Material Design
   ===================================== */

.date-toggle {
    position: absolute;
    top: 7px;
    right: 150px;
    font-size: 14px;
    color: #1976d2;
    text-decoration: none;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #1976d2;
    transition: all 0.2s;
    font-weight: 500;
    white-space: nowrap;
    z-index: 10;
}

.date-toggle:hover {
    background: #1976d2;
    color: white;
}

/* Forcer le label en haut pour les dates partielles */
.mat-input.force-label-up label {
    top: 2px;
    font-size: 11px;
    color: #1976d2;
}

/* =============================================================
            Container pour le select + bouton Material Design
   =========================================================== */

.mat-select-group {
    position: relative;
    display: flex;
    gap: 8px;
    align-items: stretch;
}

/* Material Design Select */
.mat-input select {
    width: 100%;
    padding: 18px 16px;
    font-size: 16px;
    border: 2px solid #bdbdbd;
    border-radius: 8px;
    background: white;
    transition: all 0.3s;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23757575' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.mat-input select:focus {
    border-color: #1976d2;
}

/* Par défaut : label au centre */
.mat-input select + label, .mat-input select#roles + label {
    top: 16px;
    font-size: 18px;
    color: #1976d2;
}

/* Comportement spécial pour le select Role uniquement */
.mat-input select#roles:focus + label,
.mat-input select#roles.has-value + label {
    top: 2px;
    font-size: 12px;
    background: white;
    padding: 0 4px;
}

/* Bouton + */
.add-btn {
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-btn:hover {
    background: #1565c0;
    transform: scale(1.05);
}

.add-btn:active {
    transform: scale(0.95);
}

/* Liste des tags */
.tag-list, #addedCreators  {
    list-style: none;
    margin: 0 0 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 0;
}

.tag-item {
    background: #e3f2fd;
    color: #1976d2;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #90caf9;
}

.tag-remove {
    background: transparent;
    border: none;
    color: #1976d2;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.tag-remove:hover {
    background: #1976d2;
    color: white;
}

/* Style pour VOS éléments ajoutés */
#addedArtypes {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#addedArtypes li {
    /* Pas de style spécial sur le li */
}

.artypeToAdd {
    background: #e3f2fd;
    color: #1976d2;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #90caf9;
}

.artypeToAdd span {
    /* Le texte du label */
}

#removeArtypeBtn {
    background: transparent;
    border: none;
    color: #1976d2;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

#removeArtypeBtn:hover {
    background: #1976d2;
    color: white;
}