/* ============================= */
/*       COLOR VARIABLES         */
/* ============================= */

:root {
  /* Buttons */
  --btn-add-to-cart-bg: #e4bc1c;              /* Dark Neutral Button */
  --btn-add-to-cart-bg-hover: #bf9d17;        /* Slightly Lighter Hover */
  --btn-disabled-bg: #bfbfbf;                 /* Disabled State Gray */

  /* Input & Form */
  --input-bg-default: #f5f5f5;                /* Light Gray */
  --input-bg-secondary: #eaeaea;              /* Slightly Darker Gray */
  --input-border: #cccccc;                    /* Standard Gray Border */
  --input-focus-outline: #999999;             /* Soft Focus Gray */

  /* Price & Status */
  --price-badge-bg: rgba(0, 0, 0, 0.05);       /* Faint Gray Badge */
  --price-sold-out: #a33a3a;                  /* Muted Red for Sold Out */
  --price-tag: #03a800;

  /* Progress Bar */
  --progress-bg: #dcdcdc;
  --progress-bar-bg: #dcdcdc;
  --progress-bar-color: #4a4a4a;

  /* Text */
  --text-main: #1c1c1c;                       /* Charcoal Black */
  --text-muted: #6e6e6e;                      /* Mid Gray */

  /* Backgrounds */
  --bg-white: #ffffff;                        /* Pure White */

  /* Cards & Shadows */
  --card-shadow: rgba(0, 0, 0, 0.05);          /* Subtle Shadow */
  --card-shadow-hover: rgba(0, 0, 0, 0.15);    /* Deeper Shadow on Hover */

  /* Pagination */
  --pagination-btn-bg: #f0f0f0;               /* Light Neutral */
  --pagination-btn-hover-bg: #d9d9d9;         /* Subtle Hover Gray */

  --card-pending: #337ab7;
  --card-soldout: #a33a3a;

  --bright-red: #e63946;
}


/* ============================= */
/*     COMPETITIONS SECTION      */
/* ============================= */

.ticket-qty-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-direction: column;
}

.qty-slider,
.qty-slider-wrapper {
    width: 100%;
}

.qty-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.qty-button-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    margin-left: 20px;
}

.raffle-msg {
    font-style: italic;
    font-size: smaller;
    color: white;
}

.postal-msg {
    font-size: smaller;
    font-style: italic;
    color: black;
    padding: 2px 2px;
}

img.raffle-plus-icon,
img.raffle-minus-icon {
    max-width: 60% !important;
}

.qty-btn {
    background-color: #e4bc1c;
    border: 1px solid #e4bc1c;
    padding: 0; /* Remove extra padding for a perfect circle */
    font-size: 1.4rem;
    cursor: pointer;
    border-radius: 50%;
    height: 30px;
    width: 30px;
    display: flex;
    justify-content: center;
    align-items: center; /* Center the content vertically */
    font-weight: 900;
}

.qty-btn:hover {
    opacity: 0.8;
}

.qty-display {
    min-width: 24px;
    text-align: center;
    font-weight: bold;
}

.qty-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #ddd; /* Default track color */
    border-radius: 4px;
    outline: none;
    transition: background 0.3s ease;
}

.qty-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 12px;
    background: linear-gradient(to right, #e4bc1c 0%, #e4bc1c 0%, #ddd 0%, #ddd 100%);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.qty-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: #ffffff; /* Light thumb */
    border: 2px solid #e4bc1c; /* Accent border */
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2); /* Soft shadow */
    cursor: pointer;
}

.qty-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: #ffffff;
    border: 2px solid #e4bc1c;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.no-competitions-found {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.5em;
  font-weight: bold;
  position: relative;
  transition: color 0.3s ease;
  text-align: center;
}

.no-competitions-redirect-link {
  color: #e4bc1c;
  text-decoration: none;
  font-size: 1.1em;
  font-weight: bold;
  position: relative;
  transition: color 0.3s ease;
}

.no-competitions-redirect-link:hover {
  color: #9b8012;
}

.competitions-main {
  position: relative;
}

