/* Estilo Retro Responsive */
:root {
    --neon-pink: #ff6ec7;
    --electric-blue: #00f3ff;
    --acid-green: #a1ff0a;
    --purple-rain: #9d00ff;
    --matrix-green: #00ff41;
    --retro-orange: #ff5e00;
    --bg-dark: #0d0221;
    --text-color: #e0e0e0;
  }
  
  /* Reset y Estilos Base */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  html {
    font-size: 16px;
  }
  
  body {
    background-color: var(--bg-dark);
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
  }
  
  /* Efecto CRT (solo en pantallas grandes) */
  @media (min-width: 768px) {
    body::before {
      content: "";
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      border: 12px solid var(--neon-pink);
      pointer-events: none;
      z-index: 9999;
      box-shadow: 
        0 0 20px var(--neon-pink),
        inset 0 0 20px var(--neon-pink);
    }
  }
  
  /* Contenedor Principal */
  .container {
    max-width: 95%;
    margin: 2rem auto;
    padding: 1.5rem;
    background-color: rgba(13, 2, 33, 0.8);
    border: 4px solid var(--acid-green);
    box-shadow: 
      0 0 15px var(--acid-green),
      inset 0 0 15px var(--acid-green);
    position: relative;
    overflow: hidden;
  }
  
  @media (min-width: 768px) {
    .container {
      max-width: 800px;
      margin: 3rem auto;
      padding: 2rem;
    }
  }
  
  /* Tipografía Responsive */
  h1, h2, h3 {
    color: var(--neon-pink);
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    word-wrap: break-word;
  }
  
  h1 {
    font-size: 1.8rem;
    line-height: 1.2;
  }
  
  @media (min-width: 768px) {
    h1 {
      font-size: 2.5rem;
    }
  }
  
  /* Formularios */
  .form-group {
    margin-bottom: 1.5rem;
  }
  
  .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--electric-blue);
    font-weight: bold;
  }
  
  .form-group input,
  textarea,
  select,
  .option-item input[type="text"] {
    width: 100%;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--electric-blue);
    color: var(--acid-green);
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    resize: none;
  }
  
  /* Dashboard Responsive */
  .dashboard-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  
  @media (min-width: 992px) {
    .dashboard-container {
      flex-direction: row;
    }
  }
  
  .sidebar {
    width: 100%;
    background: rgba(13, 2, 33, 0.9);
    padding: 1rem;
    border-bottom: 3px dashed var(--neon-pink);
  }
  
  @media (min-width: 992px) {
    .sidebar {
      width: 250px;
      min-height: 100vh;
      border-right: 3px dashed var(--neon-pink);
      border-bottom: none;
    }
  }
  
  .sidebar-header {
    padding: 0 0 1rem 0;
    border-bottom: 2px solid var(--electric-blue);
  }
  
  .sidebar-nav ul {
    list-style: none;
  }
  
  .sidebar-nav a {
    display: block;
    padding: 0.8rem 0;
    color: var(--acid-green);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 4px solid transparent;
  }
  
  @media (min-width: 992px) {
    .sidebar-nav a {
      padding: 0.8rem 1rem;
    }
  }
  
  .sidebar-nav a:hover, 
  .sidebar-nav a.active {
    background: rgba(161, 255, 10, 0.2);
    border-left: 4px solid var(--acid-green);
  }
  
  .main-content {
    flex: 1;
    padding: 1.5rem;
    background: rgba(13, 2, 33, 0.7);
  }
  
  @media (min-width: 768px) {
    .main-content {
      padding: 2rem;
    }
  }
  
  /* Botones Responsive */
  .btn {
    display: inline-block;
    padding: 2rem 1.5rem;
    background: transparent;
    color: var(--matrix-green);
    border: 3px solid var(--matrix-green);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0.5rem 0;
    transition: all 0.3s;
    text-align: center;
    width: 100%;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.3s;
  }
 
  @media (min-width: 768px) {
    .btn {
      display: flex;
      flex-direction: column;
      align-content: space-between;
      padding: .5rem .2rem;
      max-width: 4.8rem;
      max-height: 10rem;
      font-size: .65rem;
      margin: 0.5rem;
    }
  }
 
  
  .btn:hover {
    background: var(--matrix-green);
    color: var(--bg-dark);
  }
  .delete-btn {
    background-color: #dc3545;
    color: white;
}

.delete-btn:hover {
    background-color: #c82333;
}

