/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Prismm Branding - Global Styles */
body {
  background-color: #fafafa;
  color: #252b37;
  font-family: 'Inter', 'Work Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Status Page Styles - Prismm Branding */
.status-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  font-family: 'Inter', 'Work Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #fafafa;
  min-height: 100vh;
}

.status-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e9eaeb;
}

.status-header h1 {
  margin: 0 0 1rem 0;
  font-size: 2.5rem;
  font-weight: 600;
  color: #252b37;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 500;
}

.status-indicator.status-up {
  background-color: #ecfdf3;
  color: #067647;
  border: 1px solid #dcfae6;
}

.status-indicator.status-down {
  background-color: #fef3f2;
  color: #b42318;
  border: 1px solid #fee4e2;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: currentColor;
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.status-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e9eaeb;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.stat-card h2 {
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #535862;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 600;
  color: #252b37;
  margin-bottom: 0.5rem;
}

.stat-detail {
  font-size: 0.9rem;
  color: #535862;
}

.recent-checks,
.failures {
  margin-bottom: 3rem;
}

.recent-checks h2,
.failures h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #252b37;
}

.table-container {
  overflow-x: auto;
  border: 1px solid #e9eaeb;
  border-radius: 12px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.checks-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.checks-table thead {
  background: #fafafa;
}

.checks-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: #535862;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e9eaeb;
}

.checks-table td {
  padding: 1rem;
  border-bottom: 1px solid #f5f5f5;
}

.checks-table tbody tr:hover {
  background: #fafafa;
}

.checks-table tbody tr:last-child td {
  border-bottom: none;
}

.check-success {
  background: #f6fef9;
}

.check-failure {
  background: #fffbfa;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background-color: #dcfae6;
  color: #067647;
}

.badge-failure {
  background-color: #fee4e2;
  color: #b42318;
}

.error-cell {
  max-width: 400px;
}

.error-message {
  color: #b42318;
  font-size: 0.9rem;
  word-break: break-word;
}

.error-messages {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.error-messages .error-message {
  display: block;
}

.no-data {
  text-align: center;
  padding: 3rem;
  color: #535862;
  font-style: italic;
}

/* Recent Updates Page */
.page-subtitle {
  margin: 0;
  font-size: 1.05rem;
  color: #535862;
}

.page-nav {
  /* width: fit-content + auto margins keeps the nav centered on its own line,
     rather than sitting inline beside the status pill. */
  margin: 1.25rem auto 0;
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem;
  background: #ffffff;
  border: 1px solid #e9eaeb;
  border-radius: 8px;
}

.nav-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #535862;
  text-decoration: none;
}

.nav-link:hover {
  background: #fafafa;
  color: #252b37;
}

.nav-link-current {
  background: #f5f5f5;
  color: #252b37;
  cursor: default;
}

.update-group {
  margin-bottom: 2.5rem;
}

.update-period {
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #535862;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e9eaeb;
}

.update-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.update-entry {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  background: #ffffff;
  border: 1px solid #e9eaeb;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.update-badge {
  flex-shrink: 0;
  display: inline-block;
  min-width: 6.5rem;
  text-align: center;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.6;
}

.update-badge-feature {
  background-color: #dcfae6;
  color: #067647;
}

.update-badge-improvement {
  background-color: #e0eaff;
  color: #2d31a6;
}

.update-badge-fix {
  background-color: #fef0c7;
  color: #b54708;
}

.update-badge-security {
  background-color: #f4f3ff;
  color: #5925dc;
}

.update-badge-maintenance {
  background-color: #f5f5f5;
  color: #535862;
}

.update-body {
  flex: 1;
  min-width: 0;
}

.update-title {
  margin: 0 0 0.4rem 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #252b37;
}

.update-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #535862;
}

/* Responsive Design */
@media (max-width: 768px) {
  .status-page {
    padding: 1rem;
  }

  .status-header h1 {
    font-size: 2rem;
  }

  .status-stats {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .checks-table {
    font-size: 0.9rem;
  }

  .checks-table th,
  .checks-table td {
    padding: 0.75rem 0.5rem;
  }

  .update-entry {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  .update-badge {
    min-width: 0;
  }
}
