/* ---
   EPS Tools - Feuille de Style v2.1
   Design amélioré, full responsive et dynamique
--- */

/* --- Variables & Configuration Globale --- */
:root {
    --primary-color: #005bea;
    --secondary-color: #00c6fb;
    --accent-color: #f8c92a; /* Jaune sportif pour le dynamisme */
    --dark-color: #2c3e50;
    --light-color: #ffffff;
    --bg-color: #f4f7f6;
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--dark-color);
    line-height: 1.6;
}

/* --- Animations d'Entrée --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* --- Header & Footer --- */
header {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: var(--light-color);
    text-align: center;
    padding: 3rem 1.5rem;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

header h1 {
    margin: 0;
    font-size: 3rem;
    font-weight: 700;
}

main {
    padding: 2rem 1.5rem;
    max-width: 1200px;
    margin: auto;
    animation: fadeIn 0.8s ease-out;
}

footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 0.9rem;
}

/* --- Éléments Communs (Cartes, Boutons) --- */
.section-card, .pwa-card {
    background-color: var(--light-color);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideUp 0.6s ease-out backwards;
    display: flex; /* Permet un meilleur alignement du contenu */
    flex-direction: column;
}

.section-card:hover, .pwa-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

button {
    cursor: pointer;
    border: none;
    border-radius: 25px;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* --- Barre de Recherche (Style unifié) --- */
.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    animation: slideUp 0.5s ease-out;
}

.search-container input {
    width: 60%;
    max-width: 500px;
    padding: 0.8rem 1.5rem;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
}
.search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
}
#search-bar { border-radius: 25px 0 0 25px; }

.search-container button {
    border-radius: 0 25px 25px 0;
    background-color: var(--primary-color);
    color: var(--light-color);
}
.search-container button:hover {
    background-color: #004ab3;
}

/* --- Styles de la Page d'Accueil --- */
.main-sections {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.section-card {
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.section-card h2 {
    margin-top: 0.5rem;
    color: var(--primary-color);
}

.card-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.password-form input {
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 1rem;
    width: 90%;
    text-align: center;
    font-size: 1rem;
}

.password-form button {
    width: 95%;
    background-color: var(--dark-color);
    color: var(--light-color);
}

.password-form button:hover {
    background-color: var(--primary-color);
}

/* --- Styles de la Page Recueil PWA --- */
.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}
.back-link:hover { text-decoration: underline; }

.sport-category { margin-bottom: 3rem; }
.sport-category h2 {
    font-size: 2rem;
    border-bottom: 4px solid var(--accent-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.pwa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.pwa-card {
    padding: 0; /* Retiré pour que l'image touche les bords */
    text-decoration: none;
    color: inherit;
    border-bottom: 5px solid var(--secondary-color);
    overflow: hidden; /* Assure que l'image ne dépasse pas */
}

/* NOUVEAU STYLE POUR L'IMAGE DANS LA CARTE */
.pwa-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover; /* Recadre l'image sans la déformer */
    display: block;
}

.pwa-card h3, .pwa-card p {
    padding: 0 1.5rem; /* Ajoute le padding au texte seulement */
}

.pwa-card h3 {
    margin-top: 1rem;
    color: var(--primary-color);
}

.pwa-card p {
    padding-bottom: 1.5rem;
    flex-grow: 1; /* Pousse le texte pour occuper l'espace disponible */
}

.no-results-message {
    text-align: center;
    padding: 3rem;
    background-color: var(--light-color);
    border-radius: 12px;
}

/* --- Responsivité Avancée --- */
@media (max-width: 992px) {
    header h1 { font-size: 2.5rem; }
    .sport-category h2 { font-size: 1.8rem; }
}

@media (max-width: 576px) {
    header { padding: 2rem 1rem; }
    header h1 { font-size: 2rem; }
    main { padding: 1.5rem 1rem; }
    
    .main-sections, .pwa-grid {
        gap: 1rem;
    }

    .section-card { padding: 1.5rem; }
    .password-form input, .password-form button { width: 100%; }
}