/* Professional Tournament Page Styles */
:root {
  --tournament-topbar-height: 64px;
}

/* ==================== TOURNAMENT TOPBAR ==================== */
.tournament-topbar {
  position: fixed;
  top: var(--navbar-height, 60px);
  left: 0;
  right: 0;
  height: var(--tournament-topbar-height);
  z-index: 1030;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  transition: left 200ms ease, width 200ms ease, top 200ms ease;
}

/* Desktop: below main header */
@media (min-width: 768px) {
  .tournament-topbar {
    top: var(--navbar-height, 70px);
    z-index: 1045;
  }
}

/* Push tournament topbar when sidebar is open on desktop */
@media (min-width: 768px) {
  .tournament-topbar {
    left: var(--sidebar-width, 260px);
    width: calc(100% - var(--sidebar-width, 260px));
  }

  body.core-sidebar-collapsed .tournament-topbar {
    left: 0;
    width: 100%;
  }
}

.tournament-topbar .container-fluid {
  height: 100%;
  padding: 0 1.5rem;
}

.topbar-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* Tournament meta */
.topbar-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex-shrink: 1;
}

.topbar-meta .meta-name {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-meta .meta-date {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.topbar-meta .meta-date i {
  font-size: 0.75rem;
  margin-right: 4px;
}

/* Navigation buttons */
.topbar-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.topbar-btn i {
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

.topbar-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-color: var(--border-medium);
}

.topbar-btn:hover i {
  color: var(--accent-red);
}

.topbar-btn.active {
  background: rgba(220, 38, 38, 0.1);
  color: var(--text-primary);
  border-color: rgba(220, 38, 38, 0.3);
}

.topbar-btn.active i {
  color: var(--accent-red);
}

.tournament-topbar-spacer {
  height: var(--tournament-topbar-height);
}

/* ==================== HERO SECTION ==================== */
.karate-hero {
  position: relative;
  min-height: 45vh;
  overflow: hidden;
  margin-top: var(--tournament-topbar-height);
  background: linear-gradient(135deg,
    rgba(220, 38, 38, 0.05) 0%,
    transparent 50%,
    rgba(251, 191, 36, 0.03) 100%
  ), var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  filter: brightness(0.3) saturate(0.8);
  z-index: 0;
}

.hero-bg.fallback {
  background: var(--bg-secondary);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.6) 100%
  );
}

.hero-inner {
  position: relative;
  z-index: 2;
}

/* Hero typography */
.display-4 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.lead {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ==================== BUTTONS ==================== */
.btn-glow,
.btn-accent {
  background: var(--accent-red);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-glow:hover,
.btn-accent:hover {
  background: var(--accent-red-hover);
  transform: translateY(-2px);
  color: white;
}

.btn-glow:active,
.btn-accent:active {
  transform: translateY(0);
}

/* ==================== CARDS ==================== */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: var(--border-medium);
}

.card-body {
  padding: 1.5rem;
}

/* Registration card */
.reg-facts-layout {
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
}

.registration-pane {
  flex: 1 1 0;
  min-width: 280px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.reg-gradient {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg,
    rgba(220, 38, 38, 0.05),
    rgba(251, 191, 36, 0.03)
  );
}

.registration-pane > .position-relative {
  z-index: 2;
}

/* ==================== TATAMI CARDS ==================== */
.border-accent {
  border-left-color: var(--accent-red) !important;
  border-left-width: 3px !important;
}

.text-accent {
  color: var(--accent-red) !important;
  font-weight: 600;
}

.text-gold {
  color: #FBBF24;
}

.text-silver {
  color: #C0C0C0;
}

.text-bronze {
  color: #CD7F32;
}

/* ==================== BADGES ==================== */
.badge {
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: -0.01em;
}

.badge.bg-success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22C55E;
}

.badge.bg-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #EF4444;
}

.badge.bg-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* ==================== TYPOGRAPHY ==================== */
.section-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

h3.h5 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.text-muted {
  color: var(--text-muted) !important;
}

.text-body {
  color: var(--text-primary) !important;
}

/* ==================== BUTTONS (Additional) ==================== */
.btn-outline-secondary {
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  background: transparent;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.15s ease;
  padding: 0.65rem 1.25rem;
}

.btn-outline-secondary:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.btn-outline-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 991px) {
  .reg-facts-layout {
    flex-direction: column;
  }

  .tournament-topbar {
    left: 0 !important;
    width: 100% !important;
  }

  .display-4 {
    font-size: 2rem;
  }

  .topbar-btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 767px) {
  .tournament-topbar .container-fluid {
    padding: 0 1rem;
  }

  .topbar-content {
    gap: 1rem;
  }

  /* Hide tournament meta on mobile */
  .topbar-meta {
    display: none;
  }

  .topbar-buttons {
    flex: 1;
    justify-content: center;
  }

  .topbar-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    gap: 4px;
  }

  .topbar-btn i {
    font-size: 0.85rem;
  }

  .btn-glow,
  .btn-accent {
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
  }

  .card-body {
    padding: 1.25rem;
  }

  .karate-hero {
    min-height: 35vh;
  }
}

@media (max-width: 575px) {
  .topbar-btn {
    padding: 0.5rem 0.65rem;
    font-size: 0.75rem;
  }

  .topbar-btn i {
    display: none;
  }

  .topbar-buttons {
    gap: 4px;
  }

  .card-body {
    padding: 1rem;
  }
}

/* ==================== SMOOTH ANIMATIONS ==================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
