/**
 * AnotherViewConfig - Apple Clean Style Design System (Light Edition)
 * Inspired by macOS Sonoma Light, Apple Developer & Cupertino Guidelines
 * Strictly NO EMOJIS - Apple SF-Style SVG Vector Icons Only
 */

:root {
  --bg-base: #f5f5f7;
  --bg-surface: #ffffff;
  --bg-subtle: #fbfbfd;
  --bg-sidebar: #f2f2f6;
  --bg-sidebar-active: #ffffff;
  --bg-hover: rgba(0, 0, 0, 0.04);
  
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.05);
  --border-focus: #0071e3;
  
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-muted: #a1a1a6;
  
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-blue-subtle: rgba(0, 113, 227, 0.08);
  
  --apple-green: #34c759;
  --apple-green-bg: rgba(52, 199, 89, 0.12);
  --apple-orange: #ff9500;
  --apple-orange-bg: rgba(255, 149, 0, 0.12);
  --apple-red: #ff3b30;
  --apple-red-bg: rgba(255, 59, 48, 0.1);
  
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;
  
  --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.04), 0 0 1px rgba(0, 0, 0, 0.08);
  --shadow-float: 0 16px 36px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
}

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

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-system);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  letter-spacing: -0.012em;
}

/* Scrollbar Minimalista Apple */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Tipografia */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Botões Apple Clean */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--apple-blue);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 113, 227, 0.3);
}

.btn-primary:hover {
  background-color: var(--apple-blue-hover);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-subtle);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: rgba(0, 0, 0, 0.14);
}

.btn-danger {
  background: var(--apple-red-bg);
  color: var(--apple-red);
  border: 1px solid rgba(255, 59, 48, 0.2);
}

.btn-danger:hover {
  background: rgba(255, 59, 48, 0.18);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Formulários */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  box-shadow: var(--shadow-subtle);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

/* Badges de Status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.74rem;
  font-weight: 500;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-success {
  background: var(--apple-green-bg);
  color: #1e8739;
  border: 1px solid rgba(52, 199, 89, 0.3);
}
.badge-success .badge-dot { background: var(--apple-green); }

.badge-info {
  background: var(--apple-blue-subtle);
  color: var(--apple-blue);
  border: 1px solid rgba(0, 113, 227, 0.2);
}
.badge-info .badge-dot { background: var(--apple-blue); }

.badge-warning {
  background: var(--apple-orange-bg);
  color: #c76a00;
  border: 1px solid rgba(255, 149, 0, 0.3);
}
.badge-warning .badge-dot { background: var(--apple-orange); }

.badge-error {
  background: var(--apple-red-bg);
  color: var(--apple-red);
  border: 1px solid rgba(255, 59, 48, 0.25);
}
.badge-error .badge-dot { background: var(--apple-red); }

/* Layout Geral: App Shell com Sidebar */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Estilo macOS Light */
.sidebar {
  width: 256px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sidebar-tag {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.sidebar-nav {
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: #48484a;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.sidebar-link svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.sidebar-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-link:hover svg {
  color: var(--text-primary);
}

.sidebar-link.active {
  background: var(--bg-sidebar-active);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.sidebar-link.active svg {
  color: var(--apple-blue);
}

.sidebar-footer {
  padding: 14px 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.4);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e5e5ea;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.user-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-snippet {
  font-size: 0.8rem;
  line-height: 1.25;
}

.user-name {
  color: var(--text-primary);
  font-weight: 600;
}

.user-role {
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* Área de Conteúdo Principal */
.main-content {
  flex-grow: 1;
  background-color: var(--bg-base);
  min-height: 100vh;
  padding: 32px 40px 60px;
  overflow-y: auto;
}

.page-header {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Cards & Painéis */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Grid de Métricas */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.metric-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-card);
}

.metric-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
  letter-spacing: -0.03em;
  margin: 6px 0 4px;
}

.metric-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

/* Tabelas */
.table-container {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}

.table th {
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.table tr:hover td {
  background: rgba(0, 0, 0, 0.015);
}

/* Skin Avatar dos Jogadores */
.player-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-avatar-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: #e5e5ea;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-subtle);
}

.player-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.player-meta {
  display: flex;
  flex-direction: column;
}

.player-nick {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.88rem;
}

.player-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Paginação Apple Clean */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 4px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-primary);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  transition: all 0.15s;
}

.page-btn:hover {
  background: var(--bg-subtle);
  border-color: rgba(0, 0, 0, 0.15);
}

.page-btn.active {
  background: var(--apple-blue);
  color: #ffffff;
  border-color: var(--apple-blue);
}

.page-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Painel de Login */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-base);
}

.login-card {
  width: 100%;
  max-width: 370px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  box-shadow: var(--shadow-float);
}

/* ==========================================================================
   Apple Fluid Motion & Keyframe Animations (WWDC Standards)
   ========================================================================== */

@keyframes appleFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes appleSlideUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes appleScaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes applePulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(52, 199, 89, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
  }
}

.animate-fade-in {
  animation: appleFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up {
  animation: appleSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.main-content {
  animation: appleFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Transições fluidas em Cards e Botões */
.card, .metric-card, .endpoint-card, .release-item {
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover, .metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05), 0 0 1px rgba(0, 0, 0, 0.1);
}

.btn {
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: scale(0.96) !important;
}

/* ==========================================================================
   Cards Informativos de Usuários (Player Profile Cards)
   ========================================================================== */

.view-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.segmented-control {
  display: inline-flex;
  background: #e5e5ea;
  padding: 3px;
  border-radius: var(--radius-md);
  gap: 2px;
}

.segmented-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.segmented-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

.players-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.player-info-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.player-info-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.player-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.player-card-avatar {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: #f2f2f6;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.player-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.player-info-card:hover .player-card-avatar img {
  transform: scale(1.08);
}

.player-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--apple-green);
  border: 2px solid #ffffff;
  animation: applePulseGlow 2s infinite;
}

.player-card-headings {
  flex: 1;
  min-width: 0;
}

.player-card-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-card-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.player-details-list {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.78rem;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.detail-label {
  color: var(--text-secondary);
  font-size: 0.74rem;
}

.detail-value {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 0.76rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.copy-mini-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  transition: color 0.15s, background-color 0.15s;
}

.copy-mini-btn:hover {
  color: var(--apple-blue);
  background: rgba(0, 113, 227, 0.08);
}

.player-cosmetics-box {
  margin-bottom: 18px;
}

.cosmetics-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.cosmetics-chips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.cosmetic-chip {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 5px 8px;
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.cosmetic-chip-key {
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.cosmetic-chip-val {
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  max-width: 85px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

/* ==========================================================================
   Apple Sheet / Modal Dialog
   ========================================================================== */

.apple-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: appleFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.apple-modal-box {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  padding: 32px;
  box-shadow: var(--shadow-float);
  animation: appleScaleIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-height: 90vh;
  overflow-y: auto;
}

.apple-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.apple-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.apple-modal-close {
  background: #f2f2f6;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.apple-modal-close:hover {
  background: #e5e5ea;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  .main-content {
    padding: 24px 16px;
  }
  .cosmetics-chips-grid {
    grid-template-columns: 1fr;
  }
}
