/* styles/styles.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #0a0a0a;
  color: #00ff00;
  font-family: "Press Start 2P", cursive;
  line-height: 1.6;
  min-height: 100vh;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(0, 255, 0, 0.03) 0px,
    transparent 1px,
    transparent 2px,
    rgba(0, 255, 0, 0.03) 3px
  );
}

.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  z-index: 1000;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* HEADER STYLES */
.header-main {
  text-align: center;
  padding: 40px 20px;
  border: 4px solid #00ff00;
  background: rgba(0, 20, 0, 0.8);
  margin-bottom: 40px;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.header-admin {
  text-align: center;
  padding: 40px 20px;
  border: 4px solid #ff00ff;
  background: rgba(20, 0, 20, 0.8);
  margin-bottom: 40px;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
}

h1 {
  font-size: 2.5rem;
  text-shadow: 0 0 10px #00ff00;
  margin-bottom: 10px;
  animation: glow 2s ease-in-out infinite alternate;
}

h1.admin-title {
  color: #ff00ff;
  text-shadow: 0 0 10px #ff00ff;
  animation: glow-admin 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
  }
  to {
    text-shadow: 0 0 20px #00ff00, 0 0 30px #00ff00, 0 0 40px #00ff00;
  }
}

@keyframes glow-admin {
  from {
    text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff;
  }
  to {
    text-shadow: 0 0 20px #ff00ff, 0 0 30px #ff00ff, 0 0 40px #ff00ff;
  }
}

.subtitle {
  font-size: 0.8rem;
  color: #00cc00;
  margin-top: 10px;
}

.subtitle-admin {
  font-size: 0.7rem;
  color: #cc00cc;
  margin-top: 10px;
}

/* FORM STYLES */
.search-box,
.auth-box,
.form-box,
.chart-container,
.activity-card,
.stat-card {
  background: rgba(0, 20, 0, 0.8);
  border: 3px solid #00ff00;
  padding: 30px;
  margin-bottom: 40px;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.2);
}

.auth-box,
.form-box.admin-form,
.chart-container,
.activity-card,
.stat-card.admin-stat {
  background: rgba(20, 0, 20, 0.8);
  border: 3px solid #ff00ff;
  box-shadow: 0 0 15px rgba(255, 0, 255, 0.2);
}

.search-form,
.auth-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-group {
  margin-bottom: 25px;
}

label {
  display: block;
  margin-bottom: 10px;
  color: #00ff00;
  font-size: 0.8rem;
}

label.admin-label {
  color: #ff00ff;
}

input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
  width: 100%;
  background: #000;
  border: 2px solid #00ff00;
  color: #00ff00;
  padding: 15px;
  font-family: "Press Start 2P", cursive;
  font-size: 0.7rem;
  resize: vertical;
}

input.admin-input,
textarea.admin-textarea,
select.admin-select {
  border: 2px solid #ff00ff;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 10px #00ff00;
}

input.admin-input:focus,
textarea.admin-textarea:focus,
select.admin-select:focus {
  box-shadow: 0 0 10px #ff00ff;
}

textarea {
  min-height: 200px;
  font-family: monospace;
  line-height: 1.8;
}

/* BUTTON STYLES */
button,
.btn {
  background: #00ff00;
  color: #000;
  border: none;
  padding: 15px 30px;
  font-family: "Press Start 2P", cursive;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

button:hover,
.btn:hover {
  background: #00cc00;
  box-shadow: 0 0 15px #00ff00;
  transform: scale(1.05);
}

.btn-admin {
  background: #ff00ff;
  color: #000;
}

.btn-admin:hover {
  background: #cc00cc;
  box-shadow: 0 0 15px #ff00ff;
}

.btn-success {
  background: #00ff00;
}

.btn-success:hover {
  background: #00cc00;
  box-shadow: 0 0 15px #00ff00;
}

.btn-danger {
  background: #ff0000;
  color: #fff;
}

.btn-danger:hover {
  background: #cc0000;
  box-shadow: 0 0 15px #ff0000;
}

.btn-back {
  background: #00ffff;
}

.btn-back:hover {
  background: #00cccc;
  box-shadow: 0 0 15px #00ffff;
}

.btn-edit {
  background: #00ffff;
  color: #000;
}

.btn-edit:hover {
  background: #00cccc;
  box-shadow: 0 0 15px #00ffff;
}

/* GAME STYLES */
.section-title {
  font-size: 1.5rem;
  color: #00ff00;
  margin: 40px 0 20px;
  padding-bottom: 10px;
  border-bottom: 3px solid #00ff00;
  text-shadow: 0 0 10px #00ff00;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.game-card {
  background: rgba(0, 20, 0, 0.9);
  border: 3px solid #00ff00;
  padding: 0;
  transition: all 0.3s;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
  animation: fadeInUp 0.5s ease-out;
  display: flex;
  flex-direction: column;
  height: 100%;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 25px rgba(0, 255, 0, 0.5);
  border-color: #00ffff;
}

.game-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 3px solid #00ff00;
  background: #000;
}

