/* ============================================================
   L2Top DevLyon - Estilos principales
   ============================================================ */

@import 'variables.css';

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

html { scroll-behavior: smooth; font-size: 16px; }

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

/* Fondo con efecto */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(107, 70, 193, 0.08), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(196, 30, 58, 0.06), transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(212, 175, 55, 0.03), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

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

img { max-width: 100%; height: auto; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(10, 10, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
}

.navbar .container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar .logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar .logo .l2 {
  color: var(--text-primary);
}

.navbar nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.navbar nav a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color var(--transition-fast);
}

.navbar nav a:hover,
.navbar nav a.active {
  color: var(--accent-gold);
}

.navbar .btn-login {
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-bright));
  color: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.navbar .btn-login:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
  color: var(--bg-primary);
}

/* ── Container ──────────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 60px 24px 40px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.hero h1 .highlight {
  color: var(--accent-gold);
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
}

/* ── Stats bar ──────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-item .value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-gold);
}

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

/* ── Filtros ────────────────────────────────────────────────── */
.filters {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 32px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.filters .filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filters label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.filters select,
.filters input[type="text"] {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.filters select:focus,
.filters input:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.filters .search-box {
  flex: 1;
  min-width: 200px;
}

.filters .btn-filter {
  padding: 8px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all var(--transition-fast);
  align-self: flex-end;
}

.filters .btn-filter:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* ── Secciones ──────────────────────────────────────────────── */
.section {
  margin-bottom: 48px;
}

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

.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-primary);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-header h2::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--accent-gold);
  border-radius: 2px;
}

.section-header .view-all {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Server cards grid ──────────────────────────────────────── */
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
}

.server-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  position: relative;
}

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

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

.server-card.featured::after {
  content: 'FEATURED';
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent-crimson);
  color: white;
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  letter-spacing: 1px;
}

.server-card .banner {
  width: 100%;
  height: 120px;
  background: var(--bg-elevated);
  background-size: cover;
  background-position: center;
  position: relative;
}

.server-card .banner .rank-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: var(--accent-gold);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-gold);
}

.server-card .body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.server-card .name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-primary);
  font-weight: 600;
}

.server-card .name a { color: inherit; }
.server-card .name a:hover { color: var(--accent-gold); }

.server-card .meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.server-card .badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.chronicle { background: rgba(107, 70, 193, 0.2); color: #a78bfa; border: 1px solid rgba(107, 70, 193, 0.3); }
.badge.platform { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge.type { background: rgba(196, 30, 58, 0.2); color: #f87171; border: 1px solid rgba(196, 30, 58, 0.3); }
.badge.rate { background: rgba(212, 175, 55, 0.15); color: var(--accent-gold); border: 1px solid rgba(212, 175, 55, 0.3); }
.badge.status-open { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge.status-soon { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

.server-card .description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.server-card .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.server-card .votes {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--accent-gold);
  font-weight: 600;
}

.server-card .votes .month {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.server-card .actions {
  display: flex;
  gap: 8px;
}

.server-card .btn-vote {
  padding: 6px 16px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-bright));
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.server-card .btn-vote:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
}

.server-card .btn-vote:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.server-card .btn-visit {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.server-card .btn-visit:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* ── Coming soon list ───────────────────────────────────────── */
.openings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opening-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.opening-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.opening-item .date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-gold);
  white-space: nowrap;
  min-width: 100px;
}

.opening-item .name {
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.opening-item .name a { color: inherit; }
.opening-item .name a:hover { color: var(--accent-gold); }

.opening-item .rate {
  font-size: 0.85rem;
  color: var(--accent-gold);
  font-weight: 600;
}

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.pagination button {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.pagination button:hover:not(:disabled) {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.pagination button.active {
  background: var(--accent-gold);
  color: var(--bg-primary);
  border-color: var(--accent-gold);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  margin-top: 64px;
  padding: 32px 24px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer a { color: var(--text-secondary); }
.footer a:hover { color: var(--accent-gold); }

/* ── Toast notification ─────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  max-width: 400px;
  animation: slideIn 0.3s ease;
}

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

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

/* ── Loading ────────────────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

.loading .spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.3;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .stats-bar { gap: 24px; }
  .servers-grid { grid-template-columns: 1fr; }
  .navbar nav { gap: 12px; }
  .navbar nav a { font-size: 0.8rem; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters .btn-filter { align-self: stretch; }
}
