/* ═══════════════════════════════════════════════════════
   SEMEUSE NATATION — BASE CSS
   CSS global partagé par tous les templates du site
   ═══════════════════════════════════════════════════════ */

/* ── THEMES ── */
:root,
[data-theme="dark"] {
  --rouge: #C8102E;
  --rouge-fonce: #A00D24;
  --rouge-clair: #E8304A;

  --bg-body: #F5F5F5;
  --bg-surface: #FFFFFF;
  --bg-navbar: #1A1A1A;
  --bg-footer: #1A1A1A;
  --bg-hero: #2D2D2D;
  --bg-input: #F5F5F5;
  --bg-row-alt: #F5F5F5;
  --bg-row-hover: #fde8ec;
  --bg-thead: #1A1A1A;

  --text-primary: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-navbar: #FFFFFF;
  --text-footer: #D4D4D4;
  --text-thead: #FFFFFF;
  --text-hero: #FFFFFF;
  --text-hero-sub: #D4D4D4;

  --border: #D4D4D4;
  --border-dark: #3A3A3A;
}

[data-theme="light"] {
  --bg-body: #F0F2F5;
  --bg-surface: #FFFFFF;
  --bg-navbar: #FFFFFF;
  --bg-footer: #1A1A1A;
  --bg-hero: #FFFFFF;
  --bg-input: #F5F5F5;
  --bg-row-alt: #FAFAFA;
  --bg-row-hover: #FDE8EC;
  --bg-thead: #1A1A1A;

  --text-primary: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-navbar: #1A1A1A;
  --text-footer: #D4D4D4;
  --text-thead: #FFFFFF;
  --text-hero: #1A1A1A;
  --text-hero-sub: #6B6B6B;

  --border: #E0E0E0;
  --border-dark: #CCCCCC;
}

/* ── RESET ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.2s, color 0.2s;
}

/* ── NAVBAR ── */
.navbar {
  background: var(--bg-navbar);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  border-bottom: 3px solid var(--rouge);
  position: relative;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.navbar-logo {
  width: 40px;
  height: 40px;
  background: var(--rouge);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.navbar-title {
  color: var(--text-navbar);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.2;
}

.navbar-subtitle {
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.navbar-nav {
  display: flex;
  gap: 0;
  list-style: none;
}

.navbar-nav a {
  display: block;
  padding: 0 1.2rem;
  height: 64px;
  line-height: 64px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.2s, background 0.2s;
}

.navbar-nav a:hover {
  color: var(--text-navbar);
  background: var(--border-dark);
}

.navbar-nav a.active {
  color: var(--text-navbar);
  border-bottom: 3px solid var(--rouge);
}

/* ── NAVBAR DROITE (icone user) ── */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-menu-wrapper {
  position: relative;
}

.user-icon-btn {
  width: 38px;
  height: 38px;
  border: 2px solid var(--border-dark);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-navbar);
  transition: border-color 0.2s, background 0.2s;
}

.user-icon-btn:hover {
  border-color: var(--rouge);
  background: rgba(200, 16, 46, 0.1);
}

.user-icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--rouge);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 200;
}

.user-dropdown.open {
  display: block;
}

.user-dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.user-dropdown-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.user-dropdown-email {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown a,
.user-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-primary);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
  background: var(--bg-row-alt);
}

.user-dropdown a svg,
.user-dropdown button svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.user-dropdown .dropdown-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.user-dropdown .dropdown-section-label {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--rouge);
}

.user-dropdown .logout-btn {
  color: var(--rouge);
}

.user-dropdown .logout-btn svg {
  stroke: var(--rouge);
}

/* ── HERO ── */
.hero {
  background: var(--bg-hero);
  color: var(--text-hero);
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 100%;
  background: var(--rouge);
}

.hero::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 6px;
  height: 100%;
  background: var(--rouge);
}

.hero-saison {
  display: inline-block;
  background: var(--rouge);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 4px 16px;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  line-height: 1.1;
}

.hero p {
  margin-top: 1rem;
  font-size: 1.1rem;
  color: var(--text-hero-sub);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ── MAIN ── */
.main-container {
  max-width: 1200px;
  margin: 2.5rem auto;
  padding: 0 2rem;
  flex: 1;
  width: 100%;
}

/* ── SECTION TITLE ── */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--rouge);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title span.accent {
  color: var(--rouge);
}

/* ── CARDS ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--rouge);
  padding: 1.5rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.card-meta {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

.card-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.badge-rouge {
  background: var(--rouge);
  color: #fff;
}

.badge-noir {
  background: #1A1A1A;
  color: #fff;
}

.badge-gris {
  background: var(--border);
  color: var(--text-primary);
}

/* ── BOUTONS ── */
.btn {
  display: inline-block;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background 0.2s, color 0.2s;
}

.btn-primary {
  background: var(--rouge);
  color: #fff;
  border-color: var(--rouge);
}

.btn-primary:hover {
  background: var(--rouge-fonce);
  border-color: var(--rouge-fonce);
}

.btn-secondary {
  background: transparent;
  color: var(--rouge);
  border-color: var(--rouge);
}

.btn-secondary:hover {
  background: var(--rouge);
  color: #fff;
}

.btn-dark {
  background: #1A1A1A;
  color: #fff;
  border-color: #1A1A1A;
}

.btn-dark:hover {
  background: #3A3A3A;
}

/* ── TABLE ── */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 2rem;
}

table.semeuse-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.semeuse-table thead {
  background: var(--bg-thead);
  color: var(--text-thead);
}

