
/* ========================= */
/* FILE: styles.css */
/* ========================= */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --dark-bg: #0f0f23;
  --card-bg: #1a1a2e;
  --text-primary: #ffffff;
  --text-secondary: #b8c5d6;
  --accent: #667eea;
  --accent-hover: #5a67d8;
  --glass-bg: rgba(26, 26, 46, 0.8);
  --glass-border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

:focus-visible {
  outline: 3px solid rgba(102, 126, 234, 0.9);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 1001;
  padding: 0.75rem 1rem;
  background: rgba(15, 15, 35, 0.95);
  color: #ffffff;
  border-radius: 999px;
  font-size: 0.95rem;
  text-decoration: none;
  transform: translateY(-120%);
  transition: transform 0.25s ease, opacity 0.25s ease;
  opacity: 0.9;
}

.skip-link:focus-visible,
.skip-link:hover {
  transform: translateY(0);
  opacity: 1;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  touch-action: manipulation;
}

.header {
  text-align: left;
  padding: 2rem 2rem 2rem 3rem;
  background: rgba(15, 15, 35, 0.3);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.view-toggle-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.9rem 1.3rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.view-toggle-btn:hover,
.view-toggle-btn:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
  outline: none;
}

.container.column-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
  width: min(340px, 100%);
  max-width: 340px;
  margin: 0 0 0 2rem;
  padding: 1.5rem 0 2rem;
}

.container.column-view .channel-card {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.channel-card img {
  display: block;
  width: auto;
  max-width: 80%;
  max-height: 160px;
  margin: 1rem auto 0 auto;
  object-fit: contain;
}

.header h1 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
  color: var(--text-primary);
}

.header p {
  margin: 0.5rem 0 0 0;
  opacity: 0.8;
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

@media (max-width: 768px) {
  .header {
    padding: 1.5rem 1rem 1.5rem 1.5rem;
  }

  .header h1 {
    font-size: 1.8rem;
  }

  .header p {
    font-size: 0.9rem;
  }
}

.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .container {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    padding: 1rem;
  }
}

.channel-card {
  background: rgba(26, 26, 46, 0.85);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 38px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  touch-action: manipulation;
  min-height: 240px;
}

.channel-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.channel-card:hover,
.channel-card:focus-visible {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
  border-color: rgba(102, 126, 234, 0.45);
}

.channel-card:hover::before,
.channel-card:focus-visible::before {
  opacity: 0.12;
}

.channel-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.channel-card:hover img {
  transform: scale(1.05);
}

.channel-info {
  padding: 1.2rem;
  text-align: center;
  position: relative;
  z-index: 2;
  background: linear-gradient(to top, rgba(30, 41, 59, 0.95), transparent);
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.channel-info h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
  .channel-info h3 {
    font-size: 1rem;
  }
}

/* Modal com Glassmorphism */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 35, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hidden {
  display: none;
}

.modal-content {
  position: relative;
  width: min(98%, 1100px);
  max-width: 1100px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(15, 15, 35, 0.6);
  border-bottom: 1px solid var(--glass-border);
}

.channel-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

#close-btn {
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#close-btn:hover {
  background: rgba(220, 38, 38, 0.9);
  transform: scale(1.1);
}

.modal-content iframe {
  width: 100%;
  height: clamp(320px, 55vh, 760px);
  border: none;
  border-radius: 0;
}

.modal-controls {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  background: rgba(15, 15, 35, 0.72);
  border-top: 1px solid var(--glass-border);
}

.modal-controls button {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 28px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  min-width: 150px;
}

.modal-controls button:hover,
.modal-controls button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.modal-controls button:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .header {
    padding: 1.5rem 1rem 1.5rem 1.5rem;
  }

  .header h1 {
    font-size: 1.8rem;
  }

  .header p {
    font-size: 0.95rem;
  }

  .container {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1rem;
  }

  .channel-card {
    min-height: 220px;
  }

  .channel-card img {
    height: 130px;
  }

  .channel-info h3 {
    font-size: 1rem;
  }

  .modal-header {
    padding: 0.8rem 1rem;
  }

  .channel-title {
    font-size: 1rem;
  }

  #close-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .modal-content {
    width: 100%;
    max-width: 100%;
    border-radius: 20px;
  }

  .modal-controls {
    padding: 0.8rem 1rem;
  }

  .modal-controls button {
    padding: 12px 18px;
    font-size: 0.95rem;
    min-width: unset;
    flex: 1;
  }
}

@media (max-width: 520px) {
  .header {
    padding: 1.2rem 1rem 1.2rem 1rem;
  }

  .channel-card img {
    height: 120px;
  }

  .channel-info {
    padding: 1rem;
  }
}

@media (min-width: 1200px) {
  .container {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    padding: 2rem 2.5rem;
  }
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 2rem;
  background: rgba(15, 15, 35, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

footer p {
  margin: 0;
  opacity: 0.6;
}

