/* =============================================
   DamaPlay - Estilos Principais
   Dark Theme com acentos dourados
   ============================================= */

:root {
  --bg-primary:    #0a0a1a;
  --bg-secondary:  #12122a;
  --bg-card:       #1a1a3e;
  --bg-hover:      #22224a;
  --gold:          #FFD700;
  --gold-dark:     #FFA500;
  --gold-light:    #FFE44d;
  --text-primary:  #e8e8ff;
  --text-secondary:#a0a0c0;
  --text-muted:    #606080;
  --accent-blue:   #4a90e2;
  --accent-green:  #2ecc71;
  --accent-red:    #e74c3c;
  --accent-purple: #9b59b6;
  --border:        #2a2a4a;
  --border-gold:   rgba(255,215,0,0.3);
  --shadow:        0 8px 32px rgba(0,0,0,0.5);
  --shadow-gold:   0 0 20px rgba(255,215,0,0.2);
  --radius:        12px;
  --radius-sm:     8px;
  --transition:    0.3s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }

img { max-width: 100%; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* ---- Navbar ---- */
.navbar {
  background: rgba(10,10,26,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-gold);
  padding: 0 2rem;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.5px;
}

.navbar-brand .logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 8px rgba(255,215,0,0.5));
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover, .nav-link.active {
  color: var(--gold);
  background: var(--bg-card);
}

.nav-link i { font-size: 1rem; }

.navbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
  cursor: pointer;
  transition: transform var(--transition);
}

.user-avatar:hover { transform: scale(1.1); }

/* ---- Dropdown ---- */
.dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  min-width: 200px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition);
  z-index: 1001;
}

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-size: 0.9rem;
}

.dropdown-item:hover { background: var(--bg-hover); color: var(--gold); }
.dropdown-item.danger:hover { background: rgba(231,76,60,0.1); color: var(--accent-red); }
.dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  line-height: 1;
  white-space: nowrap;
}

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

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #1a1a3e;
}
.btn-gold:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
  color: #1a1a3e;
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}
.btn-outline:hover:not(:disabled) {
  background: var(--gold);
  color: #1a1a3e;
  transform: translateY(-2px);
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--gold);
  color: var(--gold);
}

.btn-danger {
  background: var(--accent-red);
  color: white;
}
.btn-danger:hover:not(:disabled) {
  background: #c0392b;
  transform: translateY(-2px);
}

.btn-success {
  background: var(--accent-green);
  color: white;
}

.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 32px; font-size: 1.1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 10px; width: 40px; height: 40px; border-radius: 50%; }

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}

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

.card-gold {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-gold);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- Forms ---- */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

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

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

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

.form-control.is-invalid { border-color: var(--accent-red); }
.form-control.is-valid { border-color: var(--accent-green); }

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group .form-control { padding-left: 44px; }
.input-group .input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-group .input-action {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition);
}
.input-group .input-action:hover { color: var(--gold); }

select.form-control option { background: var(--bg-card); }

/* ---- Alerts ---- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.alert-success { background: rgba(46,204,113,0.1); border: 1px solid rgba(46,204,113,0.3); color: #2ecc71; }
.alert-danger  { background: rgba(231,76,60,0.1);  border: 1px solid rgba(231,76,60,0.3);  color: #e74c3c; }
.alert-warning { background: rgba(241,196,15,0.1); border: 1px solid rgba(241,196,15,0.3); color: #f1c40f; }
.alert-info    { background: rgba(74,144,226,0.1); border: 1px solid rgba(74,144,226,0.3); color: #4a90e2; }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-gold    { background: rgba(255,215,0,0.15); color: var(--gold); border: 1px solid var(--border-gold); }
.badge-green   { background: rgba(46,204,113,0.15); color: #2ecc71; }
.badge-red     { background: rgba(231,76,60,0.15);  color: #e74c3c; }
.badge-blue    { background: rgba(74,144,226,0.15); color: #4a90e2; }
.badge-gray    { background: rgba(96,96,128,0.3);   color: var(--text-muted); }

/* ---- Tables ---- */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  padding: 14px 16px;
  text-align: left;
}

