/* Structure de base */
.page-container {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.view-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Navigation des catégories */
.category-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.category-btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    color: #666;
    transition: color 0.3s;
}

.category-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #333;
    transform: scaleX(0);
    transition: transform 0.3s;
}

.category-btn:hover {
    color: #333;
}

.category-btn.active {
    color: #333;
}

.category-btn.active::after {
    transform: scaleX(1);
}

/* Navigation des sous-catégories */
.subcategory-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.subcategory-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
}

.subcategory-btn:hover {
    background: #f8f8f8;
    color: #333;
}

.subcategory-btn.active {
    background: #333;
    color: white;
    border-color: #333;
}

/* Bouton retour */
.back-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background-color: #f4f4f4;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 2rem;
    transition: background-color 0.3s ease;
}

.back-button:hover {
    background-color: #e4e4e4;
}

.back-button::before {
    content: '←';
    font-size: 1.2rem;
}

.back-button.hidden {
    display: none;
}

/* Barre de filtres */
.filters-bar {
    background: #f8f8f8;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.search-container {
    margin-bottom: 1rem;
}

#search-matches {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#search-matches:focus {
    outline: none;
    border-color: #666;
}

.filters-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

#sort-matches {
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    background-color: white;
}

.date-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-filters input[type="date"] {
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
}

button#apply-filters,
button#reset-filters {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

button#apply-filters {
    background-color: #333;
    color: white;
}

button#apply-filters:hover {
    background-color: #444;
}

button#reset-filters {
    background-color: #ddd;
    color: #666;
}

button#reset-filters:hover {
    background-color: #ccc;
}

/* Fil d'Ariane */
.breadcrumb {
    padding: 1rem 2rem;
    background: #f8f8f8;
    margin-bottom: 2rem;
}

.breadcrumb ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
}

.breadcrumb-item {
    color: #666;
}

.breadcrumb-item:not(:last-child)::after {
    content: ">";
    margin-left: 0.5rem;
    color: #999;
}

.breadcrumb-item.clickable {
    color: #333;
    cursor: pointer;
}

.breadcrumb-item.clickable:hover {
    text-decoration: underline;
}

/* Grille de matches */
.grid-view {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3.5rem;
    padding: 2rem 56px;
    width: 100%;
}

/* Cartes */
.card {
    width: 360px;
    aspect-ratio: 16/10;
    background: #2a2a2a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.card-image {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.match-info {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 0.25rem 1rem;
    gap: 0.5rem;
}

.match-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    gap: 2rem;
}

.team-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 90px;
}

.team-name {
    font-size: 1rem;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    font-weight: bold;
    height: 2.4em;
    display: flex;
    align-items: center;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.match-team-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    padding: 0;
}

.vs {
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    justify-self: center;
    align-self: center;
    position: relative;
    top: 15px;
}

.match-details {
    text-align: center;
    width: 100%;
}

.match-competition {
    font-weight: bold;
    margin-bottom: 0.1rem;
}

/* Galerie photos */
.gallery-view {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    width: 100%;
}

.gallery-item {
    width: 300px;
    aspect-ratio: 1;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover img {
    transform: scale(1.02);
}

/* Message pas de résultats */
.no-results {
    width: 100%;
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
}

/* États */
.hidden {
    display: none;
}

/* Messages d'erreur */
.error-message {
    background-color: #fee;
    color: #c00;
    padding: 1rem;
    margin: 1rem 2rem;
    border-radius: 5px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1600px) {
    .card {
        width: 280px;
    }

    .match-team-logo {
        width: 65px;
        height: 65px;
    }
}

@media (max-width: 1200px) {
    .page-container {
        padding: 0 1.5rem;
    }
    
    .match-team-logo {
        width: 60px;
        height: 60px;
    }

    .category-nav, .subcategory-nav {
        flex-wrap: wrap;
    }
}

@media (max-width: 900px) {
    .page-container {
        padding: 0 1rem;
    }
    
    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }

    .date-filters {
        flex-direction: column;
    }
    
    .card {
        width: 300px;
    }
    
    .match-team-logo {
        width: 55px;
        height: 55px;
    }

    .team-name {
        font-size: 0.9rem;
    }

    .category-btn, .subcategory-btn {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
    }

    .vs {
        margin: 0 2rem;
    }
}

@media (max-width: 600px) {
    .page-container {
        padding: 0 0.5rem;
    }
    
    .category-nav, .subcategory-nav {
        gap: 0.5rem;
    }

    .category-btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }

    .subcategory-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .filters-bar {
        padding: 1rem;
    }

    .breadcrumb {
        padding: 0.75rem 1rem;
    }
    
    .match-team-logo {
        width: 50px;
        height: 50px;
    }

    .team-name {
        font-size: 0.8rem;
    }

    .vs {
        margin: 0 1rem;
    }
}

/* Styles de la visionneuse de photos */
.photo-viewer-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
}

.main-photo-container {
    max-width: 90%;
    max-height: 70vh;
    margin: 20px 0;
}

#mainPhoto {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 50px; /* Taille fixe pour le cercle */
    height: 50px; /* Taille fixe pour le cercle */
    border-radius: 50%; /* Rend le bouton rond */
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.nav-btn.prev {
    left: 30px;
}

.nav-btn.next {
    right: 30px;
}

.nav-btn.hidden {
    display: none;
}

.thumbnails-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    gap: 10px;
    padding: 10px;
    overflow-x: auto;
}

.thumbnail {
    height: 80px;
    width: auto;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.3s;
}

.thumbnail:hover,
.thumbnail.active {
    opacity: 1;
}

.photo-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.photo-viewer.hidden {
    display: none;
}

.photo-viewer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

.photo-viewer-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-photo-container {
    max-width: 90%;
    max-height: 90vh;
}

#currentPhoto {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.close-viewer {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    padding: 10px;
}


.nav-btn.disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.nav-btn i {
    font-size: 20px;
}

.gallery-item img {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.gallery-item img.loaded {
    opacity: 1;
}

.photo-item img,
.gallery-item img {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.photo-item img.loaded,
.gallery-item img.loaded {
    opacity: 1;
}

/* Style pour le loader */
.loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    width: 100%;
    height: 100%;
}