/* Styles pour les polices personnalisées */

/* Classe de base pour les éléments utilisant des polices personnalisées */
.custom-font {
    font-display: swap; /* Améliore les performances de chargement */
}

/* Styles pour l'éditeur de templates */
.template-editor .zone-text {
    font-display: swap;
}

/* Styles pour la prévisualisation des affiches */
.poster-preview .zone-text {
    font-display: swap;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Styles pour les sélecteurs de polices */
.font-selector option[data-font-id] {
    font-style: italic;
    color: #0f9d58;
}

/* Animation de chargement des polices */
@keyframes fontLoading {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.font-loading {
    animation: fontLoading 1.5s infinite;
}

/* Styles pour les messages d'état des polices */
.font-status {
    font-size: 11px;
    margin-top: 4px;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

.font-status.loading {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.font-status.loaded {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.font-status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Styles pour l'upload de polices */
.font-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.font-upload-area:hover {
    border-color: #0f9d58;
    background-color: #f8fff9;
}

.font-upload-area.dragover {
    border-color: #0f9d58;
    background-color: #e8f5e8;
}

.font-upload-input {
    display: none;
}

.font-upload-button {
    background-color: #0f9d58;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.font-upload-button:hover {
    background-color: #0d8a4f;
}

/* Styles pour la liste des polices personnalisées */
.custom-fonts-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-top: 10px;
}

.custom-font-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #f1f3f4;
    font-size: 12px;
}

.custom-font-item:last-child {
    border-bottom: none;
}

.custom-font-name {
    font-weight: 500;
    color: #333;
}

.custom-font-size {
    color: #6c757d;
    font-size: 10px;
}

.custom-font-actions {
    display: flex;
    gap: 4px;
}

.custom-font-action {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 10px;
    transition: all 0.2s;
}

.custom-font-action:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.custom-font-action.delete:hover {
    color: #dc3545;
    background-color: #f8d7da;
}

/* Responsive design */
@media (max-width: 768px) {
    .font-upload-area {
        padding: 10px;
    }
    
    .custom-font-item {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .font-upload-button {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* Styles pour l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    .font-loading {
        animation: none;
    }
    
    .font-upload-area {
        transition: none;
    }
}

/* Styles pour le mode sombre (si implémenté) */
@media (prefers-color-scheme: dark) {
    .font-upload-area {
        border-color: #495057;
        background-color: #343a40;
        color: #f8f9fa;
    }
    
    .font-upload-area:hover {
        border-color: #28a745;
        background-color: #1e2125;
    }
    
    .custom-fonts-list {
        border-color: #495057;
        background-color: #343a40;
    }
    
    .custom-font-item {
        border-bottom-color: #495057;
        color: #f8f9fa;
    }
    
    .custom-font-name {
        color: #f8f9fa;
    }
}