/* ======================== VARIABLES (NEW) ======================== */
:root {
  --green-main: rgb(47, 138, 47);
  --green-dark: rgb(30, 110, 30);
  --green-light: rgba(144, 238, 144, 0.95);
  --green-hover: rgb(89, 195, 62);
  --text-dark: #1e4d1e;
  --light-gray: #f5f5f5;
  --card-bg: #ffffff;
}

/* ======================== BASE ======================== */
html {
  height: 100%;
  overflow-x: hidden;
  background: var(--green-dark);
}

body {
  height: 100%;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, var(--green-main), var(--green-dark));
}

a {
  text-decoration: none;
}

iframe {
  height: 25vh;
  width: auto;
}

h1,
p {
  margin: 0 auto;
  color: rgb(9, 61, 9);
}

/* ========================= Site Hero Image ==============================*/
.hero-wrapper {
  width: min(100%, 1260px);
  margin: 0 auto;
  height: clamp(300px, 34vw, 500px);
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.hero-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

/* ---------- Responsive Layout Breakpoints ---------- */
@media (max-width: 992px) {
  .hero-wrapper {
    width: calc(100% - 20px);
    height: 320px;
    border-radius: 16px;
  }
  .hero-image {
    object-position: center 38%;
  }
}

@media (max-width: 768px) {
  .hero-wrapper {
    width: calc(100% - 12px);
    height: 240px;
    border-radius: 12px;
  }
  .hero-image {
    object-position: center 35%;
  }
  /* Consolidated from Standings Section */
  .movers-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================= TABLES ================================*/
th,
td {
  border: 2px solid #dddddd;
}

/* Visual indicators for sorting */
th.sort-asc::after {
  content: " ▲";
  position: absolute;
  right: 8px;
}

th.sort-desc::after {
  content: " ▼";
  position: absolute;
  right: 8px;
}

.container,
.container-fluid {
  background: transparent;
}

/* ======================== MAIN LAYOUT ======================== */
.main-wrapper {
  width: 100%;
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--green-main), var(--green-dark));
}

.center-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  text-align: center;
}

.center-content p {
  font-size: clamp(12px, 3.5vw, 20px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 4px 0;
}

/* ======================== TEE TABLES ============================ */
.table-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 10px 0 14px;
  padding: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
}

.tee-table {
  width: auto;
  margin: 0 auto;
  border-collapse: collapse;
  table-layout: auto;
}

.tee-table th,
.tee-table td {
  border: 2px solid black;
  padding: 10px 12px;
  text-align: center;
  font-size: clamp(14px, 2vw, 18px);
}

.table-date th {
  background: rgba(0, 0, 0, 0.2);
  color: white;
}

.table-times th {
  background: rgba(0, 0, 0, 0.1);
  color: white;
  font-weight: 600;
}

.tee-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.1);
}

/* ===================== FOOTER START ====================*/
.site-footer {
  margin-top: auto;
  padding: 14px 20px;
  background: lightgreen;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
}

.footer-content a {
  color: var(--text-dark);
}

.footer-content a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .footer-content {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}

/* ======================= LANDSCAPE FALLBACKS ======================= */
@media (max-height: 500px) and (orientation: landscape) {
  .center-content {
    max-width: 100%;
    padding: 10px;
  }
  .center-content p {
    font-size: clamp(10px, 2.5vw, 14px);
  }
}

/* ======================= WINNERS / CARDS ======================= */
.badge {
  background: gold;
  color: black;
  font-size: 10px;
  padding: 2px 6px;
  margin-left: 6px;
  border-radius: 6px;
}

#loading-indicator {
  display: none;
  text-align: center;
  font-weight: bold;
  padding: 10px;
}

.winners {
  margin-top: 20px;
  max-width: 500px;
  width: 100%;
}

.winner-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border-left: 4px solid rgba(144, 238, 144, 0.5);
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.winner-card:hover {
  background: rgba(0, 0, 0, 0.35);
  transform: translateX(3px);
}

.winner-place {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
  color: rgb(98, 228, 98);
}

.winner-name {
  font-size: 1.05rem;
  font-weight: 600;
}

.winner-score {
  font-size: 1.1rem;
  font-weight: 700;
  color: #90ee90;
}

/* Combined Medal Rules (Classes and Nth-child logic combined seamlessly) */
.winner-card:nth-child(1),
.winner-card.gold {
  border-left-color: gold;
}
.winner-card:nth-child(2),
.winner-card.silver {
  border-left-color: silver;
}
.winner-card:nth-child(3),
.winner-card.bronze {
  border-left-color: #cd7f32;
}

.winner-card.gold .winner-name {
  color: #ffd700;
}
.winner-card.silver .winner-name {
  color: #c0c0c0;
}
.winner-card.bronze .winner-name {
  color: #cd7f32;
}