.competitions-section {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 20px;
  padding-top: 20px;
  padding-left: 25px;
  padding-right: 25px;
  margin: 0 auto;
  background-color: #fafafa;
}

.competitions-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 10px;
  border-bottom: 3px solid var(--btn-add-to-cart-bg);
  padding-bottom: 10px;
  text-align: left;
  color: var(--text-main);
  -khtml-user-select: none;
  -o-user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  user-select: none; 
}

.competition-card {
  background-color: var(--bg-white);
  border-radius: 16px;
  border: 1px solid #e1e1e1;
  box-shadow: 0 12px 30px -5px var(--card-shadow), 0 4px 10px -6px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  width: 100%;
  max-width: 95%;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0.50rem;
  -khtml-user-select: none;
  -o-user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Mobile Responsiveness Testing w/ active */
.competition-card.active,
.competition-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px var(--card-shadow-hover);
}

.competition-card:hover .comp-id-badge {
  opacity: 1;
}

.competition-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.competition-top {
  display: flex;
  justify-content: center;
  flex-flow: column; /* TEMP */
  position: relative;
  align-items: center;
}

@keyframes slideDownUp {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  10% {
    transform: translateY(0);
    opacity: 1;
  }
  90% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-100%);
    opacity: 0;
  }
}

.inline-error-message {
  position: absolute;
  top: 5px;
  transform: translateX(-50%);
  background: rgb(255, 244, 229);
  border: 1px solid rgb(255, 167, 38);
  color: rgb(230, 81, 0);
  /* border: 1px solid #e1e1e1; Match card border */
  /* box-shadow: 0 6px 12px var(--card-shadow); Same as card */
  font-weight: 500;
  padding: 15px 20px;
  border-radius: 12px;
  font-size: 0.9rem;
  z-index: 2;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  text-align: center;
  max-width: 100%;
  line-height: 1.4;
}

.inline-error-message.show {
  opacity: 1;
  transform: translateY(0);
  font-size: 0.8rem;
  font-weight: 700;
}

.inline-error-message.hidden {
  opacity: 0;
  transform: translateY(-10px);
  font-size: 0.8rem;
  font-weight: 700;
}

.input-error-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  align-content: center;
  gap: 10px;
  width: 100%;
}

.image-wrapper {
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
}

.comp-id-badge {
  position: absolute;
  top: 0px;
  right: 0px;
  color: rgba(0, 0, 0, 0.4);
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 4px;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
}

/*
.competition-card.pending .comp-id-badge,
.competition-card.sold-out .comp-id-badge {
  position: absolute;
  top: 0px;
  right: 0px;
  color: rgba(0, 0, 0, 0.4);
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 4px;
  z-index: 10;
  pointer-events: none;
}
*/

.image-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.competition-details {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.competition-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.competition-price {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--btn-add-to-cart-bg);
  border-radius: 8px;
  text-align: center;
  display: block;
  margin-bottom: 15px;
}

.competition-progress {
  display: flex;
  justify-content: center;
}

.competition-card .competition-footer {
    border-top: 1px solid var(--btn-add-to-cart-bg);
    margin-top: 10px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px;
}

.competition-header {
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 0;
  font-weight: bold;
  font-size: 1.25rem; /* or whatever you're using */
  line-height: 1.2; /* Controls vertical spacing */
  height: 2.5em; /* Fixed height: adjust depending on expected text */
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Max number of lines */
  -webkit-box-orient: vertical;
}

.competition-card.pending .competition-footer {
  border-top: 1px solid var(--card-pending);
  margin-top: 10px;
  width: 265px;
}

.competition-card.sold-out .competition-footer {
  border-top: 1px solid var(--card-soldout);
  margin-top: 10px;
  width: 265px; 
}

.competition-card.pending .competition-price,
.competition-card.sold-out .competition-price {
  margin-bottom: 30px;
}

.competition-footer-default {
  display: block;
  padding: 5px;
}

.competition-footer-hover {
  display: none;
}

/* Hover or active behavior for footers */
.competition-card:hover .competition-footer-default,
.competition-card.active .competition-footer-default {
  display: none;
  opacity: 1;
  pointer-events: auto;
}