.semeuse-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.semeuse-table tbody tr:nth-child(even) {
  background: var(--bg-row-alt);
}

.semeuse-table tbody tr:hover {
  background: var(--bg-row-hover);
}

.semeuse-table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.semeuse-table tbody tr:first-child td {
  border-top: 3px solid var(--rouge);
}

/* ── ALERTS ── */
.alert {
  padding: 12px 16px;
  font-size: 14px;
  border-left: 4px solid;
  margin-bottom: 1.5rem;
}

.alert-info {
  background: #f0f4ff;
  border-color: #4a6cf7;
  color: #1e3a8a;
}

.alert-success {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #14532d;
}

.alert-warning {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #78350f;
}

.alert-danger {
  background: #fff1f2;
  border-color: var(--rouge);
  color: var(--rouge-fonce);
}

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--rouge);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  color: var(--border);
}

/* ── FOOTER ── */
footer {
  background: var(--bg-footer);
  color: var(--text-footer);
  padding: 2rem;
  border-top: 3px solid var(--rouge);
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

footer h4 {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--rouge);
  display: inline-block;
}

footer ul {
  list-style: none;
}

footer ul li {
  margin-bottom: 6px;
}

footer ul li a {
  color: var(--text-footer);
  text-decoration: none;
  font-size: 13px;
}

footer ul li a:hover {
  color: var(--rouge-clair);
}

.footer-bottom {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid #3A3A3A;
  font-size: 12px;
  color: #6B6B6B;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── MESSAGES DJANGO ── */
.messages {
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
}

.messages li {
  padding: 10px 16px;
  margin-bottom: 8px;
  border-left: 4px solid;
  font-size: 14px;
}

.messages .debug {
  background: #f5f5f5;
  border-color: #aaa;
}

.messages .info {
  background: #f0f4ff;
  border-color: #4a6cf7;
  color: #1e3a8a;
}

.messages .success {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #14532d;
}

.messages .warning {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #78350f;
}

.messages .error {
  background: #fff1f2;
  border-color: var(--rouge);
  color: var(--rouge-fonce);
}

/* ── BARRE DE RECHERCHE ── */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 220px;
  padding: 7px 36px 7px 16px;
  border: 1.5px solid var(--border-dark);
  border-radius: 99px;
  background: transparent;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-size: 13px;
  outline: none;
  transition: width 0.3s ease, border-color 0.2s, background 0.2s;
  caret-color: #ffffff;
}

/* Neutralise l'autofill Chrome qui écrase la couleur */
.search-input:-webkit-autofill,
.search-input:-webkit-autofill:hover,
.search-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #ffffff !important;
  -webkit-box-shadow: 0 0 0 1000px #1a1a1a inset !important;
  box-shadow: 0 0 0 1000px #1a1a1a inset !important;
  caret-color: #ffffff;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
  -webkit-text-fill-color: rgba(255, 255, 255, 0.45);
}

.search-input:focus {
  width: 280px;
  border-color: var(--rouge);
  background: rgba(255, 255, 255, 0.05);
}

.search-icon {
  position: absolute;
  right: 12px;
  pointer-events: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

.search-icon svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #242424;
  border: 1px solid #3a3a3a;
  border-top: 3px solid var(--rouge);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 300;
  max-height: 320px;
  overflow-y: auto;
  border-radius: 0 0 8px 8px;
}

.search-results.open {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: #ffffff;
  transition: background 0.15s;
  border-bottom: 1px solid #3a3a3a;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.search-result-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--rouge);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.search-result-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
}

.search-result-role {
  font-size: 11px;
  color: #aaaaaa;
  margin-top: 1px;
}

.search-result-empty,
.search-result-loading {
  padding: 16px 14px;
  font-size: 13px;
  color: #aaaaaa;
  text-align: center;
}

/* ── BURGER ── */
.burger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-navbar);
  padding: 8px;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

.burger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}

.burger-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger-btn.open span:nth-child(2) {
  opacity: 0;
}

.burger-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .search-wrapper {
    display: none;
  }

  .navbar {
    padding: 0 1rem;
  }

  .navbar-nav {
    display: none;
    position: absolute;
    top: 67px;
    left: 0;
    right: 0;
    background: var(--bg-navbar);
    border-bottom: 3px solid var(--rouge);
    flex-direction: column;
    z-index: 99;
  }

  .navbar-nav.open {
    display: flex;
  }

  .navbar-nav a {
    height: auto;
    line-height: 1;
    padding: 14px 1.5rem;
    border-bottom: 1px solid var(--border-dark);
  }

  .navbar-nav a.active {
    border-bottom: 1px solid var(--border-dark);
    border-left: 3px solid var(--rouge);
  }

  .burger-btn {
    display: flex;
  }

  .user-dropdown {
    position: fixed;
    top: 67px;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0;
  }

  .hero {
    padding: 2rem 1rem;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .hero::before,
  .hero::after {
    width: 4px;
  }

  .main-container {
    padding: 0 1rem;
    margin: 1.5rem auto;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .table-wrapper {
    margin: 0 -1rem 2rem;
    padding: 0 1rem;
  }

  .semeuse-table {
    font-size: 13px;
  }

  .semeuse-table thead th {
    padding: 10px 12px;
    font-size: 10px;
  }

  .semeuse-table tbody td {
    padding: 8px 12px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  footer {
    padding: 1.5rem 1rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .navbar-title {
    font-size: 14px;
  }

  .navbar-subtitle {
    display: none;
  }

  .navbar-logo {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  .hero h1 {
    font-size: 1.35rem;
  }

  .card {
    padding: 1.25rem;
  }
}
