﻿:root {
  --bg: #f7f7f2;
  --surface: #ffffff;
  --text: #18222d;
  --primary: #e23636;
  --primary-dark: #b62828;
  --border: #d8dfe6;
  --muted: #576575;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(24, 34, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fff5f5 0%, var(--bg) 220px, var(--bg) 100%);
}

a {
  color: inherit;
  text-decoration-color: #aab3bd;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.container {
  width: min(100% - 2rem, 1100px);
  margin-inline: auto;
  padding-bottom: 3rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  flex-wrap: wrap;
}

.brand {
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.top-nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.top-nav a,
.ghost-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}

.brand,
.button {
  text-decoration: none;
}

.page-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.status,
.message {
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  background: #e9eef2;
  color: #20405d;
  font-size: 0.95rem;
}

.message.error {
  background: #ffe4e4;
  color: #8a2020;
}

.grid {
  display: grid;
  gap: 1rem;
}

.films-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.filters-card {
  margin-bottom: 1rem;
}

.search-card {
  margin-bottom: 1rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.film-card img {
  width: 100%;
  border-radius: 10px;
  height: 320px;
  object-fit: cover;
  object-position: center;
  background: #f3f6f9;
}

.film-hero img {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
}

.film-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.film-average {
  margin: 0.1rem 0 0.3rem;
  font-weight: 600;
}

.film-average-badge {
  min-width: 0;
  margin-left: 0.2rem;
  padding: 0.2rem 0.5rem;
}

.button,
button,
input,
textarea {
  font: inherit;
}

.button,
button {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
}

.button:hover,
button:hover {
  background: var(--primary-dark);
}

.form {
  display: grid;
  gap: 0.85rem;
  max-width: 560px;
}

.inline-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.inline-actions.inline-edit {
  flex-wrap: nowrap;
  gap: 0.45rem;
}

.inline-actions.inline-edit input {
  max-width: 130px;
  padding: 0.38rem 0.55rem;
}

.inline-actions.inline-edit .ghost-button {
  padding: 0.38rem 0.7rem;
}

.icon-circle-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #fff;
}

.icon-link {
  text-decoration: none;
}

.icon-circle-btn.save {
  background: #44b96b;
}

.icon-circle-btn.save:hover {
  background: #379a58;
}

.icon-circle-btn.delete {
  background: #e23636;
}

.icon-circle-btn.delete:hover {
  background: #b62828;
}

.media-buttons {
  gap: 0.5rem;
}

.media-pill {
  border-radius: 999px;
}

.media-pill.is-selected {
  border-color: var(--primary);
  background: #ffeaea;
  color: #8a2020;
}

.media-users-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.3rem;
}

.season-controls {
  display: grid;
  gap: 0.55rem;
  margin: 0.6rem 0 0.9rem;
}

.season-adjuster strong {
  min-width: 48px;
  text-align: center;
  display: inline-block;
}

.season-adjuster {
  margin-left: 10px;
  font-size: 0.9rem;
  gap: 0.4rem;
}

.season-manual-help {
  margin: 0;
}

.season-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.season-card-header h3 {
  margin: 0;
}

.season-open-button {
  margin-left: auto;
  white-space: nowrap;
}

.content-creation-card {
  padding-top: 0.85rem;
}

.creation-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.creation-tab {
  background: #eef2f6;
  color: #435465;
  border: 1px solid var(--border);
  border-bottom: none;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  padding: 0.58rem 0.9rem;
  font-weight: 700;
}

.creation-tab:hover {
  background: #dfe7ef;
}

.creation-tab.is-active {
  background: #ffffff;
  color: var(--text);
  position: relative;
  top: 1px;
}

.creation-panel {
  display: none;
  border: 1px solid var(--border);
  border-top: none;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  padding: 1rem 0.9rem 0.9rem;
  background: #fff;
}

.creation-panel.is-active {
  display: block;
}

.episode-bulk-form {
  max-width: none;
}

.bulk-episodes-table {
  min-width: 760px;
}

.bulk-episodes-table th:nth-child(1),
.bulk-episodes-table td:nth-child(1) {
  width: 64px;
  text-align: center;
}

.bulk-episodes-table th:nth-child(2),
.bulk-episodes-table td:nth-child(2) {
  width: 170px;
  text-align: left;
}

.bulk-episodes-table th:nth-child(3),
.bulk-episodes-table td:nth-child(3) {
  text-align: left;
}

.bulk-episodes-table th:nth-child(4),
.bulk-episodes-table td:nth-child(4) {
  width: 250px;
  text-align: left;
}

.bulk-episodes-table input {
  min-width: 100%;
  border-radius: 8px;
  padding: 0.45rem 0.58rem;
}

