/*
Theme Name: Fútbol Libre TV HD
Theme URI: https://futbollibretv.local
Author: Fútbol Libre Team
Author URI: https://futbollibretv.local
Description: Pixel-perfect, high-performance WordPress theme for Fútbol Libre & Pelota Libre sports streaming, live channels, match agendas, and multi-server Clappr/HLS players.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: futbollibre
Tags: sports, entertainment, two-columns, custom-menu, full-width-template, theme-options
*/

:root {
  --fhd-brand: #16a34a;
  --fhd-brand-dark: #15803d;
  --fhd-max-w: 66.666667%;
  --bg-page: #ffffff;
  --text-main: #1f2937;
  --text-muted: #4b5563;
  --border-color: #e5e7eb;
  --card-bg: #ffffff;
  --header-bg: #ffffff;
}

[data-theme="dark"], .dark-theme {
  --bg-page: #0b1120;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --card-bg: #0f172a;
  --header-bg: #0f172a;
}

html { margin-top: 0 !important; scroll-behavior: smooth; }
* { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-page);
  color: var(--text-main);
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Header */
header.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.75rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.06);
  background-color: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border-color);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  color: var(--fhd-brand);
  font-size: 1.55rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo span {
  color: #1f2937;
}
[data-theme="dark"] .logo span {
  color: #ffffff;
}

/* Navigation */
.navbar { display: flex; gap: 1.25rem; align-items: center; }
.navbar a {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.navbar a:hover, .navbar a.active { color: var(--fhd-brand); }

/* Dark mode toggle button */
.theme-toggle-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  border-radius: 9999px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}
[data-theme="dark"] .theme-toggle-btn {
  background: #1e293b;
  border-color: #334155;
  color: #f59e0b;
}

/* Mobile Toggle */
#menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.35rem;
}
.menu-icon { height: 1.6rem; width: 1.6rem; }

/* Mobile Menu Modal */
#menu-modal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 100;
  justify-content: center;
  align-items: center;
}
.modal-content {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  padding: 2rem 1.5rem;
  width: 90%;
  max-width: 400px;
  position: relative;
}
#menu-close {
  color: var(--text-muted);
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.modal-nav { display: flex; flex-direction: column; gap: 1rem; text-align: center; margin-top: 1.5rem; }
.modal-nav a {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}
.modal-nav a:hover {
  background-color: rgba(22, 163, 74, 0.1);
  color: var(--fhd-brand);
}

/* Main Container: EXACT 91.666667% / 66.666667% */
main, .main-frame, .watch-frame {
  margin: 1rem auto;
  width: 91.666667%;
  max-width: var(--fhd-max-w, 66.666667%);
  flex: 1;
}

h1.hero-title {
  text-align: center;
  font-size: 2.15rem;
  font-weight: 800;
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
  color: var(--fhd-brand-dark);
  line-height: 1.25;
}
[data-theme="dark"] h1.hero-title {
  color: #4ade80;
}

.description {
  text-align: left;
  margin-bottom: 1.25rem;
  font-size: 1.02rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.description a { color: var(--fhd-brand); text-decoration: underline; font-weight: 600; }

/* Agenda Section */
.agenda-section { margin-bottom: 2.5rem; }
#wraper {
  width: 100%;
  margin: 0 auto;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  border: 1px solid var(--border-color);
}
.agenda-header {
  background: linear-gradient(135deg, var(--fhd-brand) 0%, var(--fhd-brand-dark) 100%);
  color: white;
  text-align: center;
  padding: 0.85rem 1rem;
}
#title-agenda { font-size: 1.15rem; font-weight: 800; margin: 0; letter-spacing: 0.2px; text-transform: uppercase; }

#menu {
  margin: 0;
  padding: 0;
  background-color: var(--card-bg);
  list-style: none;
}
#menu > li {
  border-bottom: 1px solid var(--border-color);
  list-style: none;
  transition: background-color 0.15s ease;
}
#menu > li:last-child { border-bottom: none; }
#menu > li:hover { background-color: rgba(22, 163, 74, 0.04); }

.toggle-submenu { cursor: pointer; padding: 0.7rem 0.85rem; user-select: none; }
.toggle-submenu .match-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.match-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}
.match-time {
  width: 3.75rem;
  min-width: 3.75rem;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--fhd-brand-dark);
  background: #ecfdf5;
  padding: 5px 6px;
  border-radius: 6px;
  letter-spacing: -0.2px;
}
[data-theme="dark"] .match-time {
  background: #064e3b;
  color: #86efac;
}