.game-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.game-title {
  font-size: 1rem;
  margin-bottom: 15px;
  color: #00ffff;
  text-shadow: 0 0 5px #00ffff;
}

.game-description {
  font-size: 0.6rem;
  line-height: 1.8;
  margin-bottom: 20px;
  color: #00cc00;
  font-family: monospace;
  flex-grow: 1;
}

.game-description p {
  margin: 5px 0;
}

.game-description a {
  color: #00ffff;
  text-decoration: none;
  border-bottom: 1px solid #00ffff;
}

.game-description a:hover {
  color: #00ff00;
  border-color: #00ff00;
}

.download-btn {
  width: 100%;
  margin-top: 10px;
}

/* USER INFO STYLES */
.user-info {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 20, 0, 0.9);
  border: 2px solid #00ff00;
  padding: 10px 15px;
  font-size: 0.6rem;
  z-index: 100;
}

.user-info.admin-user {
  background: rgba(20, 0, 20, 0.9);
  border: 2px solid #ff00ff;
}

.user-info span {
  color: #00ffff;
}

.user-ip {
  color: #00cc00 !important;
  font-size: 0.5rem;
  margin-left: 10px;
}

.logout-btn {
  background: transparent;
  border: 1px solid #ff0000;
  color: #ff0000;
  padding: 5px 10px;
  font-size: 0.5rem;
  margin-left: 10px;
  text-decoration: none;
}

.logout-btn:hover {
  background: #ff0000;
  color: #000;
}

/* NAVIGATION STYLES */
.nav-buttons {
  text-align: center;
  margin: 20px 0;
}

/* FOOTER STYLES */
footer {
  margin-top: 60px;
  padding: 30px;
  text-align: center;
  border-top: 3px solid #00ff00;
  background: rgba(0, 20, 0, 0.8);
}

footer.admin-footer {
  border-top: 3px solid #ff00ff;
  background: rgba(20, 0, 20, 0.8);
}

footer p {
  font-size: 0.6rem;
  color: #00cc00;
  margin-bottom: 15px;
}

.admin-btn {
  padding: 10px 20px;
  font-size: 0.6rem;
}

/* ALERT STYLES */
.alert {
  padding: 20px;
  margin-bottom: 20px;
  border: 3px solid;
  font-size: 0.7rem;
  text-align: center;
}

.alert-error {
  background: rgba(50, 0, 0, 0.8);
  border-color: #ff0000;
  color: #ff0000;
  text-shadow: 0 0 5px #ff0000;
}

.alert-success {
  background: rgba(0, 50, 0, 0.8);
  border-color: #00ff00;
  color: #00ff00;
  text-shadow: 0 0 5px #00ff00;
}

/* STATS STYLES */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: rgba(0, 20, 0, 0.8);
  border: 3px solid #00ff00;
  padding: 30px;
  text-align: center;
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 25px rgba(0, 255, 0, 0.5);
}

.stat-card.admin-stat {
  background: rgba(20, 0, 20, 0.8);
  border: 3px solid #ff00ff;
}

.stat-card.admin-stat:hover {
  box-shadow: 0 0 25px rgba(255, 0, 255, 0.5);
}

a .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.7);
}

.stat-number {
  font-size: 2.5rem;
  color: #00ffff;
  margin-bottom: 15px;
  text-shadow: 0 0 10px #00ffff;
}

.stat-label {
  font-size: 0.8rem;
  color: #00cc00;
}

/* ADMIN LIST STYLES */
.users-grid,
.games-list {
  margin-top: 40px;
}

