﻿:root {
  color-scheme: dark;
  --glass-bg: rgba(17, 25, 40, 0.58);
  --glass-border: rgba(255, 255, 255, 0.18);
  --accent: #f8e686;
  --accent-soft: rgba(248, 230, 134, 0.35);
  --text-main: #f1f5ff;
  --text-muted: rgba(226, 232, 240, 0.78);
  --danger: #ff6b81;
  --success: #6be0a9;
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  color: var(--text-main);
  background: #05070d;
}

body {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: clamp(1.5rem, 3vw, 3rem);
}

.bg-image {
  position: fixed;
  inset: 0;
  background: url('../assets/arazni_halo_wallpaper.jpg') center / cover no-repeat;
  filter: saturate(1.05) contrast(1.08);
  z-index: -2;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top center, rgba(248, 230, 134, 0.32), transparent 46%),
    linear-gradient(180deg, rgba(6, 10, 18, 0.68) 0%, rgba(6, 10, 18, 0.87) 100%);
  z-index: -1;
}

.shell {
  width: 100%;
  max-width: 1800px;
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 2vw, 2.5rem);
  background: rgba(6, 8, 15, 0.62);
  border-radius: 28px;
  padding: clamp(2rem, 4vw, 3rem);
  border: 1px solid rgba(248, 230, 134, 0.18);
  box-shadow: 0 35px 70px rgba(2, 6, 14, 0.5);
  backdrop-filter: blur(26px);
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.25rem, 4vw, 3rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(1rem, 1.8vw, 1.75rem);
  align-items: stretch;
  width: 100%;
}

@media (max-width: 320px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.node-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 46px rgba(7, 12, 22, 0.38);
  backdrop-filter: blur(20px);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  min-height: 100%;
  height: 100%;
}

.node-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-soft);
  box-shadow: 0 30px 60px rgba(6, 12, 24, 0.48);
}

.node-card__media {
  position: relative;
  border-radius: 18px;
  min-height: 90px;
  overflow: hidden;
  background: rgba(12, 18, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 160ms ease, transform 160ms ease;
}

.node-card__media::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--media-image, none);
  background-size: cover;
  background-position: center;
  filter: saturate(1.05) contrast(1.05);
  transition: opacity 200ms ease;
  opacity: 0;
}

.node-card.has-media .node-card__media::before {
  opacity: 1;
}

.node-card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 11, 19, 0) 0%, rgba(7, 11, 19, 0.88) 100%);
}

.node-card__media-label {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.72);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  max-width: calc(100% - 1.5rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.node-card__title {
  margin: 0;
  font-size: 1.24rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.node-card__facts {
  margin: 0;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.meta-row {
  font-size: 0.9rem;
}

.meta-row dd {
  margin: 0;
  color: var(--text-main);
}

.meta-row--compact {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.meta-row--compact dd {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-row--compact dd:not(:last-child)::after {
  content: '•';
  color: var(--text-muted);
  font-size: 0.75rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(15, 20, 35, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-pill::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.status-pill[data-state='online'] {
  color: var(--success);
}

.status-pill[data-state='offline'] {
  color: var(--danger);
}

.status-pill[data-state='checking'] {
  color: var(--text-muted);
}

.details {
  display: grid;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: auto;
}

.control-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.glass-button {
  position: relative;
  padding: 0.6rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
  backdrop-filter: blur(16px);
}

.glass-button::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.03));
  opacity: 0.35;
  pointer-events: none;
}

.glass-button:hover,
.glass-button:focus-visible {
  transform: translateY(-2px);
  background: rgba(248, 230, 134, 0.18);
  border-color: rgba(248, 230, 134, 0.42);
  outline: none;
}

.glass-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(248, 230, 134, 0.25);
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  body {
    padding: 1.1rem;
  }

  .shell {
    padding: 1.6rem;
    gap: 1.6rem;
  }

  .node-card {
    padding: 0.9rem;
    gap: 0.65rem;
  }

  .node-card__media {
    min-height: 80px;
  }

  .node-card__media-label {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (min-width: 1025px) and (max-width: 1400px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}