td { padding: 12px 16px; border-top: 1px solid var(--border); }

tr:hover td { background: var(--bg-hover); }

/* ---- Stats Cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-3px);
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- Ranking ---- */
.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.rank-item:hover { background: var(--bg-hover); }

.rank-number {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.9rem;
}

.rank-1 { background: linear-gradient(135deg,#FFD700,#FFA500); color: #1a1a3e; }
.rank-2 { background: linear-gradient(135deg,#C0C0C0,#A8A8A8); color: #1a1a3e; }
.rank-3 { background: linear-gradient(135deg,#cd7f32,#b5651d); color: white; }
.rank-other { background: var(--bg-secondary); color: var(--text-muted); }

.rank-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
}

.rank-info { flex: 1; }
.rank-name { font-weight: 600; font-size: 0.95rem; }
.rank-score { color: var(--text-muted); font-size: 0.8rem; }
.rank-pts { font-weight: 700; color: var(--gold); }

/* ---- Notification dot ---- */
.notif-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-red);
  border-radius: 50%;
  position: absolute;
  top: 4px;
  right: 4px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

/* ---- Loading spinner ---- */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ---- Layout helpers ---- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 640px; margin: 0 auto; padding: 0 20px; }
.container-md { max-width: 900px; margin: 0 auto; padding: 0 20px; }

.page-wrapper { min-height: calc(100vh - 70px); padding: 32px 0; }

.page-header { margin-bottom: 32px; }
.page-title { font-size: 1.8rem; font-weight: 800; color: var(--gold); margin-bottom: 4px; }
.page-subtitle { color: var(--text-secondary); font-size: 0.95rem; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.fw-700 { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.w-100 { width: 100%; }

/* ---- Footer ---- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: auto;
}

.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--gold); }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 32px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition);
  box-shadow: var(--shadow), var(--shadow-gold);
}

.modal-overlay.open .modal { transform: translateY(0); }

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

.modal-title { font-size: 1.2rem; font-weight: 700; color: var(--gold); }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; padding: 4px; }
.modal-close:hover { color: var(--accent-red); }

/* ---- Toast ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
  font-size: 0.9rem;
}

.toast.success { border-color: var(--accent-green); }
.toast.error   { border-color: var(--accent-red); }
.toast.gold    { border-color: var(--gold); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { transform: translateX(100%); opacity: 0; }
}

/* ---- Like button ---- */
.like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.9rem;
}

.like-btn.liked { background: rgba(255,215,0,0.1); border-color: var(--gold); color: var(--gold); }
.like-btn.disliked { background: rgba(231,76,60,0.1); border-color: var(--accent-red); color: var(--accent-red); }
.like-btn:hover { transform: scale(1.05); }

/* Hide hamburger always */
#navToggle { display: none !important; }

/* Mobile-only nav icons (Amigos / Grupos) */
.mobile-nav-icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1.1rem;
  position: relative;
  transition: color 0.2s;
}
.mobile-nav-icon:hover, .mobile-nav-icon.active { color: var(--gold); }
.mobile-nav-icon--hidden { display: none !important; }
.mobile-nav-badge {
  position: absolute;
  top: 0; right: 0;
  background: #e74c3c;
  color: #fff;
  border-radius: 50%;
  width: 15px; height: 15px;
  font-size: 0.55rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .navbar { padding: 0 0.75rem; }
  .mobile-nav-icon { display: flex; }
  .user-chips { display: none; }
  .navbar-nav { display: none; }
  .navbar-nav.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-gold);
    border-bottom: 1px solid var(--border-gold);
    padding: 8px 0;
    z-index: 1100;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  }
  .navbar-nav.open .nav-link {
    padding: 14px 24px;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .navbar-nav.open li:last-child .nav-link { border-bottom: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .container { padding: 0 16px; }
  .btn-lg { padding: 12px 24px; font-size: 1rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 1.4rem; }
}
