/* ==========================================================================
 * app-competitions.css v1.1.0 — Sprint M1.S2
 * Styles MonolithV3 dark/light auto pour module Competitions
 * ========================================================================== */

/* ── HUB & KPIs ─────────────────────────────────────────── */
.comp-hub {
  padding: 16px;
}

.comp-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.comp-kpi-card {
  background: var(--card-bg, #11161D);
  border-radius: 10px;
  padding: 18px 14px;
  text-align: center;
  border: 1px solid var(--border, #222A33);
  transition: transform 0.2s, border-color 0.2s;
}

.comp-kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--red, #B71C1C);
}

.comp-kpi-card.comp-kpi-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #B71C1C22 0%, #B71C1C11 100%);
  border: 2px solid var(--red, #B71C1C);
}

.comp-kpi-card.comp-kpi-cta:hover {
  background: linear-gradient(135deg, #B71C1C44 0%, #B71C1C22 100%);
}

.comp-kpi-icon {
  font-size: 22px;
  margin-bottom: 4px;
}

.comp-kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--gold, #C9A832);
  line-height: 1.2;
}

.comp-kpi-label {
  font-size: 11px;
  color: var(--text3, #6B7886);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ── FILTRES ─────────────────────────────────────────── */
.comp-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.comp-filter-select {
  background: var(--bg3, #1A2129);
  color: var(--text, #E8ECF0);
  border: 1px solid var(--border, #222A33);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.comp-filter-select:hover {
  border-color: var(--red, #B71C1C);
}

/* ── TABLE COMPETITIONS ─────────────────────────────────────────── */
.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.comp-table thead tr {
  background: var(--bg3, #1A2129);
}

.comp-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text3, #6B7886);
  font-weight: 700;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border, #222A33);
}

.comp-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border, #222A33);
  vertical-align: middle;
}

.comp-table tbody tr {
  transition: background 0.15s;
}

.comp-table tbody tr:hover {
  background: var(--bg3, #1A2129);
}

.comp-table tbody tr:last-child td {
  border-bottom: none;
}

/* ── WIZARD STEPPER ─────────────────────────────────────────── */
.comp-wizard {
  padding: 16px;
  max-width: 960px;
  margin: 0 auto;
}

.comp-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
}

.comp-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 90px;
}

.comp-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg3, #1A2129);
  color: var(--text3, #6B7886);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  border: 2px solid var(--border, #222A33);
  transition: all 0.2s;
}

.comp-step.active .comp-step-num {
  background: var(--red, #B71C1C);
  color: white;
  border-color: var(--red, #B71C1C);
  box-shadow: 0 0 0 4px rgba(183, 28, 28, 0.2);
}

.comp-step.done .comp-step-num {
  background: var(--ok, #3DAF6B);
  color: white;
  border-color: var(--ok, #3DAF6B);
}

.comp-step-label {
  font-size: 12px;
  color: var(--text3, #6B7886);
  font-weight: 600;
}

.comp-step.active .comp-step-label {
  color: var(--text, #E8ECF0);
}

.comp-step-line {
  flex: 0 0 60px;
  height: 2px;
  background: var(--border, #222A33);
  margin: 0 4px;
  transition: background 0.2s;
}

.comp-step-line.done {
  background: var(--ok, #3DAF6B);
}

/* ── WIZARD STEP 1 : TYPE CARDS ─────────────────────────────────────────── */
.comp-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.comp-type-card {
  background: var(--bg3, #1A2129);
  border: 2px solid var(--border, #222A33);
  border-radius: 10px;
  padding: 18px 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  text-align: left;
}

.comp-type-card:hover:not(.disabled) {
  border-color: var(--red, #B71C1C);
  transform: translateY(-2px);
}

.comp-type-card.selected {
  border-color: #C9A832 !important;
  border-width: 3px !important;
  background: linear-gradient(135deg, rgba(201, 168, 50, 0.15) 0%, rgba(201, 168, 50, 0.05) 100%) !important;
  box-shadow: 0 0 0 2px rgba(201, 168, 50, 0.3), 0 4px 12px rgba(201, 168, 50, 0.2);
  transform: translateY(-2px);
}

.comp-type-card.selected::before {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: #C9A832;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.comp-type-card.disabled {
  opacity: 0.6;
  /* Pas de cursor:not-allowed - on laisse cliquable pour permettre upgrade plan */
}

.comp-type-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

/* Branded format logos (PayDayz, Kumite FPK, Submit Or Loose) */
.comp-type-logo {
  width: 100%;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 8px;
  overflow: hidden;
}

.comp-type-logo img {
  max-height: 56px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 4px;
}

/* Card with brand logo : hauteur logo plus grande, autre padding */
.comp-type-card.has-brand {
  padding-top: 14px;
}

.comp-type-card.has-brand .comp-type-logo {
  /* Fond legerement different pour mettre le logo en valeur */
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  padding: 4px 8px;
  height: 64px;
}

.comp-type-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #E8ECF0);
  margin-bottom: 4px;
}

.comp-type-desc {
  font-size: 12px;
  color: var(--text3, #6B7886);
  line-height: 1.4;
  margin-bottom: 10px;
}

.comp-type-status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  background: var(--card-bg, #11161D);
  border-radius: 4px;
  display: inline-block;
}

/* ── WIZARD STEP 3 : CAT MODE ─────────────────────────────────────────── */
.comp-cat-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.comp-cat-mode {
  background: var(--bg3, #1A2129);
  border: 2px solid var(--border, #222A33);
  border-radius: 10px;
  padding: 18px 16px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.comp-cat-mode:hover {
  border-color: var(--red, #B71C1C);
  transform: translateY(-2px);
}

.comp-cat-mode.selected {
  border-color: #C9A832 !important;
  border-width: 3px !important;
  background: linear-gradient(135deg, rgba(201, 168, 50, 0.15) 0%, rgba(201, 168, 50, 0.05) 100%) !important;
  box-shadow: 0 0 0 2px rgba(201, 168, 50, 0.3), 0 4px 12px rgba(201, 168, 50, 0.2);
}

.comp-cat-mode-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.comp-cat-mode-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #E8ECF0);
  margin-bottom: 6px;
}

.comp-cat-mode-desc {
  font-size: 12px;
  color: var(--text3, #6B7886);
  line-height: 1.4;
}

/* ── COMP DETAIL ─────────────────────────────────────────── */
.comp-detail {
  padding: 16px;
}

.comp-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.comp-detail-section {
  background: var(--bg3, #1A2129);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--border, #222A33);
}

.comp-detail-section h4 {
  margin: 0 0 12px 0;
  color: var(--gold, #C9A832);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.comp-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border, #222A33);
  font-size: 13px;
}

.comp-detail-row:last-child {
  border-bottom: none;
}

.comp-detail-row span {
  color: var(--text3, #6B7886);
}

.comp-detail-row strong {
  color: var(--text, #E8ECF0);
}

/* ── INFO BOX ─────────────────────────────────────────── */
.comp-info-box {
  background: var(--bg3, #1A2129);
  border-left: 3px solid var(--blue-l, #4A90C8);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text3, #6B7886);
}

/* ── BUTTONS SMALL ─────────────────────────────────────────── */
.btn.btn-sm {
  padding: 5px 12px;
  font-size: 11px;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .comp-stepper {
    transform: scale(0.85);
  }
  .comp-step-line {
    flex: 0 0 30px;
  }
  .comp-detail-grid {
    grid-template-columns: 1fr;
  }
  .comp-table {
    font-size: 11px;
  }
  .comp-table th, .comp-table td {
    padding: 8px 6px;
  }
}

/* ── LIGHT THEME (data-theme="light") ─────────────────────────────────────────── */
html[data-theme="light"] .comp-kpi-card {
  background: #FFFFFF;
  border-color: #E0E5EA;
}
html[data-theme="light"] .comp-table thead tr {
  background: #F5F7FA;
}
html[data-theme="light"] .comp-type-card,
html[data-theme="light"] .comp-cat-mode,
html[data-theme="light"] .comp-detail-section {
  background: #FFFFFF;
  border-color: #E0E5EA;
}
html[data-theme="light"] .comp-step-num {
  background: #F5F7FA;
  border-color: #E0E5EA;
}

/* ==========================================================================
   M1.S3 — Page edition 6 tabs
   ========================================================================== */

.comp-edit-page {
  padding: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.comp-edit-header {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

.comp-edit-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border, #222A33);
  padding-bottom: 0;
}

.comp-edit-tab {
  background: transparent;
  border: 2px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text3, #6B7886);
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: -2px;
}

.comp-edit-tab:hover {
  color: var(--text, #E8ECF0);
  background: var(--bg3, #1A2129);
}

.comp-edit-tab.active {
  color: var(--gold, #C9A832);
  background: var(--card-bg, #11161D);
  border-color: var(--border, #222A33);
  border-bottom-color: var(--card-bg, #11161D);
}

.comp-edit-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comp-edit-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.comp-edit-field {
  display: flex;
  flex-direction: column;
}

.comp-edit-field > label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text3, #6B7886);
  margin-bottom: 5px;
}

.comp-edit-field .input,
.comp-edit-field input,
.comp-edit-field select,
.comp-edit-field textarea {
  width: 100%;
}

.comp-edit-hint {
  font-size: 11px;
  color: var(--text3, #6B7886);
  margin-top: 4px;
  font-style: italic;
}

.comp-edit-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text, #E8ECF0);
  cursor: pointer;
}

.comp-edit-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.comp-edit-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

@media (max-width: 768px) {
  .comp-edit-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  .comp-edit-tab {
    flex-shrink: 0;
    font-size: 12px;
    padding: 8px 12px;
  }
}

/* Light theme */
html[data-theme="light"] .comp-edit-tab.active {
  background: #FFFFFF;
  border-bottom-color: #FFFFFF;
}
html[data-theme="light"] .comp-edit-tab:hover {
  background: #F5F7FA;
}

/* ==========================================================================
   M1.S2 REFINEMENTS — Vue toggle + Cards-style stages + Liste cliquable
   ========================================================================== */

/* Toggle Cards/Liste */
.comp-view-toggle {
  display: inline-flex;
  background: var(--bg3, #1A2129);
  border: 1px solid var(--border, #222A33);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.comp-view-btn {
  background: transparent;
  border: none;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text3, #6B7886);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}

.comp-view-btn:hover {
  color: var(--text, #E8ECF0);
  background: var(--card-bg, #11161D);
}

.comp-view-btn.active {
  background: var(--card-bg, #11161D);
  color: var(--gold, #C9A832);
  border: 1px solid rgba(201,168,50,.3);
}

html[data-theme="light"] .comp-view-toggle {
  background: #F5F7FA;
  border-color: #E2E8F0;
}
html[data-theme="light"] .comp-view-btn.active {
  background: #FFFFFF;
}

/* Cards grid (style stages) */
.comp-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 16px;
}

.comp-card {
  background: var(--card-bg, #11161D);
  border: 1px solid var(--border, #222A33);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
  display: flex;
  flex-direction: column;
}

.comp-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  border-color: rgba(201,168,50,.4);
}

.comp-card-banner {
  width: 100%;
  height: 140px;
  position: relative;
  background: var(--bg3, #1A2129);
}

.comp-card-banner-default {
  background: linear-gradient(135deg, #B71C1C, #0D0D0D);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.comp-card-date-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,.85);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  text-align: center;
  min-width: 50px;
  border: 2px solid rgba(255,255,255,.1);
  z-index: 2;
}

.comp-card-day {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  color: var(--gold, #C9A832);
}

.comp-card-month {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.comp-card-logo {
  position: absolute;
  bottom: -20px;
  right: 16px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3px solid var(--card-bg, #11161D);
  background: #fff;
  object-fit: cover;
  z-index: 2;
}

.comp-card-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comp-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text, #E8ECF0);
  line-height: 1.3;
  margin-bottom: 4px;
}

.comp-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--text3, #6B7886);
}

html[data-theme="light"] .comp-card {
  background: #FFFFFF;
  border-color: #E2E8F0;
}
html[data-theme="light"] .comp-card-logo {
  border-color: #FFFFFF;
}

/* Liste cliquable */
.comp-table-clickable tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}

.comp-table-clickable tbody tr:hover {
  background: var(--bg3, #1A2129);
}

html[data-theme="light"] .comp-table-clickable tbody tr:hover {
  background: #F5F7FA;
}

/* Mobile cards */
@media (max-width: 640px) {
  .comp-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }
}
