/* ==========================================================================
   EVENT STUDIO (TOURNAMENT DIRECTOR & ORGANIZER SUITE) STYLES
   ========================================================================== */

.es-body {
  background-color: #0b0f17;
  color: #f1f5f9;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.es-app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem 1.5rem;
}

/* Header */
.es-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: rgba(18, 24, 38, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.es-header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.es-back-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.15s ease;
}
.es-back-link:hover {
  color: var(--accent);
}

.es-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.es-brand-badge {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.es-brand-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
}

.es-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.es-auth-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.76rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.es-btn-primary {
  background: var(--accent);
  color: #090d16;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.es-btn-primary:hover {
  opacity: 0.9;
}

.es-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.es-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.es-btn-accent {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.es-btn-accent:hover {
  background: #38bdf8;
  color: #090d16;
}

/* Nav Tabs */
.es-nav-bar {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.es-nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.es-nav-tab.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Active Tournament Banner */
.es-current-event-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.es-ce-tag {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.es-ce-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.4rem 0;
}

.es-ce-meta {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.es-status-chip {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
}

.es-ce-actions {
  display: flex;
  gap: 0.6rem;
}

/* Sections */
.es-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.es-section-header h3 {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.es-sec-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.es-header-actions {
  display: flex;
  gap: 0.5rem;
}

/* Form Card */
.es-form-card {
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 800px;
}

.es-form-header {
  margin-bottom: 1.25rem;
}

.es-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Round Control Ribbon */
.es-round-control-ribbon {
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.es-rc-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.es-round-badge {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-right: 0.5rem;
}

.es-round-switch-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
}

.es-round-switch-btn.active {
  background: #38bdf8;
  color: #090d16;
}

.es-rc-timer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.es-timer-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: #38bdf8;
}

.es-timer-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.es-rc-right {
  display: flex;
  gap: 0.5rem;
}

/* Pairings Deck */
.es-pairings-deck {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1rem;
}

.es-pairing-card {
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.es-pairing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.5rem;
}

.es-table-label {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #38bdf8;
}

.es-pairing-matchup {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.es-competitor {
  flex: 1;
}

.es-comp-name {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.es-comp-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.es-pairing-vs {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.es-pairing-score-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
}

.es-match-status-badge {
  font-size: 0.76rem;
  font-weight: 700;
}

/* Score Modal Grid */
.es-matchup-score-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
  padding: 1rem 0;
}

.es-vs-tag {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-muted);
}


/* ==========================================================================
   MODAL BACKDROP & OVERLAY STYLES
   ========================================================================== */
.modal {
  display: none !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  box-sizing: border-box;
}

.modal.active {
  display: flex !important;
}

.modal-content {
  background: #111722;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  max-height: 70vh;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

/* Score Entry Method Selector */
.es-score-method-tabs {
  display: flex;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.25rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.es-sm-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.es-sm-tab.active {
  background: #38bdf8;
  color: #090d16;
}

/* Scorecard Modal */
.es-sc-hero {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.es-sc-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0.2rem 0;
}

.es-sc-score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.2rem;
  font-weight: 700;
  color: #38bdf8;
}

.es-sc-table-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.es-sc-player-col {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem;
}

.es-sc-p-name {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}

.es-sc-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.es-sc-stat-row:last-child {
  border-bottom: none;
  font-weight: 700;
  color: #38bdf8;
}

.es-source-chip {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  margin-top: 0.5rem;
}

/* Sub-Tab Navigation */
.es-subtab-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.es-subtab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.es-subtab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  font-weight: 700;
}

.es-match-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
