/*
Theme Name: Livescore
Theme URI: https://sportcheap.xyz
Author: Novagon Sports
Author URI: https://sportcheap.xyz
Description: Theme WordPress hiển thị tỉ số bóng đá trực tiếp, kết quả thi đấu, lịch thi đấu và thông tin thể thao thời gian thực.
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: livescore
Tags: sports, livescore, football, responsive, clean, real-time
*/

/* ------------------------------------------------------------------------- *
 * RESET & BASE STYLES
 * ------------------------------------------------------------------------- */
:root {
  --primary-color: #308e61;
  --primary-dark: #236c49;
  --primary-light: #42c27e;
  --accent-lime: #cdf88b;
  --bg-main: #f5f6f8;
  --bg-table-header: #f2f4f7;
  --bg-table-hover: #fcf8e3;
  --bg-date-header: #eef3f7;
  --text-main: #212529;
  --text-muted: #6c757d;
  --text-live: #e02020;
  --score-blue: #0044bb;
  --score-red: #d90000;
  --border-color: #d8dde3;
  --border-light: #e5e9ee;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--bg-main);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------------------- *
 * SITE CONTAINER
 * ------------------------------------------------------------------------- */
.site-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 15px 15px 40px;
}

/* ------------------------------------------------------------------------- *
 * MAIN TOOLBAR (LIVESCORE CONTROL BAR)
 * ------------------------------------------------------------------------- */
.toolbar-livescore {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 4px 4px 0 0;
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.timezone-badge {
  font-weight: bold;
  color: #333;
  padding: 3px 8px;
  background: #f1f3f5;
  border-radius: 3px;
  border: 1px solid #d0d7de;
  font-size: 11px;
}

.hidden-count-badge {
  color: #dc3545;
  font-weight: bold;
  cursor: pointer;
  padding: 2px 6px;
}

.hidden-count-badge:hover {
  text-decoration: underline;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 3px;
  border: 1px solid #c8d0d8;
  background: #fdfdfd;
  color: #333;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.tool-btn:hover {
  background: #f0f2f5;
  border-color: #adb5bd;
}

.tool-btn.primary {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-dark);
}

.tool-btn.primary:hover {
  background: var(--primary-dark);
}

.nav-tabs-livescore {
  display: flex;
  gap: 2px;
}

.nav-tab-item {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 3px;
  cursor: pointer;
  color: #495057;
  border: 1px solid transparent;
}

.nav-tab-item.active {
  background: var(--primary-color);
  color: #ffffff;
}

.nav-tab-item:hover:not(.active) {
  background: #e9ecef;
}

/* Sound Toggle */
.toggle-setting-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  font-size: 11px;
}

.toggle-setting-item input[type="checkbox"] {
  cursor: pointer;
}

/* ------------------------------------------------------------------------- *
 * LIVESCORE TABLE
 * ------------------------------------------------------------------------- */
.livescore-table-container {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-top: none;
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.table-livescore {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 12px;
}

.table-livescore th {
  background-color: var(--bg-table-header);
  color: #495057;
  padding: 6px 4px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-light);
  white-space: nowrap;
}

.table-livescore th:last-child {
  border-right: none;
}

