/* =========================================================
   Freetimers Server Monitoring Dashboard
   ========================================================= */

.ftservers-monitor-dashboard {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 1.25rem 0 2rem 0;
  padding: 1.5rem;
  background: #f7f9fb;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
}

/* Defensive box sizing */

.ftservers-monitor-dashboard,
.ftservers-monitor-dashboard * {
  box-sizing: border-box;
}

/* Header */

.ftservers-monitor-dashboard__header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #d9e2ec;
}

.ftservers-monitor-dashboard__header h2 {
  margin: 0 0 0.35rem 0;
  font-size: 1.6rem;
  line-height: 1.2;
  color: #102a43;
  font-weight: 700;
}

.ftservers-monitor-dashboard__header p {
  margin: 0;
  font-size: 0.95rem;
  color: #52606d;
}

/* Summary cards */

.ftservers-monitor-dashboard__summary {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.75rem 0;
}

.ftservers-monitor-dashboard__summary-card {
  display: block;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 42, 67, 0.06);
}

.ftservers-monitor-dashboard__summary-number {
  display: block;
  font-size: 1.7rem;
  line-height: 1;
  font-weight: 700;
  color: #102a43;
}

.ftservers-monitor-dashboard__summary-label {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: #52606d;
}

.ft-summary-ok {
  border-left: 5px solid #2f855a;
}

.ft-summary-slow {
  border-left: 5px solid #b7791f;
}

.ft-summary-error {
  border-left: 5px solid #c53030;
}

/* Inner panel */

.ftservers-monitoring-dashboard {
  padding: 1.35rem;
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
}

.ftservers-monitoring-dashboard h2 {
  margin: 0 0 1rem 0;
  font-size: 1.35rem;
  color: #102a43;
}

/* Table */

.ftservers-monitor-dashboard__table-wrap {
  width: 100%;
  overflow-x: auto;
}

.ftservers-monitor-dashboard__table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

.ftservers-monitor-dashboard__table th {
  padding: 0.75rem;
  background: #666666;
  color: #ffffff;
  text-align: left;
  font-weight: 700;
  border-bottom: 1px solid #555555;
  white-space: nowrap;
}

.ftservers-monitor-dashboard__table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #e1e7ef;
  vertical-align: middle;
}

.ftservers-monitor-dashboard__table .ft-number {
  text-align: right;
  white-space: nowrap;
}

/* Status rows */

.ftservers-monitor-dashboard__table tr.ft-status-ok {
  background: #e8f5e9;
}

.ftservers-monitor-dashboard__table tr.ft-status-ok .ft-status-cell {
  color: #155724;
  font-weight: 700;
}

.ftservers-monitor-dashboard__table tr.ft-status-slow {
  background: #fff8e1;
}

.ftservers-monitor-dashboard__table tr.ft-status-slow .ft-status-cell {
  color: #8a5a00;
  font-weight: 700;
}

.ftservers-monitor-dashboard__table tr.ft-status-error {
  background: #ffebee;
}

.ftservers-monitor-dashboard__table tr.ft-status-error .ft-status-cell {
  color: #a12622;
  font-weight: 700;
}

/* Links */

.ftservers-monitor-dashboard a {
  color: #006699;
  text-decoration: underline;
}

.ftservers-monitor-dashboard a:hover {
  color: #004466;
}

/* Hover */

.ftservers-monitor-dashboard__table tbody tr:hover {
  filter: brightness(0.97);
}

/* =========================================================
   Home/dashboard page tidy-up - safe version
   ========================================================= */

/*
   Do NOT style .region-header here.
   In this theme .region-header is part of the blue Freetimers banner.
*/

/* Keep the blue site header untouched */
body.path-home .region-header,
body.path-frontpage .region-header {
  height: auto !important;
  min-height: unset !important;
  padding: unset !important;
  margin: unset !important;
  background: unset !important;
  overflow: visible !important;
}

