/* NEW PROGRAMS.CSS */
/* Variables used in programs.css */
:root {
  --card-bg: #ed832f;
  --card-radius: 15px;
  --card-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  --card-gap: 2rem;
  --page-margin: 6rem;
  --max-image-size: 395px;
  --program-font-color: black;
}

/*program specifications*/
.program-specifications {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0;
  color: var(--program-font-color);
}

.filter-form {
  display: flex;
  gap: 10px;
  margin: 20px auto;
  justify-content: center;
}


.program-info-details {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.program-info-item span {
  display: block;
  margin-top: 0.5rem;
  font-size: 1rem;
}

.program-info-item i {
  font-size: 25px;
  padding: 0 0 10px 0;
}

.program-info-item-padding {
  padding: 0 1rem;
  border-left: 2px solid white;
}

/*read more link*/
a {
  color: white;
}

a:hover {
  color: blue;
  font-weight: bold;
}

/*program button to calendar*/
.calendar-btn {
  background-color: white;
  color: #ED832F;
  border-radius: 5px;
  color: var(--program-font-color);
}

.calendar-btn:hover {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/*admin program page*/
#add {
  display: none;
}

.row {
  margin: 10px;
}

#program-description {
  height: 250px;
  width: 90%;
}


/* Layout for the list of cards */

.program-list {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
  padding: 0 var(--page-margin);
}

/* Card styles (applies to both admin & user views) */

.program-card,
.admin-program-card {
  display: grid;
  grid-template-columns: 0.8fr 2fr;
  background-color: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  width: 100%;
  margin: 0 auto;
  /* center with page padding */
  transition: transform 0.3s ease, box-shadow 5s ease;
}

.program-card:hover,
.admin-program-card:hover {
  transform: scale(1.05);
}

/* Content area inside the card */
.program-content {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  /* padding-left: 3rem; */
  gap: 1rem;
}

/* Program image */
.program-image {
  min-height: 200px;
  min-width: 200px;
  max-width: var(--max-image-size);
  max-height: var(--max-image-size);
  width: 100%;
  height: 100%;
  border-radius: var(--card-radius) 0 0 var(--card-radius);
  object-fit: cover;
}

.program-image-container {
  display: flex;
  align-items: center;
  justify-content: left;
}


/* Text blocks */
.program-title {
  font-size: 1.5em;
  margin: 0.5rem 0;
  color: var(--program-font-color);
}




.title-div .compact-drag-buttons {
  display: none;
}

.program-list.collapsed .title-div {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.program-list.collapsed .compact-drag-buttons {
  display: block;
}


.program-description {
  flex: 1;
  font-size: 1.3em;
  line-height: 1.5;
  color: var(--program-font-color);
}

/* Info row */
.program-info {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  margin: 1rem 0;
}

/* Buttons row */
.buttons {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Generic button */
.button {
  padding: 0.5rem 1rem;
  cursor: pointer;
}

/* Specific variants */
.btn-edit {
  background: rgb(46, 76, 248);
  color: #fff;
}

.btn-delete-form {
  display: inline;
}

.btn-delete {
  background: rgb(247, 56, 56);
  color: #fff;
}

.db-copy-button {
  background: #23a802;
  color: #fff;
}

.db-send-button {
  background: #e7395c;
  color: #fff;
}

.buttons-divider {
  width: 40%;
}

.move-up,
.move-down,
.drag-handle {
  font-size: 1.2rem;
  color: black;
  padding: 0.3rem 0.6rem;
  background-color: whitesmoke;
  border-radius: 4px;
}

.move-up:hover,
.move-down:hover {
  background-color: #ccc;
}

/* These will apply to each program card when in 'collapse' mode */
.program-list.collapsed {
  gap: 0.3rem;
  /* smaller gap when collapsed */
}

.program-list.collapsed .admin-program-card {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  height: auto;
  white-space: nowrap;
  overflow: hidden;
}

.program-list.collapsed .program-image {
  max-height: 50px;
  max-width: 50px;
  min-height: 0px;
  min-width: 0px;
}

.program-list.collapsed .program-content {
  flex: 1;
  overflow: hidden;
}

.program-list.collapsed .program-description,
.program-list.collapsed .program-info,
.program-list.collapsed .buttons {
  display: none;
  /* hide these in collapsed mode */
}

.edit-program-description {
  min-height: 100px;
  field-sizing: content;
}

footer {
  margin-top: 2rem;
}

.cancel-edit {
  background-color: slategray;
}

.view-div {
  color: var(--program-font-color);
}

/* Program Edit View */

.edit-program-view-div {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 20px;
}

.edit-program-view input[type=text] {
  font-size: 1.1em;
}

.edit-program-view textarea {
  font-size: 1.2em;
}

.save-edit {
  background-color: #23a802;
}

@media (max-width: 800px) {

  .program-list {
    padding: 0 10px; /* was !important */
    gap: 1rem;       /* was !important */
  }

  .program-card,
  .admin-program-card {
    display: flex;           /* was !important */
    flex-direction: column;  /* was !important */
    width: 100%;
    max-width: 95%;          /* was !important */
    margin: 0 auto 16px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
  }

  .program-image-container {
    display: flex;
    width: 100%;             /* was !important */
    justify-content: center; /* was !important */
    align-items: center;     /* was !important */
  }

  .program-image {
    width: 100%;                   /* was !important */
    height: auto;                  /* was !important */
    min-height: 180px;             /* was !important */
    border-radius: 15px 15px 0 0;  /* was !important */
    object-fit: cover;             /* was !important */
  }

  .program-content {
    padding: .7rem .8rem; /* was !important */
    font-size: .98em;     /* was !important */
    gap: .7rem;           /* was !important */
    max-width: 100%;
    overflow-x: hidden;
  }

  .program-title {
    font-size: 1.2em; /* chose larger */
    margin: .3rem 0;
  }

  .program-description {
    font-size: 1em;
    line-height: 1.4;
  }

  .program-specifications {
    display: flex;
    flex-direction: column; /* was !important */
    align-items: flex-start;/* was !important */
    margin: 10px 0;         /* was !important */
    font-size: .95em;       /* was !important */
  }

  .program-info-details {
    display: grid; /* grid beats earlier flex def */
    grid-template-columns: repeat(2,1fr);
    gap: .8rem;    /* compromise between .5 & .8 */
    width: 100%;   /* was !important */
  }

  .program-info-item {
    display: flex;     /* was !important */
    align-items: center;/* was !important */
    gap: .5em;         /* was !important */
    margin-bottom: .3em;
    font-size: .95em;
  }

  .program-info-item i {
    font-size: 1.2em; /* was !important */
    min-width: 1.5em;
    text-align: center;
  }

  .program-info-item > div:first-child {
    display: flex;
    align-items: center;
    gap: .3em;
  }

  .program-info-item > div:last-child {
    word-break: break-all;
  }

  .program-info-item-padding {
    border-left: none; /* was !important */
    padding-left: 0;   /* was !important */
  }

  .buttons {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .calendar-btn {
    width: 100%; /* was !important */
    margin-top: 10px;
    font-size: 1em;
  }

  a,
  a[href],
  .program-description a {
    word-break: break-word;
  }

  .program-description,
  .program-title,
  .view-div,
  .edit-program-view-div {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}