.contest-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}
  /* Alertas */
  .alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 2px solid;
  }
  
  .alert.error {
    background: rgba(255, 0, 0, 0.2);
    border-color: #ff0000;
    color: #ff6e6e;
  }
  
  /* Efecto de escaneo CRT (solo en pantallas grandes) */
  @media (min-width: 768px) {
    .main-content::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 2px;
      background: var(--matrix-green);
      animation: scanline 8s linear infinite;
      z-index: 1;
    }
  }
  
  @keyframes scanline {
    0% { top: 0; opacity: 0.8; }
    100% { top: 100%; opacity: 0.8; }
  }
  
  /* Grid Responsive para estadísticas */
  .admin-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
  }
  
  @media (min-width: 600px) {
    .admin-stats {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  
  @media (min-width: 992px) {
    .admin-stats {
      grid-template-columns: repeat(4, 1fr);
    }
  }
  
  /* Menú hamburguesa para móviles */
  .menu-toggle {
    display: block;
    background: transparent;
    border: none;
    color: var(--acid-green);
    font-size: 1.5rem;
    cursor: pointer;
    margin-bottom: 1rem;
  }
  
  @media (min-width: 992px) {
    .menu-toggle {
      display: none;
    }
  }
  
  /* Efectos específicos para móviles */
  @media (max-width: 767px) {
    .sidebar {
      position: fixed;
      top: 0;
      left: -100%;
      height: 100vh;
      z-index: 1000;
      transition: left 0.3s ease;
    }
    
    .sidebar.active {
      left: 0;
    }
    
    .main-content {
      margin-top: 0;
    }
  }

  /* Estilos para la tabla de códigos */
.table-responsive {
  overflow-x: auto;
  margin: 1rem 0;
}

.codes-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.codes-table th, .codes-table td {
  padding: 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--electric-blue);
}

.codes-table th {
  background-color: rgba(0, 243, 255, 0.1);
  color: var(--electric-blue);
}

.codes-table tr:hover {
  background-color: rgba(0, 243, 255, 0.05);
}

.status-badge {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
}

.status-badge.active {
  background-color: rgba(0, 255, 65, 0.2);
  color: var(--matrix-green);
}

.status-badge.used {
  background-color: rgba(255, 110, 199, 0.2);
  color: var(--neon-pink);
}

.status-badge.expired {
  background-color: rgba(255, 0, 0, 0.2);
  color: #ff6e6e;
}

.create-code-section {
  background: rgba(13, 2, 33, 0.5);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 2px solid var(--purple-rain);
  border-radius: 8px;
}

/* Estilos para botones de acción */
.btn-delete {
  background-color: rgba(255, 0, 0, 0.1);
  color: #ff6e6e;
  border: 2px solid #ff6e6e;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s;
}

.btn-delete:hover {
  background-color: rgba(255, 0, 0, 0.3);
  color: white;
}

/* Adaptación para móviles */
@media (max-width: 768px) {
  .codes-table td:nth-child(7), 
  .codes-table th:nth-child(7) {
      display: none;
  }
  
  .codes-table td::before {
      content: attr(data-label);
      font-weight: bold;
      display: inline-block;
      width: 100px;
  }
  
  .codes-table {
      display: block;
  }
  
  .codes-table tr {
      display: grid;
      grid-template-columns: 1fr 1fr;
      margin-bottom: 1rem;
  }
  
  .codes-table td, .codes-table th {
      display: block;
      padding: 0.5rem;
      text-align: right;
  }
  
  .codes-table td:first-child, 
  .codes-table th:first-child {
      text-align: left;
      font-weight: bold;
  }
}

/* Estilos para la tabla de usuarios */
.users-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.users-table th, .users-table td {
  padding: 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--electric-blue);
}

.users-table th {
  background-color: rgba(0, 243, 255, 0.1);
  color: var(--electric-blue);
}

.users-table tr:hover {
  background-color: rgba(0, 243, 255, 0.05);
}

.users-table tr.admin-user {
  background-color: rgba(157, 0, 255, 0.05);
}

.users-table tr.normal-user {
  background-color: rgba(13, 2, 33, 0.1);
}

.role-badge {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
}

.role-badge.admin {
  background-color: rgba(157, 0, 255, 0.2);
  color: var(--purple-rain);
}

.role-badge.user {
  background-color: rgba(0, 243, 255, 0.2);
  color: var(--electric-blue);
}

.no-action {
  color: #666;
  font-style: italic;
}

/* Adaptación para móviles */
@media (max-width: 768px) {
  .users-table {
    display: block;
    overflow-x: auto;
  }
  
  .users-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--electric-blue);
  }
  
  .users-table td, .users-table th {
    display: block;
    padding: 0.5rem;
    text-align: right;
  }
  
  .users-table td:first-child, 
  .users-table th:first-child {
    text-align: left;
    font-weight: bold;
  }
  
  .users-table td::before {
    content: attr(data-label);
    font-weight: bold;
    display: inline-block;
    width: 100px;
  }
  
  .users-table thead {
    display: none;
  }
}

/* Estilos para concursos */
.contests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.contest-card {
  background: rgba(13, 2, 33, 0.7);
  border: 2px solid var(--electric-blue);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s;
}

.contest-card:hover {
  box-shadow: 0 0 15px var(--electric-blue);
  transform: translateY(-5px);
}

