* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #1a1a1a;
  --secondary-color: #141414;
  --accent-color: #e50914;
  --text-color: #ffffff;
  --text-secondary: #b3b3b3;
  --hover-color: #f5f5f1;
  --card-bg: #2f2f2f;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--primary-color);
  color: var(--text-color);
  overflow-x: hidden;
}

/* Header/Navegación */
header {
  background: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, transparent 100%);
  padding: 20px 40px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -2px;
  color: var(--accent-color);
}

nav {
  display: flex;
  gap: 30px;
}

nav a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  font-size: 1rem;
}

nav a:hover {
  color: var(--accent-color);
}

/* Main Content */
main {
  margin-top: 80px;
  padding: 0;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 30px;
  margin-top: 30px;
}

/* Grid para eventos y canales */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.content-card {
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease, filter 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
  height: 350px;
}

.content-card:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
}

.content-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.9) 100%);
  padding: 30px 20px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.content-card:hover .card-overlay {
  opacity: 1;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}

.card-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.card-actions {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background-color: var(--accent-color);
  color: white;
}

.btn-primary:hover {
  background-color: #f40812;
  transform: scale(1.05);
}

.btn-secondary {
  background-color: var(--text-secondary);
  color: black;
}

.btn-secondary:hover {
  background-color: var(--text-color);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Player */
.player-container {
  background: black;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 30px;
}

.player-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
}

.player-wrapper iframe,
.player-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Fullscreen player specifically for event page */
#playerWrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100%;
  z-index: 1000;
  background: #000;
}

#playerWrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ensure iframe sits below overlays */
#playerWrapper iframe { z-index: 1; }

/* Modal para selección de canales */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.channel-overlay {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.95) 0%, rgba(40, 40, 40, 0.95) 100%);
  border-top: 2px solid var(--accent-color);
  border-left: 2px solid var(--accent-color);
  border-right: 2px solid var(--accent-color);
  border-radius: 16px;
  padding: 30px;
  width: min(100%, 450px);
  animation: slideUp 0.3s ease;
  z-index: 1001;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.channel-overlay h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-overlay {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-overlay:hover {
  color: var(--accent-color);
}

.channel-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.channel-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-color);
  transform: translateX(5px);
}

.channel-item.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.channel-logo {
  width: 60px;
  height: 40px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  padding: 5px;
}

.event-detail {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  align-items: start;
}

.event-player-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.event-info h2,
.event-info p {
  margin-bottom: 12px;
}

.player-wrapper {
  background: #111;
  border-radius: 12px;
  overflow: hidden;
  min-height: 420px;
}

.player-wrapper iframe {
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: none;
}

/* Fullscreen-style player and overlay for event page */
.player-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
}

.channel-dropdown {
  position: fixed;
  top: 0;
  right: 0;
  width: min(360px, 90vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 16px;
  gap: 18px;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.channel-dropdown.visible {
  opacity: 1;
  pointer-events: auto;
}

.channel-toggle {
  align-self: flex-end;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: rgba(0,0,0,0.65);
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(0,0,0,0.35);
}

.channel-menu {
  flex: 1;
  background: rgba(10,10,10,0.98);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  box-shadow: -10px 20px 60px rgba(0,0,0,0.6);
}

.channel-menu .channel-item { background: transparent; }

#channelList,
#channelOptionList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#channelList {
  flex: 1;
  min-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

#channelOptionList {
  max-height: 260px;
  overflow-y: auto;
}

.channel-option-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
}

.channel-option-row.default-option {
  border-color: var(--accent-color);
  background: rgba(229, 9, 20, 0.1);
}

.channel-option-meta {
  flex: 1;
  min-width: 0;
}

.channel-option-title {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.channel-option-link {
  font-size: 0.8rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.channel-option-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.channel-option-actions button {
  min-width: 40px;
  padding: 6px 10px;
}

.channel-option-default {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
}

.channel-option-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.channel-option-link {
  font-size: 0.85rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.channel-option-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.channel-option-default {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-color);
}

.channel-option-default input {
  width: auto;
}

.channel-option-actions .btn {
  width: 100%;
}

.channel-option-actions .btn-small {
  width: auto;
}

.channel-option-actions button {
  min-width: 40px;
}

.channel-option-actions button:hover {
  transform: none;
}

/* option-badge removed: options show name only */

/* hide the aside panel on small screens to prioritize player */
@media (max-width: 980px) {
  .event-options-panel { display: none; }
  .player-wrapper { height: calc(100% - 0px); }
}

.event-options-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
}

.event-options-panel .panel-header {
  margin-bottom: 20px;
}

@media (max-width: 980px) {
  .event-detail {
    grid-template-columns: 1fr;
  }
}

.channel-details {
  flex: 1;
}

.channel-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 3px;
}

.channel-badge {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.channel-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.channel-suboptions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 10px;
}

.channel-option-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.channel-option-item:hover {
  background: rgba(255,255,255,0.08);
}

.channel-option-item.active {
  background: rgba(249, 34, 47, 0.15);
}

.channel-option-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--card-bg);
  border-radius: 4px;
  background-color: var(--secondary-color);
  color: var(--text-color);
  font-family: inherit;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.2);
}

/* Footer */
footer {
  background-color: var(--secondary-color);
  padding: 40px;
  text-align: center;
  border-top: 1px solid var(--card-bg);
  margin-top: 60px;
}

footer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 20px;
  }

  header h1 {
    font-size: 1.8rem;
  }

  nav {
    gap: 15px;
    font-size: 0.9rem;
  }

  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .content-card {
    height: 220px;
  }

  .channel-overlay {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .container {
    padding: 20px 15px;
  }
}
