* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Navigation */
nav {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

input[type="text"], input[type="password"] {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    min-width: 200px;
}

/* Color picker amélioré */
input[type="color"] {
    min-width: 60px;
    width: 60px;
    height: 40px;
    cursor: pointer;
    border: 2px solid #ddd;
    border-radius: 4px;
    padding: 2px;
    background: white;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 2px;
}

/* Boutons */
button, .btn-primary, .btn-secondary, .btn-danger {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-primary, button[type="submit"] {
    background: #007bff;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

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

button:hover, .btn-primary:hover, .btn-secondary:hover, .btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-small {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.875rem !important;
}

/* Boutons de catégories */
.category-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.category-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    border-radius: 25px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    min-height: 38px;
}

.category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.category-btn.active {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.category-count {
    background: rgba(255,255,255,0.3);
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    backdrop-filter: blur(4px);
}

.category-btn:not(.active) .category-count {
    background: rgba(0,0,0,0.1);
}

/* Filtres */
.filters {
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

#sortBy, #perPage {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.items-per-page {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.items-per-page label {
    font-size: 0.9rem;
    color: #666;
}

/* Tags */
.tags-container {
    max-width: 1400px;
    margin: 0 auto 1rem;
    padding: 0 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: #e9ecef;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tag:hover, .tag.active {
    background: #007bff;
    color: white;
}

/* Barre de stats */
.stats-bar {
    max-width: 1400px;
    margin: 0 auto 1rem;
    padding: 0 1rem;
}

.stats-info {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.stats-info span {
    padding: 0.25rem 0.5rem;
    background: white;
    border-radius: 4px;
}

/* Grille de mascottes */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.mascot-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    cursor: pointer;
    position: relative;
}

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

.mascot-card.hidden {
    opacity: 0.5;
    filter: grayscale(100%);
}

.mascot-category {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 10;
}

.mascot-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #f8f9fa;
    padding: 1rem;
}

.mascot-info {
    padding: 1rem;
}

.mascot-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.mascot-desc {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.mascot-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #999;
}

.mascot-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.mascot-actions button {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.btn-page {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-page:hover:not(:disabled) {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pageNumbers {
    display: flex;
    gap: 0.5rem;
}

.page-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-number:hover {
    background: #f0f0f0;
}

.page-number.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.page-number.dots {
    cursor: default;
    border: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    animation: fadeIn 0.2s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

.close {
    float: right;
    font-size: 1.5rem;
    cursor: pointer;
    margin: -1rem -0.5rem 0 0;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

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

/* Gestion des catégories avec drag & drop */
.category-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.category-form input[type="text"] {
    flex: 1;
    height: 40px;
}

.category-form input[type="color"] {
    flex: 0 0 60px;
}

.category-form button {
    height: 40px;
}

#categoriesList {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
    min-height: 50px;
    margin-bottom: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: move;
}

.category-item[draggable="false"] {
    cursor: default;
}

.drag-handle {
    cursor: grab;
    padding: 0 0.5rem;
    color: #999;
    font-size: 1.2rem;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.category-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.category-item.drag-over {
    border-top: 3px solid #007bff;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.category-edit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.category-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.category-color {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 2px solid #ddd;
    flex-shrink: 0;
}

.category-name {
    font-weight: 600;
    min-width: 120px;
}

.category-stats {
    font-size: 0.875rem;
    color: #666;
    margin-left: auto;
    margin-right: 1rem;
}

.edit-category-name {
    flex: 1;
    padding: 0.4rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.edit-category-color {
    width: 50px;
    height: 35px;
    cursor: pointer;
    border: 2px solid #ddd;
    border-radius: 4px;
    padding: 2px;
}

/* Info pour l'utilisateur */
#categoriesModal .modal-content::after {
    content: "Glissez-déposez pour réorganiser l'ordre d'affichage";
    display: block;
    text-align: center;
    color: #999;
    font-size: 0.875rem;
    margin-top: 1rem;
    font-style: italic;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed #007bff;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin: 1rem 0;
}

.drop-zone:hover, .drop-zone.dragover {
    background: rgba(0,123,255,0.1);
    border-color: #0056b3;
}

.upload-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: #f8f9fa;
    margin: 0.5rem 0;
    border-radius: 4px;
}

.upload-progress {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.25rem;
}

.upload-progress-bar {
    height: 100%;
    background: #28a745;
    transition: width 0.3s;
}

/* Page de login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 400px;
}

.login-container h1 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    input[type="text"] {
        width: 100%;
        min-width: auto;
    }
    
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .mascot-image {
        height: 150px;
    }
    
    .category-buttons {
        justify-content: center;
    }
    
    .category-btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    #sortBy, .items-per-page {
        width: 100%;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    #pageNumbers {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
}

/* Styles pour le footer et les mentions de propriété intellectuelle - À ajouter dans app.css */

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 4px solid #007bff;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.copyright-notice {
    font-size: 0.9rem;
    line-height: 1.6;
}

.copyright-notice p {
    margin: 0.5rem 0;
}

.copyright-notice p:first-child {
    font-size: 1rem;
    font-weight: 600;
}

.copyright-notice p:last-child {
    font-size: 0.85rem;
    color: #bdc3c7;
}

/* Modal avec copyright */
.modal-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.copyright-modal {
    display: block;
    text-align: center;
    color: #6c757d;
    font-size: 0.8rem;
    line-height: 1.4;
}

.copyright-notice-modal {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.copyright-notice-modal p {
    margin: 0;
    line-height: 1.6;
}

/* Responsive pour le footer */
@media (max-width: 768px) {
    .footer {
        margin-top: 2rem;
        padding: 1.5rem 0;
    }
    
    .copyright-notice {
        font-size: 0.8rem;
    }
    
    .copyright-notice p:last-child {
        font-size: 0.75rem;
    }
}