.winners-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  font-family: "Inter", sans-serif;
}

.winners-icon {
  font-size: 1.2rem;
}

.winners-title {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* ======================= VIDEO & MEDIA ======================= */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.2s ease;
}

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

.video-caption,
.media-caption {
  font-size: 12px;
  text-align: center;
  color: #c8f7c5;
}

.video-caption {
  margin-top: 6px;
}

/*============================ NEW MEDIA CSS (video/image) ============================*/
.media-card {
  transition: transform 0.2s ease;
}

.media-card:hover {
  transform: translateY(-4px);
}

.media-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.25s ease;
}

.image-wrapper:hover img {
  transform: scale(1.05);
}

.media-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 6px 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.25s ease;
}

.media-wrapper:hover .media-caption {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: none) {
  .media-caption {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ======================== GALLERY HEADER ======================== */
.gallery-header {
  text-align: center;
  padding: 20px 10px 10px;
  margin-bottom: 10px;
}

.gallery-header h1 {
  font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.gallery-header p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.3px;
}

.gallery-header::after {
  content: "";
  display: block;
  width: 40px;
  height: 1px;
  margin: 10px auto 0;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
}

/*=============== STANDINGS SECTION =================*/
.movers-container {
  max-width: 800px;
  margin: 2rem auto;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  overflow: hidden;
  background: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.movers-header {
  color: white;
  text-align: center;
  padding: 0.9rem;
  font-weight: 700;
  background: linear-gradient(135deg, #1b4332, #2d6a4f);
}

.movers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
}

.movers-column {
  padding: 0.5rem;
}

.movers-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.movers-subtitle {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-top: 0.25rem;
}

.mover-panel {
  border-radius: 12px;
  padding: 1rem;
}

.up-panel {
  background: rgba(25, 135, 84, 0.08);
}

.down-panel {
  background: rgba(220, 53, 69, 0.08);
}

.panel-title {
  text-align: center;
  font-weight: 700;
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.mover-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.4rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.mover-name {
  font-weight: 600;
}

.movers-up-heading,
.trend-up {
  color: #198754;
}

.movers-down-heading,
.trend-down {
  color: #dc3545;
}

.movers-up-heading,
.movers-down-heading {
  text-align: center;
}

.trend-up,
.trend-down {
  font-weight: 800;
  font-size: 1.1rem;
}

.top-mover {
  border-left: 4px solid gold;
  background: rgba(255, 215, 0, 0.12);
}

.top-faller {
  border-left: 4px solid #dc3545;
}

/*=============== FORM STYLE ==================*/
.player-form-card {
  padding: 1.5rem;
  border-radius: 12px;
  background-color: var(--card-bg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
/* ========================= FORM SECTIONS ========================= */
.form-section {
  margin-bottom: 1rem;
}
.form-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 0.4rem;
}
/* ========================= LABELS ========================= */
.form-label {
  font-weight: 500;
  display: block;
  margin-bottom: 0.3rem;
}
/* ========================= INPUTS & TEXTAREAS ========================= */
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: 2px solid #d8e8d8;
  font-size: 1rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
  background: rgba(255, 255, 255, 0.96);
}
.form-control:focus {
  border-color: var(--green-main);
  box-shadow: 0 0 0 4px rgba(47, 138, 47, 0.15);
  outline: none;
  transform: translateY(-1px);
}
/* ========================= BUTTON ========================= */
.btn-submit-player {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background-color: var(--green-main);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}
.btn-submit-player:hover {
  background-color: var(--green-dark);
  transform: translateY(-1px);
}
.btn-submit-player:disabled {
  background-color: #a3cfa3;
  cursor: not-allowed;
  transform: none;
}
/* ========================= GRID-BASED RECIPIENT LIST ========================= */
.recipient-list-container {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 5px;
}
.recipient-list-container::-webkit-scrollbar {
  width: 6px;
}
.recipient-list-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}
.recipient-list-container::-webkit-scrollbar-thumb {
  background: #c2dec2;
  border-radius: 10px;
}
.recipient-grid-item {
  padding: 0.6rem 1rem;
  border: 2px solid #d8e8d8;
  border-radius: 10px;
  font-size: 0.95rem;
  word-break: break-all;
  display: block;
  text-align: center;
  background-color: rgba(47, 138, 47, 0.03);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease-in-out;
}
/* Style for highlighted email cards */
.recipient-grid-item.selected {
  background-color: var(--green-main);
  color: white;
  border-color: var(--green-dark);
  font-weight: 600;
  box-shadow: 0 4px 8px rgba(47, 138, 47, 0.2);
}
/* ========================= RESPONSIVE ========================= */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }
  .gallery-header {
    padding: 1.25rem;
  }
  .player-form-card {
    padding: 1.25rem;
  }
  .btn-submit-player {
    width: 100%;
  }
}
