/* ============================================================
   CLUBE DOS REFERIDOS — CSS GLOBAL
   Variáveis, Reset, Tipografia, Componentes Reutilizáveis
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Orbitron:wght@400;700;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Cores */
  --bg-primary:       #0A0A0A;
  --bg-secondary:     #111111;
  --bg-card:          #1A1A1A;
  --bg-card-hover:    #222222;
  --accent:           #00E5FF;
  --accent-dim:       rgba(0, 229, 255, 0.15);
  --accent-glow:      rgba(0, 229, 255, 0.4);
  --text-primary:     #FFFFFF;
  --text-secondary:   #9CA3AF;
  --text-muted:       #6B7280;
  --border:           rgba(0, 229, 255, 0.2);
  --border-subtle:    rgba(255, 255, 255, 0.06);
  --danger:           #FF4D6A;
  --success:          #00E5A0;
  --warning:          #FFB800;

  /* Tipografia */
  --font-display:   'Bebas Neue', 'Orbitron', sans-serif;
  --font-alt:       'Orbitron', sans-serif;
  --font-body:      'DM Sans', system-ui, sans-serif;

  /* Espaçamentos */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4rem;

  /* Bordas */
  --radius-sm:  0.375rem;
  --radius-md:  0.5rem;
  --radius-lg:  0.75rem;
  --radius-xl:  1rem;

  /* Transições */
  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;

  /* Sombras */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(0, 229, 255, 0.25);
  --shadow-glow-strong: 0 0 40px rgba(0, 229, 255, 0.5);

  /* Sidebar width */
  --sidebar-width: 260px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: #fff;
}

button, input, textarea, select {
  font-family: inherit;
}

ul, ol {
  list-style: none;
}

/* --- Tipografia --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.2rem; }

p {
  color: var(--text-secondary);
  line-height: 1.75;
}

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

/* --- Layout Base (App com Sidebar) --- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-slow);
  overflow-y: auto;
}

.sidebar-logo {
  padding: var(--space-xl) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: #000;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  line-height: 1.3;
}

.sidebar-logo .logo-text span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-lg) 0;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--space-md) var(--space-lg) var(--space-sm);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.65rem var(--space-lg);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--transition);
  position: relative;
}

.sidebar-nav a:hover {
  color: var(--text-primary);
  background: var(--accent-dim);
  border-left-color: var(--accent);
}

.sidebar-nav a.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
}

.sidebar-nav a .nav-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent);
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.7rem;
  color: var(--accent);
}

/* --- Main Content --- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
}

.page-header {
  padding: var(--space-2xl) var(--space-2xl) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

.page-header h1 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.page-header p {
  margin-top: var(--space-xs);
  font-size: 0.95rem;
}

.page-body {
  padding: var(--space-2xl);
}

/* --- Mobile Header --- */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  z-index: 200;
}

.mobile-logo {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.menu-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: var(--space-xs);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 99;
}

/* --- Botões --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.3);
}

.btn-primary:hover {
  background: #fff;
  color: #000;
  box-shadow: var(--shadow-glow-strong);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent-dim);
  box-shadow: var(--shadow-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border);
  background: var(--bg-card);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(255, 77, 106, 0.3);
  width: 100%;
}

.btn-danger:hover {
  background: rgba(255, 77, 106, 0.1);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.9rem 2rem;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.card-body {
  padding: var(--space-lg);
}

/* --- Grid --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); }

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 2rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-accent {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--border);
}

.badge-success {
  background: rgba(0, 229, 160, 0.1);
  color: var(--success);
}

.badge-warning {
  background: rgba(255, 184, 0, 0.1);
  color: var(--warning);
}

/* --- Formulários --- */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

.form-control {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}

.form-control::placeholder {
  color: var(--text-muted);
}

/* --- Divider --- */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-xl) 0;
}

/* --- Alert / Feedback --- */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
  display: none;
}

.alert.show {
  display: block;
}

.alert-error {
  background: rgba(255, 77, 106, 0.1);
  border: 1px solid rgba(255, 77, 106, 0.3);
  color: #FF6B84;
}

.alert-success {
  background: rgba(0, 229, 160, 0.1);
  border: 1px solid rgba(0, 229, 160, 0.3);
  color: var(--success);
}

.alert-warning {
  background: rgba(255, 180, 0, 0.1);
  border: 1px solid rgba(255, 180, 0, 0.35);
  color: #FFB400;
}

/* --- Loading Spinner --- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.spinner-light {
  border-color: rgba(255,255,255,0.2);
  border-top-color: var(--accent);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Glitch/Neon decorações --- */
.neon-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: var(--space-xl) 0;
}

.glow-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent);
  display: inline-block;
}

/* --- Section titles --- */
.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.section-title h2 {
  font-size: 1.6rem;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.4;
}

/* --- Lightbox --- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.8rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.lightbox-close:hover {
  opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.show {
    display: block;
  }

  .mobile-header {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    padding-top: 60px;
  }

  .page-header {
    padding: var(--space-xl) var(--space-lg) var(--space-md);
  }

  .page-body {
    padding: var(--space-lg);
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .page-body {
    padding: var(--space-md);
  }
}