.competition-card:hover .competition-footer-hover,
.competition-card.active .competition-footer-hover {
  display: flex;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  opacity: 1;
  pointer-events: auto;
}

.competitions-controls {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-top: 20px;
}

.competition-type-navs a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.1em;
  font-weight: bold;
  position: relative;
  transition: color 0.3s ease;
  -khtml-user-select: none;
  -o-user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  user-select: none;
  padding-left: 10px;
  padding-right: 10px;
}

.competition-type-navs a:hover {
  color: #fddc5c;
}

.competition-type-navs {
  display: flex;
  align-items: center;
  gap: 50px;
}

.price-sub {
  font-size: 0.75rem;
  font-weight: 400;
  color: #1a1a1a;
}

.competition-title {
  text-align: center;
  font-size: 1.5rem;
}

.ticket-progress {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  background-color: var(--progress-bg);
  padding: 6px 10px;
  border-radius: 6px;
  width: fit-content;
  margin-top: 10px;
}

.competition-dates {
  font-size: 0.85rem;
  color: #666;
}

.competition-subtitle {
    margin-top: 6px;
}

.competition-footer {
    border-top: 1px solid var(--btn-add-to-cart-bg);
    margin-top: auto;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px;
}

.ticket-qty {
  height: 50px;
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);  
  margin-top: 10px;
  margin-left: 10px;
}

.ticket-qty:focus {
  border-color: var(--btn-add-to-cart-bg);
  outline: none;
  background-color: var(--bg-white);
}

.add-to-cart-btn-wrapper {
    display: flex;
    flex-direction: column;
}

.add-to-cart-btn {
  width: 100%;
  font-size: 1.25rem;
  padding: 10px;
  background-color: var(--btn-add-to-cart-bg);
  color: var(--bg-white);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-to-cart-btn:hover {
    background-color: var(--btn-add-to-cart-bg-hover);
}

.competition-card .cart-icon {
  height: 30px; /* or whatever size you prefer */
  width: 30px;  /* Adjust the size */
}q

/* Sold out states */
.sold-out {
  opacity: 1;
  pointer-events: none;
  /*border: 1px solid #a33a3a;*/
  filter: grayscale(0%) blur(0);  /* Grayscale + blur (slightly less intense) */
}

.sold-out-btn {
  background-color: #a33a3a;
  color: white;
  cursor: not-allowed;
}

.sold-out-price {
  color: #a33a3a;
  font-weight: bold;
  text-transform: uppercase;
}

/* UPCOMING */
.competition-card.pending {
  display: flex;
  flex-direction: column;
  justify-content: center; /* Center vertically */
  align-items: center;     /* Center horizontally if needed */
  height: 100%;            /* or a fixed height like 500px if needed */
  opacity: 1;
  pointer-events: none;
  /*border: 1px solid var(--card-pending);*/
  filter: grayscale(0%) blur(0px);  /* Grayscale + blur (slightly less intense) */
}

/* UPCOMING */
.competition-card.sold-out {
  display: flex;
  flex-direction: column;
  justify-content: center; /* Center vertically */
  align-items: center;     /* Center horizontally if needed */
  height: 100%;            /* or a fixed height like 500px if needed */
  opacity: 1;
  pointer-events: none;
  /*border: 1px solid var(--card-pending);*/
  filter: grayscale(0%) blur(0px);  /* Grayscale + blur (slightly less intense) */
}

.competition-card .upcoming-price {
  color: var(--card-pending); /* blue text */
  font-weight: bold;
}

.upcoming-btn {
  background-color: var(--card-pending);
  color: white;
  cursor: not-allowed;
}

/* Ribbon */
.ribbon {
  position: absolute;
  width: 100%;
  background-color: #d9534f;
  color: white;
  padding: 5px 0; /* Remove left/right padding to allow text to stretch */
  font-weight: bold;
  font-size: 12px;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  text-align: center;
  white-space: nowrap; /* Optional: Prevents wrapping if you want a single line */
  border-radius: 10px;
}
.sold-out-ribbon {
  font-size: 25px;
  background-color: #a33a3a; /* red */
}

.upcoming-ribbon {
  font-size: 25px;
  background-color: var(--card-pending); /* blue */
}

.pagination-controls {
  text-align: center;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  background-color: #fafafa;
}

.page-btn {
  padding: 0.6rem 1.1rem;
  border-radius: 50px;
  border: none;
  background-color: var(--pagination-btn-bg);
  font-weight: 500;
  transition: background 0.3s ease;
  margin: 5px;
}

.page-btn img {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.page-btn:hover:not(:disabled) {
  background-color: var(--pagination-btn-hover-bg);
}

.page-btn.active {
  background-color: var(--btn-add-to-cart-bg);
  color: var(--bg-white);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.search-bar-container {
  text-align: center;
  width: 100%;
}

#competition-search {
  padding: 14px 20px;
  width: 300px;
  max-width: 300px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg-default);
  transition: all 0.3s ease-in-out;
}

#competition-search:focus {
  border-color: var(--btn-add-to-cart-bg);
  outline: none;
}

