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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

/* Container centré */
.container {
    max-width: 1200px;
    margin: auto;
    padding: 10px;
}

/* Titres */
h1, h2, h3 {
    margin-bottom: 20px;
    color: #222;
}

/* Boutons */
button,
input[type="submit"],
a.button {
    background-color: #e63946; /* accent rouge */
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
}

/* Focus accessible sur boutons et liens */
button:focus,
input[type="submit"]:focus,
a.button:focus {
    outline: 2px solid #e63946;
    outline-offset: 2px;
}

button:hover,
input[type="submit"]:hover,
a.button:hover {
    background-color: #b32b35;
}

/* Formulaire */
form {
    margin-top: 20px;
}

form label {
    display: block;
    margin-top: 15px;
    margin-bottom: 6px;
    font-weight: 600;
}

/* Nouveau : regroupement en ligne pour formulaire recherche */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
}

.form-group input,
.form-group select {
    width: 100%;
    box-sizing: border-box;
}

/* Styles spécifiques pour ligne alignée (Âge min, max, Taille, Poids + bouton) */
.form-row-align {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-group-inline {
    flex: 1 1 100px;
    display: flex;
    flex-direction: column;
}

.form-group-button {
    margin-left: auto;
    display: flex;
    align-items: flex-end;
}

.form-group-button input[type="submit"] {
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
}

/* Focus accessible sur liens menu */
.nav-menu li a:focus {
    outline: 2px solid #e63946;
    outline-offset: 2px;
}

/* Navigation principale modernisée */
.main-nav {
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 999;
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.nav-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #222;
    text-decoration: none;
}

.logo .highlight {
    color: #e63946;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-menu li a {
    color: #444;
    text-decoration: none;
    font-size: 1.05rem;
    padding: 8px 4px;
    position: relative;
    transition: color 0.3s ease;
    border-bottom: 2px solid transparent;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    color: #e63946;
    border-bottom: 2px solid #e63946;
}

.nav-menu li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0;
    height: 2px;
    background-color: #e63946;
    transition: width 0.3s ease;
}

.nav-menu li a:hover::after,
.nav-menu li a.active::after {
    width: 100%;
}

/* Bouton hamburger mobile */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 24px;
    position: relative;
    z-index: 1000;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    content: '';
    display: block;
    background-color: #222;
    height: 3px;
    border-radius: 2px;
    position: absolute;
    width: 100%;
    transition: all 0.3s ease;
}

.hamburger {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

.nav-toggle_active .hamburger {
    background-color: transparent;
}

.nav-toggle_active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.nav-toggle_active .hamburger::after {
    transform: rotate(-45deg);
    bottom: 0;
}

/* Listes */
ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

ul li {
    padding: 0;
    border-bottom: none;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th,
table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

table th {
    background-color: #f1f1f1;
}

/* Loader */
#loader {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

#loader.active {
    display: flex;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #e63946;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive mobile */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    nav a {
        display: block;
        margin-bottom: 10px;
    }

    table,
    table thead,
    table tbody,
    table th,
    table td,
    table tr {
        display: block;
    }

    table tr {
        margin-bottom: 15px;
    }

    table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
    }

    table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 45%;
        padding-right: 10px;
        font-weight: bold;
        text-align: left;
    }

    /* Formulaire : champs regroupés en colonne sur mobile */
    .form-row {
        flex-direction: column;
    }

    /* Styles pour ligne alignée sur mobile */
    .form-row-align {
        flex-direction: column;
    }
    .form-group-inline,
    .form-group-button {
        flex: 1 1 100%;
        margin-left: 0;
    }
    .form-group-button {
        margin-top: 10px;
        align-items: stretch;
    }
    .form-group-button input[type="submit"] {
        width: 100%;
    }

    /* Menu responsive */
    .nav-menu {
        position: fixed;
        top: 60px;
        right: 0;
        background: white;
        width: 240px;
        height: calc(100% - 60px);
        box-shadow: -4px 0 12px rgba(0,0,0,0.1);
        flex-direction: column;
        padding: 30px 20px;
        gap: 20px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 999;
        display: flex;
    }
    .nav-menu.nav-menu_visible {
        transform: translateX(0);
    }
    .nav-menu li a {
        font-size: 1.2rem;
        padding: 12px 8px;
    }
    .nav-toggle {
        display: block;
    }
}

