html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

:root {
  --club-primary: #003087;
  --club-secondary: #ffffff;
  --club-text-on-primary: #ffffff;
}

/* Base layout */
body {
  margin-bottom: 60px;
}

/* Focus states */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--club-primary);
}

/* Reusable hover shadow */
.hover-shadow {
  transition: all 0.3s ease;
}

.hover-shadow:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15) !important;
}

/* =========================================================
   CLUB THEME HELPERS
   ========================================================= */

.club-primary {
  background-color: var(--club-primary) !important;
  color: var(--club-text-on-primary) !important;
}

.club-secondary {
  background-color: var(--club-secondary) !important;
}

.club-text-primary {
  color: var(--club-primary) !important;
}

.club-text-secondary {
  color: var(--club-secondary) !important;
}

.club-border-primary {
  border-color: var(--club-primary) !important;
}

/* Text inside primary-colour sections should stay readable */
.club-primary h1,
.club-primary h2,
.club-primary h3,
.club-primary h4,
.club-primary h5,
.club-primary h6,
.club-primary p,
.club-primary .lead,
.club-primary .card-title {
  color: var(--club-text-on-primary) !important;
}

.club-primary a {
  color: var(--club-text-on-primary);
}

.club-primary a:hover {
  color: var(--club-secondary);
}

/* Navbar */
.club-primary .navbar-brand,
.club-primary .nav-link {
  color: var(--club-text-on-primary) !important;
}

.club-primary .nav-link:hover,
.club-primary .navbar-brand:hover {
  opacity: 0.85;
}

/* Card headers default to club primary */
.card-header {
  background-color: var(--club-primary) !important;
  color: var(--club-text-on-primary) !important;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
  color: var(--club-text-on-primary) !important;
}

/* General headings */
h2,
h3,
.card-title {
  color: var(--club-primary);
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn-club-primary {
  background-color: var(--club-primary);
  border-color: var(--club-primary);
  color: var(--club-text-on-primary);
}

.btn-club-primary:hover,
.btn-club-primary:focus {
  filter: brightness(90%);
  color: var(--club-text-on-primary);
}

/* Optional override if you want Bootstrap primary buttons themed */
.btn-primary {
  background-color: var(--club-primary);
  border-color: var(--club-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--club-primary);
  border-color: var(--club-primary);
  filter: brightness(90%);
}

/* =========================================================
   PAGE / SECTION HEADINGS
   ========================================================= */

.page-heading,
.section-heading,
.matches-heading,
.player-name-heading {
  color: var(--club-primary);
  font-weight: 800;
}

.section-heading {
  font-weight: 700;
}

/* =========================================================
   SPONSORS
   ========================================================= */

.sponsor-type-heading {
  color: var(--club-primary);
  font-weight: 700;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.4rem;
}

.sponsor-card {
  border-radius: 0.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sponsor-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.12) !important;
}

