
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;700&display=swap');

:root {
  /* Variables de colores y fuentes */
  --color-bg: #0e0e0e;
  --color-bg-darker: #1a1a1a;
  --color-primary: #8b6cff;
  --color-primary-glow: rgba(139, 108, 255, 0.4);
  --color-text: #f0f0f0;
  --color-text-muted: #aaaaaa;

  --color-glass-bg: rgba(255, 255, 255, 0.05);
  --color-glass-border: rgba(255, 255, 255, 0.15);
  --color-glass-shadow: rgba(0, 0, 0, 0.2);

  --font-family: 'Poppins', sans-serif;
  --transition-smooth: all 0.3s ease;
}

* {
  /* Reseteo básico de CSS */
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: linear-gradient(135deg, var(--color-bg), var(--color-bg-darker));
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.6;
  background-attachment: fixed;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  filter: brightness(1.2);
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

h1, h2, h3 {
  margin-bottom: 1rem;
  font-weight: 500;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; }

/* Efecto de cristal (Glassmorphism) */
.glass-card {
  background: var(--color-glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  border: 1px solid var(--color-glass-border);
  box-shadow: 0 4px 20px var(--color-glass-shadow);
  transition: var(--transition-smooth);
}
/* Estilos para botones e inputs */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--color-primary-glow);
}

.btn-secondary {
  background: var(--color-glass-bg);
  color: var(--color-text);
  border: 1px solid var(--color-glass-border);
}

.btn-secondary:hover {
  background: var(--color-glass-bg);
  filter: brightness(1.3);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--color-text-muted);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-family);
  font-size: 1rem;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--color-glass-border);
  border-radius: 8px;
  transition: var(--transition-smooth);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary-glow);
}

/* Header y barra de navegación */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14, 14, 14, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-glass-border);
  box-shadow: 0 2px 10px var(--color-glass-shadow);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.logo span {
  color: var(--color-primary);
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.main-nav a {
  color: var(--color-text);
  font-weight: 500;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

.nav-search .form-input {
  background: rgba(255, 255, 255, 0.1);
  padding-right: 2.5rem; /* Espacio para el ícono (no implementado aquí) */
}

/* Estilos para el catálogo de juegos (index) */
.filters {
  display: flex;
  gap: 1rem;
  margin: 1rem 0 2rem;
  flex-wrap: wrap;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.game-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: scale(1.03);
  box-shadow: 0 0 25px var(--color-primary-glow);
}

.game-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
}

.game-card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.game-card-content h3 {
  margin-bottom: 0.5rem;
}

.game-card-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.game-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 1rem;
}

.price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.load-more {
  text-align: center;
  margin-top: 2rem;
}

/* Estilos para login y registro */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 80px);
  padding: 2rem;
}

.auth-form {
  width: 100%;
  max-width: 450px;
  padding: 2.5rem;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-form .btn {
  width: 100%;
}

.auth-form p {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--color-text-muted);
}

/* Estilos para la página de detalle del juego */
.detail-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.detail-image img {
  border-radius: 16px;
  width: 100%;
  height: auto;
  object-fit: cover;
  border: 1px solid var(--color-glass-border);
}

.detail-info {
  padding: 2.5rem;
}

.detail-info .price {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-meta p {
  font-size: 1.1rem;
}

.detail-meta strong {
  color: var(--color-text-muted);
  font-weight: 400;
  margin-right: 0.5rem;
}

.detail-info .btn {
  margin-top: 1.5rem;
}

/* Estilos para el panel de administración */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.admin-table-wrapper {
  padding: 1rem;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th, .admin-table td {
  padding: 1rem;
  text-align: left;
}

.admin-table thead {
  border-bottom: 1px solid var(--color-glass-border);
}

.admin-table tbody tr {
  background: var(--color-glass-bg);
  border-bottom: 1px solid var(--color-glass-border);
  transition: var(--transition-smooth);
}

.admin-table tbody tr:last-child {
  border-bottom: none;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 10px var(--color-primary-glow);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition-smooth);
}

.btn-icon.edit:hover {
  color: var(--color-primary);
  background: var(--color-primary-glow);
}

.btn-icon.delete:hover {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.2);
}

/* Estilos para las ventanas modales */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  margin: auto;
  padding: 2rem;
  width: 90%;
  max-width: 600px;
  position: relative;
}

.close-modal {
  color: var(--color-text-muted);
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.close-modal:hover {
  color: var(--color-text);
}

/* Media Queries para responsividad */
@media (max-width: 992px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }
  .main-nav ul {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }

  .container {
    padding: 1rem;
  }

  .main-nav ul {
    gap: 1rem;
    font-size: 0.9rem;
  }
  
  .nav-search {
    width: 100%;
    margin-top: 0.5rem;
  }

  .detail-container {
    grid-template-columns: 1fr;
  }

  .detail-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filters .btn {
    width: 100%;
  }

  .auth-form {
    padding: 1.5rem;
  }
}

/* Mensajes de error para formularios */
.login-error {
    display: none;
    color: #ff6b6b;
    background: rgba(255, 0, 0, 0.12);
    border: 1px solid rgba(255, 0, 0, 0.3);
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
}
