/* =========================================
   Training pages – shared styles (EN + FR)
========================================= */

/* --- Generic training-page tweaks --- */

.table-main {
  margin-top: -1rem;
}

.top-content {
  margin-top: 6rem;
  margin-bottom: 6rem;
}

.text-dark {
  color: black;
}

/* Slight spacing only for selects in the training filter bar */
.filter-bar select,
.filter-bar .form-select {
  margin-bottom: 1rem;
}

/* Hide preamble on smaller screens */
@media only screen and (max-width: 980px) {
  #preamble {
    display: none;
  }
  #submitFormData {
    width: 100%;
  }
}

/* External link icon for custom link button */
.link-button[target="_blank"]:after {
  content: "\1f855";
}

/* =========================================
   FILTER BAR + TABLE LAYOUT (from EN version)
========================================= */

/* Filter bar */
.filter-bar {
  background-color: #f8f9fc;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}

/* Table container */
.table-container {
  width: 100%;
  background-color: #f8f9fc;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow-x: auto;
}

/* Main table */
.table-main {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  margin: 0;
}

/* Cells */
.table-main th,
.table-main td {
  border: 1px solid #dee2e6;
  padding: 0.85rem;
  text-align: left;
  vertical-align: middle;
}

/* Keep headers compact */
.table-main th {
  white-space: nowrap;
}

/* Allow data cells to wrap normally */
.table-main td {
  white-space: normal;
}

/* Header styling */
.table-main th {
  background-color: #1f2b7b;
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.table-main tr:nth-child(even) {
  background-color: #f4f6fa;
}

.table-main tr:hover {
  background-color: #eef1f7;
}

/* Register button */
.register {
  background-color: #1f2b7b;
  color: white;
  border: none;
  padding: 7px 15px;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: 0.2s ease;
}
.register:hover {
  background-color: #a39161;
  color: white;
}

/* Keep table within container & avoid overflow */
.table-main {
  width: 100%;
  table-layout: fixed;
}

/* Let cells wrap instead of forcing the table wider */
.table-main th,
.table-main td {
  word-wrap: break-word;
  white-space: normal;
}

/* Column sizing for desktop */
.col-date {
  width: 130px;
}
.col-course {
  width: 40%;
}
/* Timezone column – just wide enough for the pill, but stable */
.col-timezone {
  width: 60px;          /* was 70px or 1% – pick a modest fixed width */
  text-align: center;
  white-space: nowrap;
}
.col-register {
  width: 120px;
  text-align: center;
}
.col-details {
  width: 140px;
  text-align: left;
  max-width: 160px;
}

/* Details button */
.col-details .exploder {
  padding: 8px 10px;
  background-color: transparent;
  color: #1f2b7b;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Expanded content should not push table wider than 100% */
.table-main .explode td {
  padding-top: 0.5rem;
}
.table-main .explode .content {
  max-width: 100%;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 992px) {
  .table-container {
    padding: 10px;
  }
  .table-main th,
  .table-main td {
    padding: 0.6rem;
    font-size: 0.9rem;
  }

  /* Columns become flexible */
  .col-date,
  .col-course,
  .col-timezone,
  .col-register,
  .col-details {
    width: auto;
    max-width: none;
  }
}

@media (max-width: 768px) {
  .table-container {
    width: 100vw;
    margin-left: -5vw;
    padding: 5px;
    border-radius: 0;
    box-shadow: none;
  }

  .table-main {
    width: 100%;
    font-size: 0.85rem;
  }

  .table-main th,
  .table-main td {
    padding: 0.5rem 0.4rem;
    white-space: normal;
  }

  .register {
    font-size: 0.8rem;
    padding: 5px 10px;
  }

  /* Fix mobile side spacing */
  body, html {
    overflow-x: hidden !important;
  }

  main .container {
    max-width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    margin: 0 auto !important;
  }

  .table-container {
    width: 100% !important;
    margin: 0 !important;
    padding-left: 5px !important;
    padding-right: 5px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
}

/* Mobile "card" layout – key to avoiding horizontal scroll */
@media (max-width: 480px) {
  .table-main,
  .table-main thead,
  .table-main tbody,
  .table-main th,
  .table-main td,
  .table-main tr {
    display: block;
  }

  .table-main tr {
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  }

  .table-main thead,
  .table-main th {
    display: none;
  }

  .table-main td {
    border: none;
    padding: 0.5rem 1rem;
    text-align: left;
    position: relative;
  }

  .table-main td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #1f2b7b;
    display: block;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    font-size: 0.75rem;
  }
}

/* =========================================
   TIMEZONE PILL
========================================= */

.tz-pill {
  display: inline-block;
  background: #10285D;     /* deep blue */
  color: #fff;
  padding: 3px 9px;
  font-size: 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.tz-pill:hover {
  background: #a39161;     /* gold hover */
  color: #fff;
}

@media (max-width: 480px) {
  .tz-pill {
    padding: 2px 7px;
    font-size: 0.7rem;
    float: left;
  }
}

@media (max-width: 480px) {
  /* Make the timezone pill sit tighter under the course info */
  .table-main td.col-timezone {
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
    padding-left: 1rem;    /* match others horizontally */
    padding-right: 1rem;
    text-align: left;      /* or 'right' if you prefer it aligned right */
  }

  .table-main td.col-timezone .tz-pill {
    font-size: 0.65rem;    /* a bit smaller on mobile */
    padding: 2px 5px;      /* tighter pill */
  }
}

@media (max-width: 480px) {
  /* Timezone pill row tighter on mobile */
  .table-main td.col-timezone {
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    text-align: left;
  }

  .table-main td.col-timezone .tz-pill {
    font-size: 0.65rem;
    padding: 2px 5px;
  }

  /* Register button row aligned with pill, not floating right */
  .table-main td.col-register {
    padding-top: 0.4rem;
    padding-bottom: 0.8rem;
    padding-left: 1rem;
    padding-right: 1rem;
    text-align: left;   /* align with pill & course text */
  }

  .table-main td.col-register .register,
  .table-main td.col-register .register-external {
    display: inline-block;
    width: 100%;
    max-width: 200px;
    font-size: 0.8rem;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 0;          /* we killed the old margin-right inline, so this keeps it flush */
  }

  .table-main td.col-register .register-channel-label {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-variant: small-caps;
  }
}

/* Desktop min-width for Register button (English & French) */
@media (min-width: 768px) {
    .register {
        min-width: 110px;   /* adjust as needed */
        padding: 0.8rem 1rem;
        text-align: center;
        white-space: nowrap;
    }
}

.exploder {
    padding: 8px 12px;
    background-color: transparent;
    color: #1f2b7b;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: color .2s ease, transform .2s ease;
}

.exploder:hover {
    color: #a39161;
    transform: translateY(-1px);
}

.exploder.expanded {
    color: #a39161;
    font-weight: 600;
}

.exploder i {
    margin-right: 6px;
}

/* =========================================
   FILTER DROPDOWNS – LOOK & FEEL
========================================= */

.filter-bar .form-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #10285D;
  margin-bottom: 0.35rem;
}

.filter-bar .form-select,
.filter-bar select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #ffffff;
  border: 1px solid #cfd4e3;
  border-radius: 6px;
  padding: 0.55rem 2.2rem 0.55rem 0.75rem;  /* extra right padding for the arrow */
  font-size: 0.9rem;
  color: #333;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

/* Focus state */
.filter-bar .form-select:focus,
.filter-bar select:focus {
  border-color: #10285D;
  box-shadow: 0 0 0 3px rgba(16, 40, 93, 0.15);
  outline: none;
}

/* Hover state */
.filter-bar .form-select:hover,
.filter-bar select:hover {
  border-color: #a39161;
}

/* Placeholder-style options (first option) – make it slightly softer */
.filter-bar .form-select option:first-child,
.filter-bar select option:first-child {
  color: #666;
}

/* Custom dropdown arrow using background image (CSS-only) */
.filter-bar .form-select,
.filter-bar select {
  background-image:
    linear-gradient(45deg, transparent 50%, #10285D 50%),
    linear-gradient(135deg, #10285D 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 9px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* On focus, make the arrow gold */
.filter-bar .form-select:focus,
.filter-bar select:focus {
  background-image:
    linear-gradient(45deg, transparent 50%, #a39161 50%),
    linear-gradient(135deg, #a39161 50%, transparent 50%);
}

/* Mobile spacing: make each row breathe a bit */
@media (max-width: 768px) {
  .filter-bar .row.g-3 > [class*="col-"] {
    margin-bottom: 0.35rem;
  }

  .filter-bar .form-select,
  .filter-bar select {
    font-size: 0.88rem;
    padding: 0.5rem 2.1rem 0.5rem 0.7rem;
  }
}