.sponsor-logo-wrap {
  height: 110px;
  padding: 1rem 1rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sponsor-logo {
  max-height: 90px;
  max-width: 100%;
  object-fit: contain;
}

.sponsor-name {
  color: var(--club-primary);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

/* =========================================================
   PLAYERS
   ========================================================= */

.player-profile-image {
  width: 100%;
  object-fit: cover;
}

.player-card-image {
  object-fit: cover;
  border: 5px solid var(--club-primary);
}

.player-number-badge {
  background-color: #212529;
  color: #ffffff;
}

/* =========================================================
   MATCH / FIXTURE CARDS
   ========================================================= */

.match-card {
  transition: all 0.3s ease;
}

.match-team-logo {
  height: 50px;
  width: 50px;
  object-fit: contain;
}

/* =========================================================
   HOME PAGE HELPERS
   ========================================================= */

.hero-section {
  background-size: cover;
  background-position: center;
  height: 70vh;
  min-height: 500px;
}

.hero-overlay {
  background: rgba(0, 0, 0, 0.45);
}

.club-section {
  background-color: var(--club-primary);
  color: var(--club-text-on-primary);
}

.club-section h1,
.club-section h2,
.club-section h3,
.club-section h4,
.club-section h5,
.club-section h6,
.club-section p,
.club-section .lead {
  color: var(--club-text-on-primary) !important;
}

.squad-carousel-image {
  width: 170px;
  height: 170px;
  object-fit: cover;
  border: 5px solid var(--club-primary);
}

/* =========================================================
   FORMS
   ========================================================= */

.form-control:focus,
.form-select:focus {
  border-color: var(--club-primary);
  box-shadow: 0 0 0 0.25rem rgba(0, 48, 135, 0.25);
}

/* =========================================================
   UTILITIES
   ========================================================= */

.text-on-club-primary {
  color: var(--club-text-on-primary) !important;
}

.bg-club-primary {
  background-color: var(--club-primary) !important;
}

.border-club-primary {
  border-color: var(--club-primary) !important;
}

.nav-tabs .nav-link {
  color: var(--club-primary);
}

.nav-tabs .nav-link.active {
  color: #212529;
  font-weight: 600;
}

.btn-outline-primary {
  color: var(--club-primary);
  border-color: var(--club-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--club-primary);
  border-color: var(--club-primary);
  color: var(--club-text-on-primary);
}

.gallery-album-cover {
  height: 240px;
  width: 100%;
  object-fit: cover;
}

.gallery-photo-thumb {
  height: 190px;
  width: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-photo-thumb:hover {
  transform: scale(1.02);
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.18) !important;
}

.gallery-match-thumb {
  height: 180px;
  width: 100%;
  object-fit: cover;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-match-thumb:hover {
  transform: scale(1.02);
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.18) !important;
}

.news-body {
  font-size: 1.1rem;
  line-height: 1.8;
}

.news-body img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.league-table-wrapper {
  border-radius: 0.75rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08);
}

.league-table {
  margin-bottom: 0;
}

.league-table thead {
  background: var(--club-primary);
  color: var(--club-text-on-primary);
}

.league-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.league-table td {
  white-space: nowrap;
}

.league-table-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.league-table-current-club {
  background: rgba(0, 48, 135, 0.08);
}

.league-table-current-club td:first-child {
  border-left: 4px solid var(--club-primary);
}

.form-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0 1px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.form-badge:hover {
  color: #fff;
  opacity: 0.85;
}

.form-win {
  background: #198754;
}

.form-draw {
  background: #6c757d;
}

.form-loss {
  background: #dc3545;
}

.form-unknown {
  background: #adb5bd;
}

.admin-dashboard-card {
  border: 0;
  border-radius: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.admin-dashboard-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.75rem 1.75rem rgba(0, 0, 0, 0.12) !important;
}

.admin-dashboard-card .card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.admin-dashboard-card .card-text {
  min-height: 42px;
}

.admin-dashboard-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--club-primary);
  color: var(--club-text-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.club-tv-section {
  padding: 2rem 0 3rem;
}

.club-tv-card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 1rem;
  overflow: hidden;
}

.club-tv-video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

.club-tv-video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.club-tv-empty {
  text-align: center;
  padding: 3rem 1.5rem;
}

.club-tv-empty h2 {
  margin-bottom: 0.75rem;
}

.club-tv-video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

.club-tv-video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.club-tv-section {
  padding: 2rem 0 3rem;
}

.club-tv-card,
.club-tv-featured-card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  overflow: hidden;
}

.club-tv-video-wrapper {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

.club-tv-video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.club-tv-featured-content {
  max-width: 1100px;
  margin: 1.5rem auto 0;
}

.club-tv-featured-content h2 {
  margin-bottom: 0.5rem;
}

.club-tv-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.club-tv-item {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.club-tv-thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.club-tv-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.club-tv-play-button {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
}

.club-tv-item-content {
  padding: 1rem;
}

.club-tv-item-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.club-tv-item-content p {
  margin-bottom: 0;
  color: #6c757d;
}

.club-tv-empty {
  text-align: center;
  padding: 3rem 1.5rem;
}

.club-tv-empty h2 {
  margin-bottom: 0.75rem;
}

@media (max-width: 991px) {
  .club-tv-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .club-tv-grid {
    grid-template-columns: 1fr;
  }

  .club-tv-card,
  .club-tv-featured-card {
    padding: 1rem;
  }
}
.club-tv-video-wrapper.featured {
  position: relative;
  padding-top: 56.25%; /* 16:9 ratio */
  height: 0;
  overflow: hidden;
  border-radius: 12px;
}

.club-tv-video-wrapper.featured iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.club-tv-video-wrapper.small {
  position: relative;
  padding-top: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
}

.club-tv-video-wrapper.small iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Grid layout */
.club-tv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 30px;
}

.club-tv-item {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.club-tv-item:hover {
  transform: translateY(-5px);
}