/* Date Row Group */
.date-header-row td {
  background-color: var(--bg-date-header);
  color: #1a446c;
  font-weight: bold;
  padding: 6px 12px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

/* Match Rows */
.match-row {
  border-bottom: 1px solid var(--border-light);
  transition: background-color 0.15s;
}

.match-row:hover {
  background-color: var(--bg-table-hover);
}

.match-row.hidden {
  display: none;
}

.match-row td {
  padding: 5px 4px;
  vertical-align: middle;
  border-right: 1px solid #f1f3f5;
}

.match-row td:last-child {
  border-right: none;
}

/* Column Dimensions */
.col-dp { width: 32px; }
.col-contest { width: 90px; text-align: left; padding-left: 6px !important; }
.col-time { width: 68px; }
.col-home { width: 30%; text-align: right; padding-right: 10px !important; font-weight: 500; }
.col-score { width: 85px; font-weight: bold; font-size: 13px; }
.col-away { width: 30%; text-align: left; padding-left: 10px !important; font-weight: 500; }
.col-ht { width: 50px; color: #777; font-size: 11px; }
.col-tools { width: 130px; }

/* Contest League Badge */
.league-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: bold;
  color: #ffffff;
  max-width: 85px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* Specific League Colors */
.league-badge.epl { background-color: #38003c; }
.league-badge.laliga { background-color: #ee1924; }
.league-badge.serie-a { background-color: #024494; }
.league-badge.bundesliga { background-color: #d20515; }
.league-badge.ligue-1 { background-color: #091c3e; }
.league-badge.c1 { background-color: #0b1a3d; }
.league-badge.vleague { background-color: #d32f2f; }
.league-badge.default { background-color: #3b82f6; }

/* Match Status & Timing */
.match-time-live {
  color: var(--text-live);
  font-weight: bold;
  animation: pulse-live 2s infinite ease-in-out;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.match-time-ft {
  color: #6c757d;
  font-weight: bold;
}

.match-time-sched {
  color: #212529;
}

/* Team Ranks & Cards */
.team-rank {
  color: #888;
  font-size: 10px;
  margin: 0 2px;
  font-weight: normal;
}

.red-card, .yellow-card {
  display: inline-block;
  width: 9px;
  height: 12px;
  border-radius: 1px;
  margin: 0 2px;
  vertical-align: middle;
}

.red-card { background-color: #dc3545; }
.yellow-card { background-color: #ffc107; }

/* Score styling */
.score-box {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: bold;
  letter-spacing: 1px;
  color: var(--score-blue);
  cursor: pointer;
}

.score-box.live {
  color: var(--score-red);
}

.score-box.flash-goal {
  animation: flash-goal 1s ease-in-out 3;
}

@keyframes flash-goal {
  0%, 100% { background-color: transparent; }
  50% { background-color: #ffecb3; transform: scale(1.1); }
}

/* Tools icons */
.tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin: 0 1px;
  border-radius: 2px;
  font-size: 11px;
  color: #555;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  cursor: pointer;
}

.tool-icon:hover {
  background: #e9ecef;
  color: #000;
}

.tool-icon.icon-video {
  color: #e02020;
}

.tool-icon.icon-tips {
  color: #ff6f00;
  font-weight: bold;
  font-size: 10px;
  width: auto;
  padding: 0 4px;
}

/* ------------------------------------------------------------------------- *
 * MODAL DIALOGS
 * ------------------------------------------------------------------------- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-content-livescore {
  background: #ffffff;
  border-radius: 6px;
  width: 90%;
  max-width: 650px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  overflow: hidden;
}

.modal-header-livescore {
  background: var(--primary-color);
  color: #ffffff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: bold;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-body-livescore {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer-livescore {
  padding: 10px 16px;
  background: #f8f9fa;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.league-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.league-filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
  border-radius: 3px;
}

.league-filter-item:hover {
  background-color: #f1f3f5;
}

/* Toast Notifications */
.goal-toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.goal-toast {
  background: #212529;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 6px;
  border-left: 5px solid var(--primary-light);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ------------------------------------------------------------------------- *
 * RESPONSIVE MOBILE ADJUSTMENTS
 * ------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .site-wrapper {
    padding: 0 0 20px 0;
  }
  .toolbar-livescore {
    border-radius: 0;
  }
  .col-dp, .col-tools, .col-ht {
    display: none;
  }
  .col-contest {
    width: 60px;
  }
  .league-badge {
    max-width: 55px;
    font-size: 10px;
  }
  .col-home, .col-away {
    font-size: 11px;
  }
  .col-score {
    width: 60px;
  }
}