/* Hide only the old Drupal Home title and local node tabs */
body.path-home h1.page-title,
body.path-home .block-page-title-block,
body.path-home .tabs,
body.path-home nav.tabs,
body.path-frontpage h1.page-title,
body.path-frontpage .block-page-title-block,
body.path-frontpage .tabs,
body.path-frontpage nav.tabs {
  display: none !important;
}

/* Tidy Drupal messages */
body.path-home .region-highlighted,
body.path-frontpage .region-highlighted {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

body.path-home .messages,
body.path-frontpage .messages,
body.path-home .messages--status,
body.path-frontpage .messages--status,
body.path-home div[role="contentinfo"],
body.path-frontpage div[role="contentinfo"] {
  max-width: 1200px;
  margin: 0.75rem auto !important;
  padding: 0.75rem 1rem !important;
}

/* Reduce main content spacing */
body.path-home main,
body.path-home #main,
body.path-home #content,
body.path-home .main-content,
body.path-frontpage main,
body.path-frontpage #main,
body.path-frontpage #content,
body.path-frontpage .main-content {
  margin-top: 0 !important;
  padding-top: 1rem !important;
}

/* Dashboard spacing */
body.path-home .ftservers-monitor-dashboard,
body.path-frontpage .ftservers-monitor-dashboard {
  margin-top: 1.25rem !important;
}

/* Search row: only target the actual search block/form, not the whole header */
body.path-home .search-block-form,
body.path-frontpage .search-block-form,
body.path-home .block-search,
body.path-frontpage .block-search,
body.path-home .block-search-form-block,
body.path-frontpage .block-search-form-block {
  max-width: 1200px !important;
  margin: 0.5rem auto !important;
  padding: 0 !important;
}

/* Search form compacting */
body.path-home .search-block-form form,
body.path-frontpage .search-block-form form,
body.path-home #search-block-form,
body.path-frontpage #search-block-form {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Search input */
body.path-home .search-block-form input[type="search"],
body.path-home .search-block-form input[type="text"],
body.path-home #search-block-form input[type="search"],
body.path-home #search-block-form input[type="text"],
body.path-frontpage .search-block-form input[type="search"],
body.path-frontpage .search-block-form input[type="text"],
body.path-frontpage #search-block-form input[type="search"],
body.path-frontpage #search-block-form input[type="text"] {
  width: 220px !important;
  max-width: 220px !important;
  height: 28px !important;
  padding: 3px 8px !important;
  margin: 0 !important;
  font-size: 13px !important;
}

/* Search button */
body.path-home .search-block-form input[type="submit"],
body.path-home #search-block-form input[type="submit"],
body.path-frontpage .search-block-form input[type="submit"],
body.path-frontpage #search-block-form input[type="submit"],
body.path-home .search-block-form button,
body.path-frontpage .search-block-form button {
  height: 28px !important;
  min-height: 28px !important;
  padding: 3px 10px !important;
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1 !important;
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 900px) {
  .ftservers-monitor-dashboard__summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.path-home .region-header,
  body.path-frontpage .region-header {
    height: auto !important;
    padding: 0.6rem 1rem !important;
  }
}

@media (max-width: 520px) {
  .ftservers-monitor-dashboard {
    padding: 1rem;
  }

  .ftservers-monitor-dashboard__summary {
    grid-template-columns: 1fr;
  }

  .ftservers-monitoring-dashboard {
    padding: 1rem;
  }

  body.path-home .search-block-form input[type="search"],
  body.path-home .search-block-form input[type="text"],
  body.path-home #search-block-form input[type="search"],
  body.path-home #search-block-form input[type="text"],
  body.path-frontpage .search-block-form input[type="search"],
  body.path-frontpage .search-block-form input[type="text"],
  body.path-frontpage #search-block-form input[type="search"],
  body.path-frontpage #search-block-form input[type="text"] {
    width: 100% !important;
    max-width: 100% !important;
  }
}
/* AJAX refresh state */

#ftservers-monitor-dashboard-ajax {
  position: relative;
}

#ftservers-monitor-dashboard-ajax.ftservers-monitor-dashboard--refreshing {
  opacity: 0.72;
  transition: opacity 0.2s ease-in-out;
}
