/* ----------------------------------------
   Standardized Tabs & Notes (app-wide)

   Centralized tab and notes UI styling to be re-used across
   pages such as `release_notes.php` and notes modules.
   Targets a generic `.app-tabs` plus legacy IDs used in the
   codebase for backward compatibility: `#release-tabs`,
   `#notesTabs`, and `#announcementsTabs`.
----------------------------------------- */

.app-tabs,
#release-tabs,
#notesTabs,
#announcementsTabs {
  border-radius: var(--border-radius);
}

.app-tabs ul,
#release-tabs ul,
#notesTabs ul,
#announcementsTabs ul {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--color-bg);
  padding: var(--spacing-small);
  border-radius: var(--border-radius);
  margin: 0;
  gap: 0.5rem;
  list-style: none;
}

.app-tabs ul li,
#release-tabs ul li,
#notesTabs ul li,
#announcementsTabs ul li {
  list-style: none;
  margin-right: 4px;
}

.app-tabs ul li a,
#release-tabs ul li a,
#notesTabs ul li a,
#announcementsTabs ul li a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--border-radius);
  color: var(--text-primary, var(--color-text));
  font-weight: var(--font-weight-bold, 600);
  text-decoration: none;
  font-size: 0.9em;
  transition: var(--transition-base);
}

.app-tabs ul li a:hover,
#release-tabs ul li a:hover,
#notesTabs ul li a:hover,
#announcementsTabs ul li a:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.app-tabs .ui-tabs-active a,
#release-tabs .ui-tabs-active a,
#notesTabs .ui-tabs-active a,
#announcementsTabs .ui-tabs-active a {
  color: var(--color-white);
  background: var(--color-primary);
}

.app-tabs > div,
#release-tabs > div,
#notesTabs > div,
#announcementsTabs > div {
  background: var(--color-white);
  border-radius: var(--border-radius);
  padding: var(--spacing-small);
}

#release-tabs .release-notes ul {
  display: contents;
}

.app-tabs .unCenterTabList ul {
  display: contents;
}

/* -------------------------------
   Notes Section Wrapper (two-column)
   Restores the announcements / notes side-by-side layout
   used by the notes module. Keeps responsive stack on small screens.
------------------------------- */
#noteArea {
  border-radius: var(--border-radius);
  padding: var(--spacing-small);
}

#noteArea .notes-container {
  display: flex;
  gap: var(--spacing-small);
  flex-wrap: wrap;
}

#noteArea .notes-container > #announcementsSection {
  flex: 1 1 30%;
}

#noteArea .notes-container > .notes-column {
  flex: 1 1 65%;
  display: flex;
  flex-direction: column;
}

/* Responsive: stack columns on small screens */
@media (max-width: 768px) {
  #noteArea .notes-container {
    flex-direction: column;
  }
  #noteArea .notes-container > #announcementsSection,
  #noteArea .notes-container > .notes-column {
    flex: 1 1 100%;
  }
}

/* Note navigation (prev/today/next + date) -- reused by notes modules */
/* Note navigation layout: keep controls compact and prevent stretching */
#noteNavigation,
#interpNav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem;
  margin: var(--spacing-small) 0;
}

/* Ensure children keep their intrinsic size and don't stretch */
#noteNavigation > *,
#interpNav > * {
  flex: 0 0 auto;
}

/* Buttons: compact, consistent padding, and visible min-width */
#noteNavigation button,
#interpNav button {
  background: var(--color-accent);
  border: none;
  color: var(--color-white);
  padding: 0.45em 0.9em;
  border-radius: var(--border-radius);
  font-size: 0.95em;
  font-weight: 600;
  transition: var(--transition-base);
  cursor: pointer;
  min-width: 90px;
}

/* Slightly larger prev/next buttons if present */
#noteNavigation button[id^="prev"],
#noteNavigation button[id^="next"] {
  min-width: 120px;
}

#noteNavigation button:hover,
#interpNav button:hover {
  background: var(--color-primary);
  transform: translateY(-1px);
}

/* Date input and selects: fixed reasonable width and box-sizing */
#noteNavigation input[type="date"],
#interpNav input[type="date"],
#noteNavigation select {
  padding: var(--spacing-small);
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  background: var(--color-white);
  font-size: var(--font-size-small);
  font-family: inherit;
  width: 170px;
  box-sizing: border-box;
}

/* Label spacing near select/input */
#noteNavigation label {
  margin-left: 0.5rem;
  margin-right: 0.25rem;
  font-size: 0.95em;
}

/* Responsive fallback: stack controls vertically on small screens */
@media (max-width: 600px) {
  #noteNavigation {
    justify-content: center;
  }
  #noteNavigation input[type="date"],
  #noteNavigation select,
  #noteNavigation button {
    width: 100%;
    min-width: 0;
  }
  #noteNavigation > * {
    flex: 1 1 100%;
  }
}

/* Compact the auto-refresh control (label + select) */
#noteNavigation label[for="notesPollFrequency"] {
  font-size: 0.85em;
  color: var(--text-muted, #666);
  margin-left: auto; /* push the control group to the right */
  margin-right: 0.25rem;
  white-space: nowrap;
}

#noteNavigation select#notesPollFrequency {
  width: 90px;
  padding: 0.25em 0.4em;
  font-size: 0.85em;
  border-radius: calc(var(--border-radius) - 2px);
  box-shadow: none;
}

/* Slightly reduce spacing between label and select */
#noteNavigation label[for="notesPollFrequency"] + select {
  margin-left: 0;
}

/* Training resources filter wrapper */
.training-filter {
  margin-bottom: 10px;
}

/* Announcement variants used across the app */
.announcementDev,
.announcementAdmin,
.announcementFront_desk,
.announcementInterpreter,
.announcementOther {
  margin: 4px 0;
  border-left: 3px solid;
  padding: 6px;
  font-size: 0.9em;
}
.announcementDev { border-color: #c62606; }
.announcementAdmin { border-color: var(--color-warning); }
.announcementFront_desk { border-color: var(--color-info); }
.announcementInterpreter { border-color: var(--color-success); }
.announcementOther { border-color: var(--color-accent); }

/* Keep training resources table responsive and consistent */
#training-resources {
  width: 100%;
}

/* Small helpers to ensure any tab-located .dataTable looks good */
.app-tabs .dataTable,
#release-tabs .dataTable,
#notesTabs .dataTable,
#announcementsTabs .dataTable {
  width: 100%;
  box-shadow: var(--shadow-table);
  border-radius: var(--border-radius);
  overflow: hidden;
}
