/* ════════════════════════════════════════════════════════════
   MAIN.CSS — Feuille de style principale Pilote Cinéma
   Bulma est chargé via CDN dans chaque fichier PHP
   Ici : variables, navbar, cards, formulaires, auth, admin
════════════════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────────────────
   1. IMPORT BULMA
──────────────────────────────────────────────────────────── */
@import url('https://cdn.jsdelivr.net/npm/bulma@1.0.4/css/bulma.min.css');

/* ────────────────────────────────────────────────────────────
   2. VARIABLES CSS
──────────────────────────────────────────────────────────── */
:root {
  --rouge:  #e50914;
  --noir:   #121212;
  --gris:   #1f1f1f;
  --blanc:  #ffffff;
}

/* ────────────────────────────────────────────────────────────
   3. BASE
──────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  background-color: var(--noir);
  color: var(--blanc);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

footer {
  text-align: center;
  padding: 1.5rem;
  color: #555;
  font-size: 0.85rem;
  border-top: 1px solid #222;
  margin-top: 3rem;
}

/* ────────────────────────────────────────────────────────────
   4. NAVBAR
──────────────────────────────────────────────────────────── */
.navbar {
  background-color: #0a0a0a !important;
  border-bottom: 2px solid var(--rouge);
  padding: 0 1.5rem;
}

.navbar-item,
.navbar-link {
  color: #ddd !important;
  font-weight: 500;
}

.navbar-item:hover,
.navbar-link:hover {
  background-color: #1a1a1a !important;
  color: white !important;
}

.navbar-dropdown {
  background-color: #1a1a1a !important;
  border-top: 2px solid var(--rouge) !important;
}

.navbar-dropdown .navbar-item:hover {
  background-color: #2a2a2a !important;
}

.navbar-burger span {
  background-color: white !important;
}

.navbar-menu.is-active {
  background-color: #0a0a0a !important;
}

/* ────────────────────────────────────────────────────────────
   5. BOUTONS BULMA OVERRIDE
──────────────────────────────────────────────────────────── */
.button.is-primary {
  background-color: var(--rouge) !important;
  border-color: var(--rouge) !important;
  color: white !important;
}

.button.is-primary:hover {
  opacity: 0.85;
}

.button.is-light {
  background-color: #2a2a2a !important;
  border-color: #444 !important;
  color: white !important;
}

.button.is-light:hover {
  background-color: #333 !important;
}

/* ────────────────────────────────────────────────────────────
   6. SECTION PRÉSENTATION (index.php)
──────────────────────────────────────────────────────────── */
.presentation {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #1a0000 0%, #2a2a2a 100%);
  border-bottom: 1px solid #333;
}

.presentation h3 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: white;
}

.presentation p {
  font-size: 1.1rem;
  color: #aaa;
  margin-bottom: 2rem;
}

/* ────────────────────────────────────────────────────────────
   7. BOX ET CARD BULMA DARK
──────────────────────────────────────────────────────────── */
.box {
  background-color: #2a2a2a !important;
  color: white !important;
  border: 1px solid #333 !important;
  transition: border-color 0.2s;
}

.box:hover {
  border-color: var(--rouge) !important;
}

.card {
  background-color: #2a2a2a !important;
  border: 1px solid #333 !important;
  max-width: 600px;
  margin: 2rem auto;
}

.card .title,
.card .card-content {
  color: white !important;
}

.card-footer {
  border-top: 1px solid #333 !important;
}

.card-footer-item {
  color: var(--rouge) !important;
  border-right: none !important;
}

.card-footer-item:hover {
  background-color: #333 !important;
}

/* ────────────────────────────────────────────────────────────
   8. HERO DES PAGES (film, séries, recommandation)
──────────────────────────────────────────────────────────── */
.reco-hero,
.contact-hero {
  text-align: center;
  padding: 3rem 1.5rem;
  background: linear-gradient(135deg, #1a0000 0%, #2a2a2a 100%);
  border-bottom: 2px solid var(--rouge);
  margin-bottom: 1.5rem;
}

.reco-hero h1,
.contact-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
}

.reco-hero-sub,
.contact-hero p {
  color: #aaa;
  font-size: 1rem;
}

/* ────────────────────────────────────────────────────────────
   9. FILTRES
──────────────────────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #222;
  border-bottom: 1px solid #222;
}

.filter-btn {
  background-color: #2a2a2a;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 20px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
}

.filter-btn:hover {
  background-color: #333;
  color: white;
  border-color: var(--rouge);
}

.filter-btn.active {
  background-color: var(--rouge);
  color: white;
  border-color: var(--rouge);
}

/* ────────────────────────────────────────────────────────────
   10. GRILLE DE CARTES (films, séries)
──────────────────────────────────────────────────────────── */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem;
}

.anime-card {
  background-color: #1f1f1f;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #333;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
}

.anime-card:hover {
  transform: translateY(-4px);
  border-color: var(--rouge);
}

.card-img {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  background-color: #2a2a2a;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 3rem;
  background-color: #2a2a2a;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.anime-card:hover .card-overlay {
  opacity: 1;
}

