/* 
Theme Name: AFES CHILD THEME
URI:     		http://codecorners.com
Author: Code Corners
version: 1.0
Theme URI: http://codecorners.com/
Author URI: http://codecorners.com/
*/

.wp-block-image {
  margin: 0;
}

.wp-block-image img {
  width: 100%;
  max-width: 100%;
}

.block-form
  .gform-theme.gform-theme--framework.gform_wrapper
  form
  .gform_body
  input[type='submit'] {
  padding: 16px 20px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  line-height: 1;
  border: 0;
  font-size: 16px;
  background-color: #9ad9e9;
  color: #242c37;
  border-radius: 0;
}

.gform-theme--foundation #field_submit {
  justify-content: flex-end;
}

.featured-support-block:not(.block-theme-navy)
  .block-form
  .gform-theme.gform-theme--framework.gform_wrapper
  form
  .gform_body
  input[type='submit'] {
  background-color: #242c37;
  color: #fff;
}

.calendar-container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.calendar-header {
  background: #34613b;
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.calendar-header h1 {
  color: white;
}

.calendar-title {
  font-size: 24px;
  font-weight: 600;
}

.calendar-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.view-switcher {
  display: flex;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.view-btn {
  background: none;
  border: none;
  color: white;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.view-btn.active {
  background: rgba(255, 255, 255, 0.3);
}

/* Month View Styles */
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.month-header {
  background: #4a5568;
  color: white;
  padding: 12px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
}

.month-day {
  background: white;
  min-height: 120px;
  padding: 8px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.month-day:hover {
  background: #f7fafc;
}

.month-day.other-month {
  background: #f8f9fa;
  color: #adb5bd;
}

.month-day.today {
  background: #e6fffa;
  border: 2px solid #38b2ac;
}

.day-number {
  font-weight: 600;
  margin-bottom: 4px;
}

.day-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.event-item {
  background: #efd954;
  color: #fff;
  padding: 10px;
  font-size: 12px;
  align-items: center;
  display: flex;
  justify-content: center;
  margin: 0;
  height: 100%;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
  width: 100%;
}

.event-item:hover {
  background: #3182ce;
}

/* Week View Styles */
.week-container {
  overflow: hidden;
  margin-top: 5px;
  background: #d0f1f7;
}

.time-slots,
.day-header {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 1px;
  overflow: hidden;
}

.day-header {
  background: #d0f1f7;
}

.week-time-header {
  background: #d0f1f7;
  color: #000;
  padding: 12px 8px;
  text-align: center;
  font-weight: 600;
}

.week-day-header {
  background: #d0f1f7;
  color: #000;
  padding: 20px 12px;
  text-align: center;
  font-weight: 600;
  border-left: 2px solid #fff;
}

.week-time-slot {
  background: #fff;
  padding: 8px;
  text-align: center;
  font-size: 16px;
  color: #000;
  align-content: center;
  font-weight: 600;
}

.week-day-slot {
  background: white;
  min-height: 80px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
}

.week-day-slot .event-wrapper {
  flex: 1; /* take equal space */
  min-width: 0; /* prevent overflow */

  /* add gap only between multiple events */
  margin-right: 1px;
}

.week-day-slot .event-wrapper:last-child {
  margin-right: 0; /* no extra gap after the last event */
}

.week-day-slot .event-item {
  width: 100%; /* fill the wrapper */
  height: 100%; /* optional: fill vertical space */
  box-sizing: border-box;
}

.week-day-slot:hover {
  background: #f7fafc;
}

/* Day View Styles */
.day-container {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1px;
  background: #e2e8f0;
  border-radius: 8px;
  max-height: 600px;
  overflow-y: auto;
}

.day-time-slot {
  background: #f8f9fa;
  padding: 12px 8px;
  text-align: center;
  font-size: 14px;
  color: #6c757d;
  border-bottom: 1px solid #e2e8f0;
}

.day-hour-slot {
  background: white;
  min-height: 80px;
  padding: 8px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid #e2e8f0;
}

.day-hour-slot:hover {
  background: #f7fafc;
}

/* Event Form Styles */
.event-form {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  min-width: 300px;
}

.form-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.form-group {
  margin-bottom: 15px;
}

.form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.btn-primary {
  background: #3182ce;
  color: white;
}

.btn-primary:hover {
  background: #2c5aa0;
}

.btn-secondary {
  background: #e2e8f0;
  color: #4a5568;
}

.btn-secondary:hover {
  background: #cbd5e0;
}

.btn-danger {
  background: #e53e3e;
  color: white;
}

.btn-danger:hover {
  background: #c53030;
}

.week-day-slot .resource-grid-single {
  position: absolute;
  bottom: 100%;
  min-width: 380px;
  left: 100%;
  z-index: 9;
  min-height: 427px;
}

/* --- NEW RESPONSIVE CSS --- */

/* Default state: show desktop, hide mobile */
.mobile-view {
  display: none;
}

/* On screens 768px or less, flip the visibility */
@media (max-width: 768px) {
  .desktop-view {
    display: none; /* Hide the desktop grid */
  }
  .mobile-view {
    display: block; /* Show the mobile list */
    background-color: #f0f2f5;
  }
  .calendar-header {
    padding: 1rem 1.25rem;
  }
  .mobile-day-block {
    background-color: #eaf6fa;
    overflow: hidden;
  }
  .mobile-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding: 1rem 1rem;
    letter-spacing: 1.12px;
    text-transform: uppercase;
    font-weight: 700;
  }
  .mobile-day-header .day-name {
    font-weight: bold;
    color: #333;
    font-size: 0.9rem;
    text-transform: uppercase;
  }
  .mobile-day-header .timezone {
    font-size: 0.8rem;
    color: #555;
    font-weight: 600;
  }
  .mobile-event-list {
    background-color: #fff;
  }

  .mobile-event-item {
    padding: 10px;
    border-bottom: 1px solid #e6e6df;
  }
  .mobile-event-item .event-details {
    display: flex;
    align-items: center;
    padding: 1.5rem 1rem 1.5rem 1.75rem;
    position: relative;
    font-style: normal;
    line-height: 20px;
    font-weight: 600;
  }
  .mobile-event-list .mobile-event-item:last-child {
    border-bottom: none;
  }
  /* Creates the colored vertical bar */
  .mobile-event-item .event-details::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    height: 70%;
    width: 4px;
    /* Use the CSS variable set inline on the element */
    background-color: var(--event-color, '#ccc');
    border-radius: 2px;
  }
  .event-title {
    flex-grow: 1;
    color: #333;
  }
  .event-time {
    font-weight: 600;
    color: #333;
  }

  .calendar-header {
    flex-wrap: wrap;
    justify-content: space-between;
    row-gap: 1rem;
  }

  .calendar-header .calendar-center {
    order: -1;
    flex-basis: 100%;
    margin-bottom: 0.5rem;
  }
}

.custom-pagination .alm-paging li {
  list-style: none;
}

.custom-pagination .alm-paging li a {
  text-decoration: none;
}

.custom-pagination .alm-paging li.prev.disabled,
.custom-pagination .alm-paging li.next.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.resource-grid-list {
  position: relative;
}

#events-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999;
  width: 28px;
  display: none; /* hidden by default */
}
