/* ======================== Responsive Grid ======================== */
@media (max-width: 900px) {
  .event-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 600px) {
  .event-grid {
    grid-template-columns: 1fr;
  }
}

/* ======================== Global Styling ========================= */
html {
  font-family: 'Duplet', sans-serif;
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Duplet', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f0f2f5;
  overflow-x: hidden;
}

.calendar-wrapper {
  max-width: 1100px;
  margin: auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 24px;
  position: relative;
}

/* ======================== Header & Controls ======================= */
.calendar-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.calendar-title {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 16px;
}

.calendar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* =========================== Filters ============================== */
.calendar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  align-items: center;
  background: #f9f9f9;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  flex-direction: row;
}

.calendar-filters label {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.calendar-filters select,
.calendar-filters input[type="date"] {
  font-family: 'Duplet', sans-serif !important;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.calendar-filters input[type="checkbox"] {
  margin-right: 6px;
  transform: scale(1.1);
}

.color-label {
  font-weight: 500;
  margin-left: 4px;
}

label > span.color-label {
  display: inline;
}

/* =========================== Buttons ============================== */
button {
  cursor: pointer;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease-in-out;
  margin-right: 10px;
}

.filter-btn {
  background-color: #FFD700;
  color: #222;
}

.filter-btn:hover {
  background-color: #FFC300;
}

.completed-btn {
  background-color: #e0e0e0;
  padding: 8px 14px;
  font-weight: 500;
}

.completed-btn:hover {
  background-color: gold;
}

/* ========================= Event Cards =========================== */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  justify-content: center;
  padding: 20px 0;
  max-width: 2000px;
  margin: 0 auto;
}

.event-card {
  display: flex;
  flex: 1 1 250px;
  background: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  flex: 1 1 calc(25% - 20px);
}

.event-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.date-block {
  width: 60px;
  min-width: 60px;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}

.date-block .day {
  font-size: 24px;
  line-height: 1;
}

.date-block .month {
  text-transform: uppercase;
  font-size: 12px;
}

.info-block {
  padding: 12px 16px;
  flex-grow: 1;
  border-right: 3px solid #FFD700;
}

.info-block h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

.info-block p {
  margin: 4px 0;
  font-size: 14px;
  color: #333;
}

.cancel-btn:hover {
  background-color: gold;
}

/* ===================== Program Colors =========================== */
.el-play   { background-color: #8CC63F; }
.el-build  { background-color: #399cd8; }
.el-create { background-color: #e8523e; }

.green { color: #8CC63F; }
.blue  { color: #399cd8; }
.red   { color: #e8523e; }

/* =================== Disabled / State Styling =================== */
.disabled {
  opacity: 0.5;
  pointer-events: none;
}

#completed-events .event-card {
  opacity: 0.5;
  filter: grayscale(100%);
  pointer-events: none;
  transition: all 0.3s ease;
}

/* ========================= Pagination ============================ */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  gap: 8px;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid #ccc;
  background: white;
  border-radius: 6px;
  font-weight: 600;
}

.pagination button.active {
  background-color: gold;
  color: black;
}

.pagination button:hover {
  background-color: #f1c40f;
}

/*============== MOBILE RESPONSIVE =================*/
@media (max-width: 884px) {
  .calendar-controls {
    flex-direction: column;
    align-items: center;
  }

  .calendar-filters {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .calendar-filters label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    font-size: 14px;
    margin-bottom: 12px;
  }

  .calendar-filters select,
  .calendar-filters input[type="date"] {
    width: 100%;
    padding: 6px 10px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
  }

  .calendar-filters .cancel-btn {
    display: block;
    margin: 10px auto 0 auto;
    padding: 8px 16px;
    font-size: 14px;
    background-color: gold;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
  }

  .calendar-filters label span {
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
  }

  #toggle-completed-btn {
    display: block;
    margin: 16px auto 0 auto;
    padding: 10px 18px;
    font-size: 14px;
    background-color: #FFD700;
    color: black;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 90%;
    max-width: 300px;
  }

  .calendar-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    background: #f9f9f9;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  }

  .filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
  }

  .program-group {
    display: flex;
    gap: 16px;
  }

  .program-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
  }

  .calendar-filters select,
  .calendar-filters input[type="date"] {
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-family: 'Duplet', sans-serif !important;
  }
}

/* ================== Final Mobile Space Fix ================== */
.calendar-wrapper,
.event-grid,
.pagination {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