.btn-voir {
  background-color: var(--rouge);
  color: white !important;
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn-voir:hover {
  opacity: 0.85;
}

.card-info {
  padding: 0.75rem;
}

.card-info h3 {
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.stars {
  color: #f5a623;
  font-size: 0.75rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.tag {
  background-color: #333 !important;
  color: #ccc !important;
  font-size: 0.7rem !important;
  border-radius: 4px !important;
  padding: 0.15rem 0.5rem !important;
}

/* ────────────────────────────────────────────────────────────
   11. TMDB CREDIT + LOADING
──────────────────────────────────────────────────────────── */
.tmdb-loading {
  color: #888;
  padding: 2rem;
  text-align: center;
  width: 100%;
}

.tmdb-credit {
  text-align: center;
  color: #555;
  font-size: 0.75rem;
  padding: 1rem 1.5rem 0.5rem;
}

/* ────────────────────────────────────────────────────────────
   12. RECHERCHE (séries)
──────────────────────────────────────────────────────────── */
.series-search {
  background-color: #1f1f1f;
  border: 1px solid #444;
  border-radius: 20px;
  color: white;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  outline: none;
  width: 280px;
  transition: border-color 0.2s;
}

.series-search:focus {
  border-color: var(--rouge);
}

.series-search::placeholder {
  color: #666;
}

/* ────────────────────────────────────────────────────────────
   13. PAGINATION
──────────────────────────────────────────────────────────── */
.series-pagination {
  padding: 1.5rem;
}

.pagination-previous,
.pagination-next,
.pagination-link {
  background-color: #2a2a2a !important;
  border-color: #444 !important;
  color: white !important;
  cursor: pointer;
}

.pagination-link:hover,
.pagination-previous:hover,
.pagination-next:hover {
  background-color: var(--rouge) !important;
  border-color: var(--rouge) !important;
}

.pagination-link.is-current {
  background-color: var(--rouge) !important;
  border-color: var(--rouge) !important;
  color: white !important;
}

.pagination-ellipsis {
  color: #555 !important;
}

.pagination-previous.is-disabled,
.pagination-next.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ────────────────────────────────────────────────────────────
   14. INDEX — Section header
──────────────────────────────────────────────────────────── */
.index-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.index-voir-plus {
  color: var(--rouge);
  font-size: 0.875rem;
  font-weight: 600;
  transition: opacity 0.2s;
  text-decoration: none;
}

.index-voir-plus:hover {
  opacity: 0.75;
}

/* Bulma title dark override */
.title {
  color: white !important;
}

/* ────────────────────────────────────────────────────────────
   15. AUTH — Login / Signup
──────────────────────────────────────────────────────────── */
.auth-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 1.5rem;
  min-height: calc(100vh - 180px);
}

.auth-box {
  background-color: #2a2a2a;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  display: block;
  max-height: 80px;
  margin: 0 auto 1.5rem;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1.5rem;
  text-align: center;
}

.auth-errors {
  background-color: rgba(229, 9, 20, 0.12);
  border: 1px solid var(--rouge);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: #ff6b6b;
}

.auth-errors p + p {
  margin-top: 0.3rem;
}

.auth-switch {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: #888;
}

.auth-switch a {
  color: var(--rouge);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover {
  opacity: 0.8;
}

/* ────────────────────────────────────────────────────────────
   16. FORMULAIRES (contact, report, auth)
──────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #444;
  border-radius: 6px;
  background-color: #1a1a1a;
  color: white;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
  display: block;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--rouge);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #666;
}

.form-group select option {
  background-color: #1a1a1a;
  color: white;
}

.form-group textarea {
  resize: vertical;
  min-height: 150px;
}

.btn-submit {
  background-color: var(--rouge);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, background-color 0.2s;
  display: block;
  width: 100%;
}

.btn-submit:hover {
  opacity: 0.9;
  background-color: #d90810;
}

/* ────────────────────────────────────────────────────────────
   17. CONTACT PAGE
──────────────────────────────────────────────────────────── */
.contact-container {
  max-width: 620px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
}

.contact-form {
  background-color: #2a2a2a;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 2rem;
}

.contact-success {
  background: #1a2a1a;
  border: 1px solid #2a4a2a;
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  color: #aaffaa;
  margin-bottom: 2rem;
}

.contact-info {
  max-width: 620px;
  margin: 0 auto 2rem;
  padding: 1.5rem;
  background-color: #2a2a2a;
  border-left: 4px solid var(--rouge);
  border-radius: 6px;
}

.contact-info h2 {
  color: white;
  margin-bottom: 1rem;
}

.contact-info p {
  color: #ccc;
  line-height: 1.6;
}

.contact-info strong {
  color: var(--rouge);
}

/* ────────────────────────────────────────────────────────────
   18. REPORT PAGE
──────────────────────────────────────────────────────────── */
.report-success {
  text-align: center;
  padding: 3rem;
  font-size: 1.1rem;
  color: #aaffaa;
  background: #1a2a1a;
  border: 1px solid #2a4a2a;
  border-radius: 10px;
  max-width: 620px;
  margin: 0 auto;
}

/* ────────────────────────────────────────────────────────────
   19. ANIMATION FADE
──────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeUp 0.4s ease forwards;
}

/* ────────────────────────────────────────────────────────────
   20. RESPONSIVE
──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .anime-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
  }

  .reco-hero h1,
  .contact-hero h1 {
    font-size: 1.8rem;
  }

  .auth-box {
    padding: 1.5rem;
  }

  .contact-form {
    padding: 1.5rem;
  }

  .series-search {
    width: 100%;
  }
}