.user-card,
.game-item {
  background: rgba(0, 20, 0, 0.8);
  border: 2px solid #00ff00;
  padding: 20px;
  margin-bottom: 20px;
  transition: all 0.3s;
}

.user-card.admin-card,
.game-item.admin-item {
  background: rgba(20, 0, 20, 0.8);
  border: 2px solid #ff00ff;
}

.user-card.pending,
.game-item.pending {
  border-color: #ffff00;
}

.user-card.approved,
.game-item.approved {
  border-color: #00ff00;
}

.user-card.rejected,
.game-item.rejected {
  border-color: #ff0000;
}

.user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.user-info-small {
  color: #00cc00;
  font-size: 0.6rem;
}

.user-actions,
.game-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* HELPER TEXT */
.helper-text {
  font-size: 0.6rem;
  color: #00cc00;
  margin-top: 5px;
  font-family: monospace;
}

.helper-text.admin-helper {
  color: #cc00cc;
}

/* TABS STYLES */
.tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 2px solid #00ff00;
}

.tab {
  flex: 1;
  padding: 15px;
  text-align: center;
  background: transparent;
  border: none;
  color: #00cc00;
  font-family: "Press Start 2P", cursive;
  cursor: pointer;
  transition: all 0.3s;
}

.tab.active {
  background: #00ff00;
  color: #000;
}

.tab:hover {
  background: #00cc00;
  color: #000;
}

.form-section {
  display: none;
}

.form-section.active {
  display: block;
}

/* MESSAGE STYLES */
.no-results {
  text-align: center;
  padding: 60px 20px;
  font-size: 1.2rem;
  color: #ff0000;
  text-shadow: 0 0 10px #ff0000;
}

/* CHART STYLES */
.chart-title {
  font-size: 1rem;
  color: #00ffff;
  margin-bottom: 20px;
  text-align: center;
  border-bottom: 2px solid #00ff00;
  padding-bottom: 10px;
}

.chart-bar {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  gap: 15px;
}

.chart-label {
  font-size: 0.6rem;
  color: #00cc00;
  width: 100px;
  text-align: right;
}

.chart-bar-inner {
  flex: 1;
  background: rgba(0, 255, 0, 0.2);
  height: 30px;
  border: 2px solid #00ff00;
  position: relative;
}

.chart-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ff00, #00ffff);
  transition: width 0.3s ease;
}

.chart-value {
  font-size: 0.6rem;
  color: #00ff00;
  width: 50px;
  text-align: right;
}

/* ACTIVITY STYLES */
.recent-activity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

.activity-title {
  font-size: 0.9rem;
  color: #00ffff;
  margin-bottom: 20px;
  text-align: center;
  border-bottom: 2px solid #00ff00;
  padding-bottom: 10px;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 255, 0, 0.3);
  font-size: 0.6rem;
}

.activity-date {
  color: #00cc00;
}

.activity-count {
  color: #00ff00;
  font-weight: bold;
}

/* LAST UPDATE */
.last-update {
  text-align: center;
  font-size: 0.6rem;
  color: #00cc00;
  margin-top: 30px;
}

/* SETTINGS STYLES */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.setting-group {
  margin-bottom: 25px;
}

.setting-description {
  font-size: 0.6rem;
  color: #00cc00;
  margin-top: 8px;
  line-height: 1.6;
}

