/**
 * Styles pour la Banque de mots
 * Vocabulaire - Module /mots/
 */

/* Modal de base */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.modal-content p {
    margin: 0.5rem 0;
    color: var(--text-secondary, #666);
}

.modal-content .mot-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color, #333);
    padding: 0.5rem;
    background: var(--bg-secondary, #f5f5f5);
    border-radius: 6px;
    text-align: center;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Container */
.mots-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Actions */
.mots-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Onglets */
.mots-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color, #e0e0e0);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary, #666);
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary-color, #4a7c59);
    background-color: var(--hover-bg, #f5f5f5);
}

.tab-btn.active {
    color: var(--primary-color, #4a7c59);
    border-bottom-color: var(--primary-color, #4a7c59);
}

/* Filtres */
.mots-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--card-bg, #f9f9f9);
    border-radius: 8px;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color, #4a7c59);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
}

/* Barre alphabétique */
.alphabet-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: var(--card-bg, #f9f9f9);
    border-radius: 8px;
    justify-content: center;
}

.letter-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    border: 1px solid var(--border-color, #ddd);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary, #666);
    transition: all 0.2s;
}

.letter-btn:hover {
    border-color: var(--primary-color, #4a7c59);
    color: var(--primary-color, #4a7c59);
}

.letter-btn.active {
    background-color: var(--primary-color, #4a7c59);
    border-color: var(--primary-color, #4a7c59);
    color: white;
}

.letter-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Toggle vue */
.view-toggle {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
}

.view-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color, #ddd);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-secondary, #666);
    transition: all 0.2s;
}

.view-btn:hover {
    border-color: var(--primary-color, #4a7c59);
    color: var(--primary-color, #4a7c59);
}

.view-btn.active {
    background-color: var(--primary-color, #4a7c59);
    border-color: var(--primary-color, #4a7c59);
    color: white;
}

/* Grille de mots - Mode icônes */
.mots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.mots-grid.view-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Carte mot */
.mot-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.mot-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.mot-card-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    background-color: var(--card-bg, #f0f0f0);
}

.mot-card-image-placeholder {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card-bg, #f0f0f0);
    font-size: 2rem;
}

/* Mode liste */
.view-list .mot-card {
    flex-direction: row;
    align-items: center;
}

.view-list .mot-card-image,
.view-list .mot-card-image-placeholder {
    width: 50px;
    height: 50px;
    min-width: 50px;
    font-size: 1.5rem;
    border-radius: 6px 0 0 6px;
}

.view-list .mot-card-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
}

.view-list .mot-card-word {
    min-width: 150px;
    margin-bottom: 0;
    font-size: 1rem;
}

.view-list .mot-card-definition {
    flex: 1;
    display: block;
    -webkit-line-clamp: 1;
}

.view-list .mot-card-meta {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.view-list .mot-card-actions {
    border-top: none;
    border-left: 1px solid var(--border-color, #eee);
    padding: 0.5rem;
}

.mot-card-content {
    padding: 1rem;
}

.mot-card-word {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color, #333);
    margin-bottom: 0.5rem;
}

.mot-card-definition {
    font-size: 0.9rem;
    color: var(--text-secondary, #666);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mot-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #eee);
}

.mot-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    background-color: var(--badge-bg, #e8f5e9);
    color: var(--badge-color, #2e7d32);
}

.mot-badge-theme {
    background-color: #e3f2fd;
    color: #1565c0;
}

.mot-badge-expression {
    background-color: #fff3e0;
    color: #e65100;
}

.mot-badge-sens {
    background-color: #f3e5f5;
    color: #7b1fa2;
    font-weight: 600;
}

.mot-card-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--card-bg, #f9f9f9);
    border-top: 1px solid var(--border-color, #eee);
}

.mot-card-actions .btn-icon {
    padding: 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
    font-size: 1.35rem;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mot-card-actions .btn-icon:hover {
    background-color: var(--hover-bg, #e0e0e0);
}

.mot-card-actions .btn-icon.danger:hover {
    background-color: #ffebee;
    color: #c62828;
}

/* Stats */
.mots-stats {
    margin-top: 1.5rem;
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary, #666);
    font-size: 0.9rem;
}

/* Modal large */
.modal-large {
    max-width: 600px;
    width: 90%;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary, #666);
}

.modal-close:hover {
    color: var(--text-color, #333);
}

/* Détail mot dans modal */
.mot-detail {
    padding: 1rem;
}

.mot-detail-header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.mot-detail-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.mot-detail-image-placeholder {
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card-bg, #f0f0f0);
    border-radius: 8px;
    font-size: 3rem;
    flex-shrink: 0;
}

.mot-detail-info h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.mot-detail-info p {
    color: var(--text-secondary, #666);
    line-height: 1.6;
}

.mot-detail-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #eee);
}

/* Audio player */
.audio-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.audio-player button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color, #ddd);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audio-player button:hover {
    background-color: var(--hover-bg, #f5f5f5);
}

/* Détail sens - badges */
.mot-detail-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

/* Détail sens - définition */
.mot-detail-definition {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

/* Détail sens - exemple */
.mot-detail-exemple {
    color: var(--text-secondary, #666);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

/* Détail sens - traduction */
.mot-detail-translation {
    color: var(--primary-color, #4a7c59);
    font-size: 0.95rem;
}

/* Autres sens */
.autres-sens {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #eee);
}

.autres-sens h4 {
    font-size: 0.95rem;
    color: var(--text-secondary, #666);
    margin-bottom: 0.75rem;
}

.autres-sens-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.autre-sens-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.autre-sens-card:hover {
    background: var(--hover-bg, #e8e8e8);
}

.autre-sens-card img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.autre-sens-placeholder {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg, #e0e0e0);
    border-radius: 6px;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.autre-sens-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
}

.autre-sens-word {
    font-weight: 600;
    font-size: 0.95rem;
}

.autre-sens-def {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal suppression - warning */
.delete-warning {
    margin: 1rem 0;
    padding: 1rem;
    background: #fff3e0;
    border-radius: 8px;
}

.delete-warning.hidden {
    display: none;
}

.delete-info {
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.delete-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.delete-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
}

.delete-options label:hover {
    background: rgba(0,0,0,0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .mots-filters {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }

    .mots-grid {
        grid-template-columns: 1fr;
    }

    .mot-detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .mots-tabs {
        overflow-x: auto;
    }
}

/* Base commune - styles spécifiques */
.mot-card.validated {
    border-left: 4px solid var(--success-color, #4caf50);
}

.mot-card.pending {
    border-left: 4px solid var(--warning-color, #ff9800);
    opacity: 0.8;
}

.mot-badge-validated {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.mot-badge-pending {
    background-color: #fff3e0;
    color: #f57c00;
}

.mot-badge-rejected {
    background-color: #f5f5f5;
    color: #666;
}

/* Bouton désactivé */
.btn-disabled {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: #e0e0e0;
    color: #757575;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: not-allowed;
}

/* Bouton reproposer */
.btn-warning {
    background: var(--primary-color, #4a7c59);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-warning:hover {
    background: var(--primary-dark, #3d6b4a);
}

/* Empty search results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary, #666);
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Feedback notice (retour sur proposition) */
.rejection-notice {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-left: 4px solid var(--primary-color, #4a7c59);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.rejection-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color, #333);
}

.rejection-icon {
    font-size: 1.2rem;
}

.rejection-reason {
    background: white;
    padding: 0.75rem;
    border-radius: 4px;
    margin: 0.5rem 0;
    color: #555;
    font-style: italic;
    border: 1px solid #e0e0e0;
}

.rejection-hint {
    font-size: 0.85rem;
    color: var(--primary-color, #4a7c59);
    margin: 0.5rem 0 0 0;
}

/* Chargement progressif */
.load-more-container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 1.5rem 0;
}

.load-more-btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.load-more-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
