@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --brand-blue: #1d4e89;
  --brand-blue-light: #2675bf;
  --brand-orange: #ff914d;
  --brand-bg: #f4f6fb;
  --card-bg: #ffffff;
  --border-soft: #d8e2f5;
  --text-primary: #0d243f;
  --text-muted: #5f6c7b;
}

/* Global look & feel */
body {
  font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
  background: var(--brand-bg);
  color: var(--text-primary);
  min-height: 100vh;
}

a {
  color: var(--brand-blue);
  text-decoration: none;
}

a:hover {
  color: var(--brand-orange);
}

.logo {
  width: 28px;
  height: 28px;
}

.badge {
  font-size: 0.85rem;
}

table td,
table th {
  white-space: nowrap;
}

/* Navigation */
.gradient-nav {
  background: linear-gradient(135deg, rgba(13, 36, 64, 0.98) 0%, rgba(29, 78, 137, 0.92) 65%, rgba(38, 117, 191, 0.85) 100%);
  box-shadow: 0 12px 30px rgba(13, 36, 64, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gradient-nav .navbar-brand {
  color: #fff;
  letter-spacing: 0.4px;
}

.gradient-nav .nav-link {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.gradient-nav .nav-link:hover,
.gradient-nav .nav-link:focus,
.gradient-nav .nav-link.active {
  color: var(--brand-orange);
}

.gradient-nav .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
}

.gradient-nav .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
}

.gradient-nav .btn-warning {
  background: var(--brand-orange);
  border: none;
}

/* Landing page styling */
body.home-page {
  background: radial-gradient(circle at top left, rgba(255, 185, 73, 0.15), transparent 45%),
              radial-gradient(circle at bottom right, rgba(29, 78, 137, 0.12), transparent 40%),
              var(--brand-bg);
}

.hero-section {
  background: linear-gradient(135deg, #1d4e89 0%, #2675bf 60%, #ff914d 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  border-bottom-left-radius: 48px;
  border-bottom-right-radius: 48px;
  margin-bottom: 2rem;
}

.hero-section::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at right, rgba(255, 255, 255, 0.2), transparent 55%);
  pointer-events: none;
}

.hero-kpi {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1rem;
  padding: 1rem 1.2rem;
  backdrop-filter: blur(6px);
}

.feature-card {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 18px 40px rgba(12, 53, 99, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 60px rgba(12, 53, 99, 0.12);
}

.feature-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 145, 77, 0.18), rgba(29, 78, 137, 0.25));
  color: #1d4e89;
  font-size: 1.3rem;
}

.cta-band {
  background: linear-gradient(135deg, rgba(29, 78, 137, 0.95), rgba(38, 117, 191, 0.92));
  color: #fff;
  border-radius: 1.5rem;
  overflow: hidden;
  position: relative;
}

.cta-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.25), transparent 55%);
  pointer-events: none;
}

.footer-muted {
  color: rgba(13, 36, 64, 0.65);
}

/* Application pages */
.app-body {
  background: var(--brand-bg);
}

.app-container {
  max-width: 1240px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.9rem;
  font-weight: 600;
}

.alert {
  border-radius: 0.75rem;
}

.summary-card {
  background: var(--card-bg);
  border: 1px solid rgba(13, 36, 64, 0.08);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 12px 30px rgba(12, 53, 99, 0.06);
  transition: transform 160ms ease;
}

.summary-card:hover {
  transform: translateY(-3px);
}

.table-card {
  border: 1px solid rgba(13, 36, 64, 0.08);
  border-radius: 1.25rem;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: 0 12px 30px rgba(12, 53, 99, 0.05);
}

.table-modern thead {
  background: linear-gradient(90deg, rgba(29, 78, 137, 0.08), rgba(255, 145, 77, 0.08));
  border-bottom: 1px solid rgba(13, 36, 64, 0.08);
}

.table-modern th {
  font-weight: 600;
  color: var(--text-primary);
}

.table-modern tbody tr:hover {
  background: rgba(38, 117, 191, 0.06);
}

.table-site {
  min-width: 240px;
}

.table-site .site-label {
  font-weight: 600;
}

.table-site .site-url {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.table-site .site-url a {
  color: var(--brand-blue);
}

.table-site .site-url a:hover {
  color: var(--brand-orange);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.status-chip--up {
  background: rgba(29, 178, 108, 0.12);
  color: #1d9e6c;
}

.status-chip--down {
  background: rgba(229, 72, 77, 0.12);
  color: #d1393b;
}

.status-chip--unknown {
  background: rgba(91, 105, 135, 0.12);
  color: #5b6987;
}

.btn-brand {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}

.btn-brand:hover {
  background: var(--brand-blue-light);
  border-color: var(--brand-blue-light);
}

.card-section {
  background: var(--card-bg);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 12px 26px rgba(13, 36, 64, 0.06);
  border: 1px solid rgba(13, 36, 64, 0.08);
}

.screenshot-grid .card {
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(13, 36, 64, 0.08);
  box-shadow: 0 10px 24px rgba(13, 36, 64, 0.08);
}

.screenshot-thumb-wrapper {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  width: 100%;
  max-width: 300px;
  height: 150px;
  background: rgba(13, 36, 64, 0.08);
}

.screenshot-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 160ms ease;
}

.screenshot-thumb:hover {
  transform: scale(1.02);
}

#screenshot-pagination .pagination {
  margin-bottom: 0;
}

#screenshot-pagination .page-link {
  border: none;
  border-radius: 0.75rem;
  color: var(--brand-blue);
}

#screenshot-pagination .page-item.active .page-link {
  background: var(--brand-blue);
  color: #fff;
}

#screenshot-pagination .page-link:focus {
  box-shadow: none;
}

/* Forms / auth */
.auth-body {
  min-height: 100vh;
  background: linear-gradient(145deg, rgba(29, 78, 137, 0.12), rgba(255, 145, 77, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.auth-card {
  background: #fff;
  border-radius: 1.5rem;
  border: 1px solid rgba(13, 36, 64, 0.08);
  box-shadow: 0 24px 60px rgba(13, 36, 64, 0.12);
  padding: 2.5rem;
  width: min(480px, 100%);
}

.auth-card .form-control {
  border-radius: 0.75rem;
}

.auth-card .btn {
  border-radius: 0.75rem;
}

/* Admin */
.admin-hero {
  margin-bottom: 2rem;
}

/* Footer */
footer {
  color: var(--text-muted);
}

@media (max-width: 767px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .page-title {
    font-size: 1.6rem;
  }
}

.log-viewer-content {
  background-color: #101417;
  border-radius: 0.75rem;
  padding: 1rem;
  color: #f8f9fa;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  max-height: 340px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

#log-summary-list code {
  background-color: rgba(15, 23, 42, 0.75);
  padding: 0.15rem 0.35rem;
  border-radius: 0.3rem;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