/* Résultats recherche mannequins */
.liste-profils {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding: 0;
    list-style: none;
}

.profil-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, border-color 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border: 2px solid transparent; /* Bordure invisible par défaut */
}

.profil-item:hover,
.profil-item:focus-within {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    border-color: #e63946; /* Bordure rouge au survol/focus */
}

.profil-item a {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.photo-profil {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.profil-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.profil-info h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #222;
}

.profil-info p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 6px;
    line-height: 1.3;
}

/* Pagination améliorée */
.pagination {
    margin-top: 30px;
    text-align: center;
}

.pagination a,
.pagination strong {
    display: inline-block;
    margin: 0 6px;
    padding: 8px 14px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    color: #e63946;
    border: 2px solid transparent;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.pagination a:hover {
    background-color: #e63946;
    color: white;
    border-color: #b32b35;
}

.pagination strong {
    background-color: #e63946;
    color: white;
    border-color: #b32b35;
    cursor: default;
}

/* Responsive */
@media (max-width: 768px) {
    .liste-profils {
        grid-template-columns: 1fr;
    }

    .photo-profil {
        height: 220px;
    }
}

/* Styles casting similaires à profils */
.casting-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, border-color 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border: 2px solid transparent; /* bordure invisible par défaut */
}

.casting-item:hover,
.casting-item:focus-within {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    border-color: #e63946; /* bordure rouge au survol/focus */
}

.casting-item a {
    color: inherit;
    text-decoration: none;
    flex-grow: 1;
}

/* Image casting : taille fixe avec object-fit */
.casting-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

/* Textes dans casting-item */
.casting-title {
    font-weight: 700;
    color: #e63946;
    margin: 12px 15px 6px;
    font-size: 1.1rem;
}

.casting-dates {
    font-size: 0.9rem;
    color: #666;
    margin: 0 15px 10px;
}

.casting-excerpt {
    font-size: 0.95rem;
    color: #444;
    margin: 0 15px 15px;
}

/* Responsive pour casting-image */
@media (max-width: 768px) {
    .casting-image {
        height: 220px;
    }
}

/* Uniformiser tous les champs du formulaire */
form input[type="text"],
form input[type="number"],
form input[type="date"],
form input[type="url"],
form select,
form textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    font-family: inherit;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    background-color: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 15px;
    resize: vertical;
}

form input[type="date"] {
    background-color: white;
}

form input[type="text"]:focus,
form input[type="number"]:focus,
form input[type="date"]:focus,
form input[type="url"]:focus,
form select:focus,
form textarea:focus {
    outline: none;
    border-color: #e63946;
    box-shadow: 0 0 6px #e63946aa;
}
.main-nav {
  background: #fff;
  border-bottom: 2px solid #e63946;
  position: sticky;
  top: 0;
  z-index: 999;
}

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

.logo {
  font-weight: 700;
  font-size: 1.4rem;
  color: #e63946;
  text-decoration: none;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.nav-menu li a {
  text-decoration: none;
  color: #333;
  font-weight: 600;
  transition: color 0.3s;
}

.nav-menu li a.active,
.nav-menu li a:hover {
  color: #e63946;
}

.nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: none; /* caché desktop */
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1001;
}

.nav-toggle .hamburger,
.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
  display: block;
  background-color: #e63946;
  position: absolute;
  height: 3px;
  width: 100%;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav-toggle .hamburger {
  top: 50%;
  margin-top: -1.5px;
}

.nav-toggle .hamburger::before {
  content: "";
  top: -8px;
}

.nav-toggle .hamburger::after {
  content: "";
  top: 8px;
}

/* Quand menu ouvert */
.nav-toggle.nav-toggle_active .hamburger {
  background-color: transparent;
}
.nav-toggle.nav-toggle_active .hamburger::before {
  transform: rotate(45deg);
  top: 0;
}
.nav-toggle.nav-toggle_active .hamburger::after {
  transform: rotate(-45deg);
  top: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
  
  .nav-menu {
    position: fixed;
    top: 60px;
    right: -100%;
    width: 200px;
    height: calc(100% - 60px);
    background-color: #fff;
    flex-direction: column;
    padding: 1rem;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
  }

  .nav-menu.nav-menu_visible {
    right: 0;
  }

  .nav-menu li {
    margin-bottom: 1rem;
  }

  .nav-menu li:last-child {
    margin-bottom: 0;
  }
}