.contest-card h3 {
  color: var(--neon-pink);
  margin-bottom: 0.5rem;
}

.contest-meta {
  color: var(--electric-blue);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.contest-dates {
  color: var(--acid-green);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.contest-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
}

.participated-badge {
  color: var(--neon-pink);
  font-weight: bold;
  margin: 0.5rem 0;
}

.position-badge {
  color: var(--matrix-green);
  font-weight: bold;
  margin: 0.5rem 0;
}

/* Estilos para preguntas y respuestas */
.question-card {
  background: rgba(13, 2, 33, 0.5);
  border: 1px solid var(--purple-rain);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.question-meta {
  color: var(--electric-blue);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.options-list {
  margin: 1rem 0;
}

.option-item {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.8rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  border-left: 3px solid var(--electric-blue);
}

.option-item label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

/* Estilos para resultados */
.answer-card {
  background: rgba(13, 2, 33, 0.5);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.answer-card.correct {
  border-left: 5px solid var(--matrix-green);
}

.answer-card.incorrect {
  border-left: 5px solid var(--neon-pink);
}

.answer-meta {
  color: var(--electric-blue);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.answer-options ul {
  list-style: none;
}

.answer-options li {
  padding: 0.5rem;
  margin-bottom: 0.3rem;
  border-radius: 4px;
}

.correct-option {
  background: rgba(0, 255, 65, 0.1);
  border-left: 3px solid var(--matrix-green);
}

.selected-option {
  background: rgba(255, 110, 199, 0.1);
  border-left: 3px solid var(--neon-pink);
}

.correct-mark {
  color: var(--matrix-green);
  font-size: 0.8rem;
  margin-left: 1rem;
}

.selected-mark {
  color: var(--neon-pink);
  font-size: 0.8rem;
  margin-left: 1rem;
}

/* Adaptación para móviles */
@media (max-width: 768px) {
  .contests-grid {
      grid-template-columns: 1fr;
  }
  
  .contest-actions {
      flex-direction: column;
  }
  
  .contest-actions .btn {
      width: 100%;
      margin-bottom: 0.5rem;
  }
  
  .question-header {
      flex-direction: column;
      align-items: flex-start;
  }
  
  .remove-question {
      margin-top: 0.5rem;
  }
}

/* Estilos para tablas de resultados */
.participants-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.participants-table th, .participants-table td {
  padding: 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--electric-blue);
}

.participants-table th {
  background-color: rgba(0, 243, 255, 0.1);
  color: var(--electric-blue);
}

.participants-table tr:hover {
  background-color: rgba(0, 243, 255, 0.05);
}

/* Estilos para estadísticas */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.stat-card {
  background: rgba(13, 2, 33, 0.5);
  border: 1px solid var(--purple-rain);
  border-radius: 8px;
  padding: 1rem;
}

.stat-card h4 {
  color: var(--neon-pink);
  margin-bottom: 0.5rem;
}

.stat-card p {
  margin: 0.3rem 0;
  color: var(--electric-blue);
  font-size: 0.9rem;
}

.close-contest-form {
  margin: 1rem 0;
}

/* Adaptación para móviles */
@media (max-width: 768px) {
  .stats-grid {
      grid-template-columns: 1fr;
  }
  
  .participants-table td, .participants-table th {
      padding: 0.5rem;
      font-size: 0.9rem;
  }
}

/* Estilos para el dashboard de admin */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-card {
  background: rgba(13, 2, 33, 0.7);
  border: 2px solid var(--purple-rain);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}

.stat-card h3 {
  color: var(--electric-blue);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--neon-pink);
  margin: 0.5rem 0;
}

.stat-subvalue {
  font-size: 0.9rem;
  color: var(--acid-green);
  margin-bottom: 0.5rem;
}

.stat-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--electric-blue);
  text-decoration: none;
  font-size: 0.9rem;
}

.stat-link:hover {
  text-decoration: underline;
}

.admin-dashboard-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

@media (max-width: 992px) {
  .admin-dashboard-sections {
      grid-template-columns: 1fr;
  }
}

.recent-list {
  list-style: none;
  padding: 0;
}

.recent-list li {
  background: rgba(13, 2, 33, 0.5);
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  border-left: 3px solid var(--electric-blue);
}

.recent-list a {
  color: var(--neon-pink);
  text-decoration: none;
}

.recent-list a:hover {
  text-decoration: underline;
}

.recent-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--electric-blue);
  margin-top: 0.3rem;
}

.participation-user {
  font-weight: bold;
  color: var(--acid-green);
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.status-badge.draft {
  background-color: rgba(255, 165, 0, 0.2);
  color: orange;
}

.status-badge.public {
  background-color: rgba(0, 255, 65, 0.2);
  color: var(--matrix-green);
}

.status-badge.closed {
  background-color: rgba(255, 0, 0, 0.2);
  color: #ff6e6e;
}