/* RESPONSIVE STYLES */
@media (max-width: 768px) {
  h1 {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 0.6rem;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  input[type="text"],
  button,
  .btn {
    font-size: 0.7rem;
    padding: 12px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .recent-activity {
    grid-template-columns: 1fr;
  }

  .stat-number {
    font-size: 2rem;
  }

  .user-info {
    position: static;
    margin-bottom: 20px;
    text-align: center;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* CHECKBOX STYLES */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 15px 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.7rem;
  color: #ff00ff;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid #ff00ff;
  background: #000;
  position: relative;
  cursor: pointer;
  transition: all 0.3s;
}

.checkbox-custom::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #00ff00;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.checkbox-input:checked + .checkbox-custom {
  background: #ff00ff;
}

.checkbox-input:checked + .checkbox-custom::after {
  opacity: 1;
}

.checkbox-input {
  display: none;
}

.featured-badge {
  background: #ff00ff;
  color: #000;
  padding: 3px 8px;
  font-size: 0.5rem;
  border-radius: 3px;
  margin-left: 10px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

.featured-toggle {
  background: transparent;
  border: 2px solid #ff00ff;
  color: #ff00ff;
  padding: 8px 15px;
  font-size: 0.6rem;
  cursor: pointer;
  transition: all 0.3s;
}

.featured-toggle:hover {
  background: #ff00ff;
  color: #000;
}

.featured-toggle.active {
  background: #ff00ff;
  color: #000;
}

/* Mobile horizontal scroll for alphabet */
@media (max-width: 480px) {
  .alphabet-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #00ff00 rgba(0, 20, 0, 0.8);
  }
  
  .alphabet-nav::-webkit-scrollbar {
    height: 8px;
  }
  
  .alphabet-nav::-webkit-scrollbar-track {
    background: rgba(0, 20, 0, 0.8);
  }
  
  .alphabet-nav::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 4px;
  }
}

/* PAGINATION STYLES */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 40px 0;
  flex-wrap: wrap;
}

.pagination-btn {
  background: #00ff00;
  color: #000;
  border: 2px solid #00ff00;
  padding: 10px 20px;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
}

.pagination-btn:hover {
  background: #00cc00;
  box-shadow: 0 0 15px #00ff00;
  transform: scale(1.05);
}

.pagination-btn.active {
  background: #00ffff;
  border-color: #00ffff;
  box-shadow: 0 0 15px #00ffff;
}

.pagination-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-info {
  color: #00cc00;
  font-size: 0.6rem;
  padding: 10px 20px;
}

/* SIDEBAR LAYOUT */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 30px;
  margin-bottom: 40px;
}

.main-content {
  min-width: 0;
}

/* SIDEBAR FEATURED GAMES */
.sidebar-featured {
  background: rgba(20, 0, 20, 0.8);
  border: 3px solid #ff00ff;
  padding: 0;
  max-height: calc(100vh - 200px);
  position: sticky;
  top: 20px;
  overflow-y: auto;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
}

.sidebar-header {
  background: rgba(255, 0, 255, 0.2);
  border-bottom: 2px solid #ff00ff;
  padding: 15px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.sidebar-header h3 {
  font-size: 0.9rem;
  color: #ff00ff;
  text-align: center;
  margin: 0;
  text-shadow: 0 0 10px #ff00ff;
}

.sidebar-content {
  padding: 15px;
}

.no-featured {
  text-align: center;
  padding: 40px 20px;
  color: #cc00cc;
  font-size: 0.6rem;
}

.sidebar-game-card {
  background: rgba(0, 20, 0, 0.6);
  border: 2px solid #ff00ff;
  padding: 10px;
  margin-bottom: 15px;
  display: flex;
  gap: 10px;
  transition: all 0.3s;
  cursor: pointer;
}

.sidebar-game-card:hover {
  transform: translateX(-5px);
  box-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
  border-color: #00ffff;
}

.sidebar-game-card img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border: 2px solid #ff00ff;
  flex-shrink: 0;
}

.sidebar-game-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.sidebar-game-title {
  font-size: 0.6rem;
  color: #00ffff;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sidebar-download-btn {
  background: #ff00ff;
  color: #000;
  border: none;
  padding: 5px 10px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
  align-self: flex-start;
  font-family: 'Press Start 2P', cursive;
}

.sidebar-download-btn:hover {
  background: #00ffff;
  box-shadow: 0 0 10px #ff00ff;
}

/* Scrollbar para sidebar */
.sidebar-featured::-webkit-scrollbar {
  width: 8px;
}

.sidebar-featured::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.5);
}

.sidebar-featured::-webkit-scrollbar-thumb {
  background: #ff00ff;
  border-radius: 4px;
}

.sidebar-featured::-webkit-scrollbar-thumb:hover {
  background: #00ffff;
}

/* RESPONSIVE SIDEBAR */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-featured {
    position: static;
    max-height: 500px;
    order: -1; /* Sidebar arriba en móvil */
  }
}

@media (max-width: 768px) {
  .sidebar-featured {
    max-height: 400px;
  }

  .sidebar-game-card {
    flex-direction: column;
  }

  .sidebar-game-card img {
    width: 100%;
    height: 120px;
  }
}