.search-wrapper {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

#competitionsSortOrder {
  padding: 12px 14px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #f5f5f5;
  transition: border-color 0.3s;
}

.competitions-header {
  padding: 20px 40px;
  background-color: #ffffff;
  border-bottom: 1px solid #dbdbdb;
}

/* ---------- Tablet Portrait: 481px - 768px ---------- */
@media (min-width: 481px) and (max-width: 768px) {
  .competitions-section {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 20px 30px;
  }

  .competitions-title {
    font-size: 2.5rem;
  }

  .competition-card {
    max-width: 80%;
  }

  .ticket-qty {
    font-size: 1.2rem;
  }

  .add-to-cart-btn {
    height: 50px;
  }

  .qty-top-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    width: 100%;
    flex-direction: row;
  }

  .qty-slider-wrapper {
      order: 2; /* slider stays below buttons */
  }

  .add-to-cart-btn {
      order: 3; /* move add-to-cart below slider */
      width: 100%; /* full width for mobile */
  }

  .raffle-card:hover .raffle-footer-hover, .raffle-card.active .raffle-footer-hover {
      margin-top: 10px;
  }

  .qty-top-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-direction: column;
      gap: 12px;
      width: 100%;
  }

  .qty-btn {
      width: 40px;
  }
}

/* ---------- Tablet Landscape / Laptop: 769px - 1024px ---------- */
@media (min-width: 769px) and (max-width: 1024px) {
  .competitions-section {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 20px 30px;
  }

  .competitions-title {
    font-size: 3rem;
  }

  .competition-card {
    max-width: 70%;
    min-width: unset;
  }

  .ticket-qty,
  .add-to-cart-btn {
    font-size: 1rem;
  }
}

/* ---------- Desktop: 1025px+ ---------- */
@media (min-width: 1025px) {
  .competitions-section {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    padding-top: 35px;
    padding-left: 35px;
    padding-right: 35px;
    gap: 30px;
  }

  .competitions-title {
    font-size: 3rem;
  }

  .competitions-header {
    padding-left: 55px;
    padding-right: 55px;
  }

  .competitions-title,
  .search-bar-container {
    text-align: left;
    align-items: flex-start;
    justify-content: flex-start;
    margin-left: 0;
  }

  .search-bar-container {
    margin-top: 20px;
  }

  .competition-card {
    max-width: 300px;
  }
}

@media (max-width: 560px) {
  .search-wrapper,
  .competition-type-navs {
    flex-direction: column;
  }

  #competition-search {
    max-width: none;
    width: 100%;
  }

  .competitions-title {
    text-align: center;
  }
}

@media (max-width: 481px) {
  .competitions-title {
    font-size: 2.5rem;
  }
}

@media (max-width: 345px) {
  .competition-subtitle,
  .tickets-remaining {
    font-size: 0.9rem;
  }
}

@media (max-width: 1024px) {
    .competitions-controls {
    flex-direction: column;
    gap: 40px;
    margin-top: 40px;
  }

  .competitions-nav {
    padding-top: 20px;
    padding-bottom: 20px;
  }
}