/* =========================================================
   event.css — Multi-Tournament & Event Management System
   My Sport Club · High-Energy Dark Glassmorphic Design
   ========================================================= */

:root {
  --bg-main: #070a12;
  --bg-surface: #0e1424;
  --bg-surface-elevated: #141d33;
  --bg-card: rgba(20, 29, 51, 0.7);
  --bg-card-hover: rgba(26, 38, 66, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(132, 204, 22, 0.5);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --accent-lime: #84cc16;
  --accent-lime-light: #bef264;
  --accent-lime-glow: rgba(132, 204, 22, 0.25);

  --accent-cyan: #38bdf8;
  --accent-orange: #f97316;
  --accent-red: #ef4444;
  --accent-green: #22c55e;
  --accent-purple: #a855f7;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  --shadow-glow: 0 0 25px rgba(132, 204, 22, 0.2);
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Background Ambient Glows */
body::before {
  content: '';
  position: fixed;
  top: -150px;
  left: 10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(132, 204, 22, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -150px;
  right: 5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.06) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

/* =========================================================
   NAVIGATION BAR
   ========================================================= */
.ev-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 10, 18, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  height: 68px;
  display: flex;
  align-items: center;
}

.ev-nav__inner {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ev-nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.ev-nav__logo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-lime);
  box-shadow: 0 0 10px var(--accent-lime);
  animation: pulse-dot 2.5s infinite;
}

.ev-nav__links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.ev-nav__link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.ev-nav__link:hover, .ev-nav__link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.ev-nav__auth {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* User Profile Badge in Nav */
.ev-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface-elevated);
  padding: 5px 12px 5px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition);
}

.ev-user-badge:hover {
  border-color: var(--accent-lime);
}

.ev-user-badge__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #1e293b;
  border: 1.5px solid var(--accent-lime);
}

.ev-user-badge__name {
  font-size: 0.88rem;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ev-user-badge__role {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(132, 204, 22, 0.15);
  color: var(--accent-lime);
  padding: 2px 6px;
  border-radius: 4px;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.ev-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.ev-btn--lime {
  background: var(--accent-lime);
  color: #090d16;
  box-shadow: 0 4px 15px rgba(132, 204, 22, 0.3);
}

.ev-btn--lime:hover {
  background: var(--accent-lime-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(132, 204, 22, 0.45);
}

.ev-btn--outline {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.ev-btn--outline:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.ev-btn--danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.ev-btn--danger:hover {
  background: #ef4444;
  color: #fff;
}

.ev-btn--sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.ev-btn--lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.ev-btn--full {
  width: 100%;
}

/* =========================================================
   HERO SECTION
   ========================================================= */
.ev-hero {
  position: relative;
  padding: 60px 20px 40px;
  text-align: center;
  max-width: 960px;
  margin: 0 auto;
  z-index: 1;
}

.ev-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(132, 204, 22, 0.1);
  border: 1px solid rgba(132, 204, 22, 0.3);
  color: var(--accent-lime);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.ev-hero__title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 18px;
}

.ev-hero__subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 30px;
}

.ev-hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* =========================================================
   CONTAINER & SECTION CONTROLS
   ========================================================= */
.ev-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px 80px;
  position: relative;
  z-index: 1;
}

.ev-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.ev-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.ev-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.ev-tab.is-active {
  background: var(--bg-surface-elevated);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* =========================================================
   TOURNAMENT CARDS GRID
   ========================================================= */
.ev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 28px;
}

.ev-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
}

.ev-card:hover {
  transform: translateY(-4px);
  border-color: rgba(132, 204, 22, 0.4);
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.6), 0 0 20px rgba(132, 204, 22, 0.15);
}

.ev-card__banner {
  height: 150px;
  position: relative;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ev-card__banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
  transition: var(--transition);
}

.ev-card:hover .ev-card__banner-img {
  transform: scale(1.05);
  opacity: 0.6;
}