.bulk-episode-index {
  font-weight: 700;
  color: var(--muted);
}

.bulk-episode-row input {
  max-width: none;
}

.icon-circle-btn.neutral {
  background: #8a96a3;
}

.icon-circle-btn.neutral:hover {
  background: #727d89;
}

.icon-circle-btn.small {
  width: 26px;
  height: 26px;
  font-size: 0.8rem;
}

.season-episodes {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f9fbfd;
  padding: 0.35rem 0.55rem 0.55rem;
}

.season-episodes-summary {
  cursor: pointer;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.season-episodes-summary small {
  color: var(--muted);
  font-weight: 500;
}

.season-episodes[open] .season-episodes-summary {
  margin-bottom: 0.45rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

.checkbox-inline input {
  width: auto;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: #fff;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.review-card .review-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.social-columns {
  display: grid;
  gap: 1rem;
}

.social-column {
  min-width: 0;
  display: grid;
  gap: 0.75rem;
}

.social-column h3 {
  margin: 0;
}

.social-feed {
  max-height: 430px;
  overflow-y: auto;
  padding-right: 0.35rem;
  align-content: start;
}

.social-more-button {
  justify-self: start;
}

.home-activity-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.32rem 0.62rem;
  border-radius: 9px;
  font-weight: 700;
  min-width: 96px;
}

.table-wrapper {
  overflow-x: auto;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.ranking-table th,
.ranking-table td {
  border: 1px solid var(--border);
  padding: 0.65rem;
  text-align: left;
  vertical-align: middle;
}

.ranking-table.compact th,
.ranking-table.compact td {
  padding: 0.4rem 0.55rem;
}

.ranking-table th {
  background: #a0a0a0;
  color: #fff;
  font-weight: 700;
}

.ranking-table td:nth-child(1),
.ranking-table td:nth-child(3),
.ranking-table td:nth-child(4),
.ranking-table td:nth-child(5) {
  text-align: center;
}

.ranking-table td.actions-cell {
  text-align: center;
}

.film-link {
  font-weight: 600;
}

.ta-note-badge {
  font-weight: 500;
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

/* pas encore de note */
.stade-neutre {
  background: rgba(147, 147, 147);
  color: white;
}

/* Note entre 0 et 0,5 */
.stade-0-5 {
  background: #f9766e;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 0,51 et 1 */
.stade-1 {
  background: #fa8271;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 1,01 et 1,5 */
.stade-1-5 {
  background: #f99072;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 1,51 et 2 */
.stade-2 {
  background: #fa9d74;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 2,01 et 2,5 */
.stade-2-5 {
  background: #fba977;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 2,51 et 3 */
.stade-3 {
  background: #fdb77c;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 3,01 et 3,5 */
.stade-3-5 {
  background: #fdc47d;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 3,51 et 4 */
.stade-4 {
  background: #fed082;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 4,01 et 4,5 */
.stade-4-5 {
  background: #ffde81;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 4,51 et 5 */
.stade-5 {
  background: #fdec82;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 5,01 et 5,5 */
.stade-5-5 {
  background: #f0e684;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 5,51 et 6 */
.stade-6 {
  background: #f0e684;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 6,01 et 6,5 */
.stade-6-5 {
  background: #d1de82;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 6,51 et 7 */
.stade-7 {
  background: #c2d981;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 7,01 et 7,5 */
.stade-7-5 {
  background: #b2d581;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 7,51 et 8 */
.stade-8 {
  background: #a3cf80;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 8,01 et 8,5 */
.stade-8-5 {
  background: #94ce81;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 8,51 et 9 */
.stade-9 {
  background: #83c77a;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 9,01 et 9,5 */
.stade-9-5 {
  background: #5ec47bd1;
  color: rgba(39, 39, 39, 0.81);
}

/* Note entre 9,51 et 10 */
.stade-10 {
  background: #5ec47b;
  color: rgba(39, 39, 39, 0.81);
}

@media (max-width: 700px) {
  .container {
    width: min(100% - 1.2rem, 1100px);
  }

  .films-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .film-card {
    padding: 0.75rem;
  }

  .film-card img {
    height: 230px;
  }

  .creation-tab {
    padding: 0.5rem 0.72rem;
    white-space: nowrap;
  }

  .creation-panel {
    padding: 0.85rem 0.75rem 0.75rem;
  }

  .film-hero {
    display: grid;
    gap: 1rem;
  }

  .film-hero-poster {
    max-width: 50%;
    display: block;
    margin-inline: auto;
  }

  .social-feed {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .home-activity-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 980px) {
  .film-hero {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.1rem;
    align-items: start;
  }

  .film-hero-poster {
    width: 100%;
    max-width: 300px;
    margin-left: auto;
  }

  .social-columns {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
