/* ============================================================
   Homelab dashboard — modern glass UI
   Selectors verified against gethomepage/homepage source
   (services/group.jsx, services/item.jsx, services/list.jsx)
   ============================================================ */

:root {
  --accent-1: #818cf8;
  --accent-2: #c084fc;
  --accent-3: #f0abfc;
  --glass-bg: rgba(255, 255, 255, 0.045);
  --glass-bg-hover: rgba(255, 255, 255, 0.075);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-border-hover: rgba(168, 139, 250, 0.5);
  --radius: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- background ---------- */

body {
  background-color: #0a0a0f;
  background-image:
    radial-gradient(ellipse 900px 600px at 8% -5%, rgba(129, 140, 248, 0.16), transparent 55%),
    radial-gradient(ellipse 900px 600px at 95% 0%, rgba(240, 171, 252, 0.13), transparent 55%),
    radial-gradient(ellipse 1200px 800px at 50% 110%, rgba(129, 140, 248, 0.09), transparent 60%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* ---------- section / group headers ---------- */

.service-group-name {
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2) 55%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  padding-bottom: 2px;
}

.services-group {
  margin-bottom: 0.5rem;
}

/* chevron toggle — always visible, not just on hover, and matches accent */
.services-group svg {
  opacity: 0.55 !important;
  transition: transform 0.25s var(--ease), opacity 0.2s ease;
}
.services-group button:hover svg {
  opacity: 1 !important;
  color: var(--accent-2);
}

/* ---------- service cards ---------- */

.service-card {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--radius) !important;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 8px 20px -8px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  transition:
    transform 0.28s var(--ease),
    background-color 0.28s var(--ease),
    border-color 0.28s var(--ease),
    box-shadow 0.28s var(--ease) !important;
  will-change: transform;
}

.service:hover .service-card {
  transform: translateY(-3px) scale(1.012);
  background: var(--glass-bg-hover) !important;
  border-color: var(--glass-border-hover) !important;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 16px 32px -12px rgba(129, 140, 248, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.07) !important;
}

.service-card:active {
  transform: translateY(-1px) scale(1.005);
}

/* icon: subtle lift + glow ring on hover */
.service-icon {
  transition: filter 0.28s var(--ease), transform 0.28s var(--ease);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}
.service:hover .service-icon {
  transform: scale(1.06);
  filter: drop-shadow(0 4px 10px rgba(129, 140, 248, 0.35));
}

.service-name {
  font-weight: 600 !important;
  letter-spacing: 0.005em;
}

.service-description {
  opacity: 0.65;
}

/* status dots (ping / site monitor) — soft glow instead of flat circle */
.service-ping span,
.service-site-monitor span {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04), 0 0 8px 1px currentColor;
}

/* container/widget stat panels — smoother reveal */
.service-stats,
.service-container-stats {
  transition: max-height 0.35s var(--ease), opacity 0.3s var(--ease) !important;
}

/* resource usage bars inside widget stats */
.service-card [class*="rounded-full"][class*="h-1"] {
  overflow: hidden;
}

/* ---------- information widgets row ---------- */

/* #information-widgets is the whole top bar (border-b + margins from theme).
   #widgets-wrap is the flex row inside it. .widget-container is EACH
   individual widget (greeting / resources / datetime / search) — that's
   the actual card-level target, not the row wrapper. */

#information-widgets {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  padding-bottom: 1.25rem !important;
}

#widgets-wrap {
  gap: 0.75rem;
  row-gap: 0.9rem;
  align-items: stretch;
}

.widget-container {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.45) !important;
  padding: 0.6rem 1.1rem !important;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.widget-container:hover {
  border-color: rgba(168, 139, 250, 0.3) !important;
}

/* the "Homelab" greeting text specifically — was flush against the card
   edge with no breathing room */
.information-widget-greeting {
  padding: 0.15rem 0.3rem !important;
}
.information-widget-greeting span {
  margin-right: 0 !important;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2) 55%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}

.information-widget-resource {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

/* narrow screens: full-width stacked widgets instead of squeezed row */
@media (max-width: 640px) {
  #widgets-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  .widget-container {
    width: 100%;
  }
  .information-widget-greeting span {
    font-size: 1.5rem !important;
  }
}

.resource-icon {
  color: var(--accent-1) !important;
}

.resource-usage {
  overflow: hidden;
  height: 3px !important;
}
.resource-usage > div {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2)) !important;
  transition: width 0.6s var(--ease);
}

/* search box */
.information-widget-search input {
  border-radius: 10px !important;
}

/* ---------- bookmarks (same treatment as services) ---------- */

.bookmark-list li > a > div,
.bookmark-list li > a {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--glass-border) !important;
  border-radius: 12px !important;
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease) !important;
}
.bookmark-list li > a:hover {
  transform: translateY(-2px);
  border-color: var(--glass-border-hover) !important;
}

/* ---------- entrance animation ---------- */

@keyframes hp-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.services-group {
  animation: hp-rise 0.5s var(--ease) both;
}
.services-group:nth-of-type(1) { animation-delay: 0.02s; }
.services-group:nth-of-type(2) { animation-delay: 0.06s; }
.services-group:nth-of-type(3) { animation-delay: 0.1s; }
.services-group:nth-of-type(4) { animation-delay: 0.14s; }
.services-group:nth-of-type(5) { animation-delay: 0.18s; }
.services-group:nth-of-type(6) { animation-delay: 0.22s; }
.services-group:nth-of-type(7) { animation-delay: 0.26s; }
.services-group:nth-of-type(8) { animation-delay: 0.3s; }
.services-group:nth-of-type(9) { animation-delay: 0.34s; }

/* ---------- scrollbar ---------- */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-1), var(--accent-2));
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .service-card,
  .service-icon,
  .services-group,
  .resource-usage > div {
    animation: none !important;
    transition: none !important;
  }
}