.ev-card__status-chip {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ev-card__status-chip--upcoming {
  color: var(--accent-lime);
  border-color: rgba(132, 204, 22, 0.4);
}

.ev-card__status-chip--ongoing {
  color: #fff;
  background: rgba(239, 68, 68, 0.85);
  animation: pulse-badge 2s infinite;
}

.ev-card__status-chip--completed {
  color: var(--text-muted);
}

.ev-card__sport-badge {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ev-sport-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: -3px;
  object-fit: contain;
}

.ev-card__body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ev-card__title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: #fff;
}

.ev-card__subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.ev-card__meta-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  flex: 1;
}

.ev-card__meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.ev-card__meta-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-lime);
  flex-shrink: 0;
  text-align: center;
}

.ev-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.ev-tag {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

.ev-tag--highlight {
  background: rgba(132, 204, 22, 0.15);
  color: var(--accent-lime-light);
}

.ev-card__progress-wrap {
  margin-bottom: 18px;
}

.ev-card__progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.ev-card__progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.ev-card__progress-fill {
  height: 100%;
  background: var(--accent-lime);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.ev-card__foot {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ev-card__admin-del {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(239, 68, 68, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  color: #fff;
  width: 32px;
  height: 32px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  transition: var(--transition);
}

.ev-card__admin-del:hover {
  background: #dc2626;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.5);
}

/* =========================================================
   MODALS (Auth, Create Tournament, Settings)
   ========================================================= */
.ev-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.ev-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.ev-modal {
  background: #0e1526;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  transform: scale(0.95);
  transition: var(--transition);
}

.ev-modal--wide {
  max-width: 760px;
}

.ev-modal-backdrop.is-open .ev-modal {
  transform: scale(1);
}

.ev-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border-subtle);
}

.ev-modal__title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}

.ev-modal__close {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

.ev-modal__close:hover {
  color: #fff;
}

.ev-modal__body {
  padding: 28px;
}

/* Forms */
.ev-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ev-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ev-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ev-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ev-label small {
  color: var(--text-subtle);
  font-weight: normal;
}

.ev-input, .ev-select, .ev-textarea {
  width: 100%;
  background: #141c30;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: #fff;
  transition: var(--transition);
  outline: none;
}

.ev-input:focus, .ev-select:focus, .ev-textarea:focus {
  border-color: var(--accent-lime);
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.2);
}

.ev-input::placeholder, .ev-textarea::placeholder {
  color: var(--text-subtle);
}

/* Avatar Upload Circle */
.ev-avatar-uploader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.ev-avatar-preview-wrap {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px dashed var(--accent-lime);
  padding: 3px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  background: #141c30;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ev-avatar-preview-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.ev-avatar-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.72rem;
  color: var(--accent-lime);
  font-weight: 600;
}

/* Toast Alerts */
.ev-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  padding: 14px 22px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  font-size: 0.92rem;
  font-weight: 600;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
}

.ev-toast.is-show {
  transform: translateY(0);
  opacity: 1;
}

.ev-toast--success {
  border-color: var(--accent-lime);
  color: #fff;
}

.ev-toast--error {
  border-color: var(--accent-red);
  color: #fca5a5;
}

/* Animations */
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@media (max-width: 768px) {
  .ev-grid {
    grid-template-columns: 1fr;
  }
  .ev-form-row {
    grid-template-columns: 1fr;
  }
  .ev-nav__links {
    display: none;
  }
}

/* Athlete Rating & Doubles Pairing System */
.ev-rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #facc15;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.pairing-team-card {
  background: rgba(20, 29, 51, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: var(--transition);
}

.pairing-team-card:hover {
  border-color: rgba(132, 204, 22, 0.4);
  background: rgba(26, 38, 66, 0.7);
}

.pairing-team-card__slots {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
}

.pairing-ath-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 20, 36, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

.pairing-mode-btn.is-active {
  background: var(--accent-lime) !important;
  color: #070a12 !important;
  font-weight: 800 !important;
  border-color: var(--accent-lime) !important;
  box-shadow: var(--shadow-glow);
}

/* Modal Shake feedback when clicking backdrop */
@keyframes modalShake {
  0%, 100% { transform: scale(1); }
  20% { transform: scale(1.025); }
  40% { transform: scale(0.985); }
  60% { transform: scale(1.015); }
  80% { transform: scale(0.995); }
}

.modal-shake {
  animation: modalShake 0.35s ease-in-out !important;
}