.match-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
  background-color: #f1f5f9;
  padding: 2px;
}
.match-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
  word-break: break-word;
}
.match-dropdown-arrow {
  color: #9ca3af;
  font-size: 13px;
  transition: transform 0.2s ease;
}
.toggle-submenu.is-open .match-dropdown-arrow {
  transform: rotate(180deg);
  color: var(--fhd-brand);
}

.submenu {
  display: none;
  background-color: #f8fafc;
  padding: 0.6rem 0.85rem 0.6rem 4.5rem;
  border-top: 1px solid var(--border-color);
}
[data-theme="dark"] .submenu {
  background-color: #090e1a;
}
.submenu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  color: var(--text-main);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.15s;
  margin-bottom: 2px;
}
.submenu-item:hover {
  background-color: #ecfdf5;
  color: var(--fhd-brand-dark);
  padding-left: 0.95rem;
}
[data-theme="dark"] .submenu-item:hover {
  background-color: #064e3b;
  color: #86efac;
}
.submenu-item-left { display: flex; align-items: center; gap: 8px; }
.submenu-play-icon { width: 12px; height: 12px; color: var(--fhd-brand); }
.submenu-badge {
  font-size: 11px;
  font-weight: 700;
  background: #e2e8f0;
  color: #475569;
  padding: 2px 8px;
  border-radius: 9999px;
}
.submenu-item:hover .submenu-badge { background: var(--fhd-brand); color: #fff; }

/* Channels Section */
.channels-title {
  text-align: center;
  font-size: 1.85rem;
  margin-bottom: 1.75rem;
  margin-top: 2.5rem;
  font-weight: 700;
  color: var(--fhd-brand-dark);
}
[data-theme="dark"] .channels-title {
  color: #4ade80;
}
.cards-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.card {
  background-color: var(--card-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.12);
}
.card-image {
  height: 9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8fafc;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}
[data-theme="dark"] .card-image {
  background-color: #0b1120;
}
.card-image img {
  max-height: 5.5rem;
  max-width: 80%;
  object-fit: contain;
}
.card-content {
  padding: 1.25rem;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-content h3 {
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}
.card-content p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  flex: 1;
  line-height: 1.5;
}
.btn-watch {
  background-color: var(--fhd-brand);
  color: white !important;
  font-weight: 700;
  font-size: 13px;
  padding: 0.55rem 1.4rem;
  border-radius: 9999px;
  text-decoration: none;
  display: inline-block;
  align-self: center;
  transition: background-color 0.2s, filter 0.2s;
}
.btn-watch:hover { background-color: var(--fhd-brand-dark); filter: brightness(0.95); }

/* Player Views (channel.blade.php & watch.blade.php) */
.player-box {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  margin-bottom: 1.5rem;
}
.preframe, .iframe-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #000;
}
#embedIframe, #playerIframe, .iframe-container iframe, #clappr-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.player-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #0f172a;
  border-top: 1px solid #1e293b;
  flex-wrap: wrap;
}
.player-opt-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.channel-opt-btn {
  background: #1e293b;
  color: #f1f5f9;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #334155;
  cursor: pointer;
  transition: all 0.15s;
}
.channel-opt-btn:hover, .channel-opt-btn.active {
  background: var(--fhd-brand);
  color: #fff;
  border-color: var(--fhd-brand);
}

.btn-player-action {
  background: #334155;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s;
}
.btn-player-action:hover { background: #475569; }

/* Content Info SEO */
.content-info { margin-top: 3rem; }
.content-info h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--fhd-brand-dark);
  margin: 1.75rem 0 0.75rem;
}
[data-theme="dark"] .content-info h2 { color: #4ade80; }

/* Footer */
footer.site-footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  border-top: 1px solid #1e293b;
}
.footer-title { font-size: 0.875rem; font-weight: 600; color: #94a3b8; }
.redes { display: flex; gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.red-item {
  color: #cbd5e1;
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.15s;
  font-weight: 600;
}
.red-item:hover { color: #4ade80; }

/* Responsive Media Queries */
@media (max-width: 992px) {
  .cards-container { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .navbar { display: none; }
  #menu-toggle { display: flex; }
  main, .main-frame, .watch-frame { width: 95%; max-width: 95%; }
  .cards-container { grid-template-columns: repeat(2, 1fr); }
  .submenu { padding-left: 1rem; }
  footer.site-footer { flex-direction: column; gap: 1rem; text-align: center; }
}
@media (max-width: 480px) {
  .cards-container { grid-template-columns: 1fr; }
  .match-time { width: 3rem; min-width: 3rem; font-size: 12px; }
  .match-title { font-size: 13.5px; }
  h1.hero-title { font-size: 1.65rem; }
}
