/* --- Floating Bottom Toolbar (Quick Controls + Reload) --- */
.homepage-floating-toolbar {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.homepage-floating-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  user-select: none;
}

.homepage-floating-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.homepage-floating-btn:active {
  transform: translateY(0);
}

.homepage-floating-btn.qc-btn {
  border-color: rgba(129, 140, 248, 0.4);
  background: rgba(30, 27, 75, 0.85);
}

.homepage-floating-btn.qc-btn:hover {
  border-color: rgba(129, 140, 248, 0.8);
  background: rgba(49, 46, 129, 0.95);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.homepage-floating-btn.loading {
  opacity: 0.85;
  cursor: wait;
}

/* --- Quick Controls Glassmorphic Modal --- */
.qc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.qc-modal-overlay.is-open {
  display: flex;
  opacity: 1;
}

.qc-modal-card {
  width: 100%;
  max-width: 640px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(99, 102, 241, 0.15);
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.qc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.qc-modal-title {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
}

.qc-modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 0.5rem;
}

.qc-header-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qc-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.qc-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.qc-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  padding: 1.15rem;
}

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

.qc-modal-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.qc-modal-btn:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(129, 140, 248, 0.6);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
  transform: translateY(-2px);
}

.qc-modal-btn:active {
  transform: translateY(0);
}

.qc-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.55rem;
}

.qc-btn-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.qc-btn-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.2;
}

.qc-btn-desc {
  font-size: 0.68rem;
  color: #94a3b8;
  line-height: 1.2;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.reload-spinner {
  animation: spin 1s linear infinite;
}



/* --- Ultra-Compact Action Button Cards --- */
.homepage-action-card,
a[href^="#action-"] {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.45rem !important;
  padding: 0.28rem 0.55rem !important;
  min-height: 32px !important;
  height: auto !important;
  border-radius: 0.5rem !important;
  background: rgba(15, 23, 42, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  cursor: pointer !important;
  position: relative !important;
  text-decoration: none !important;
  transition: all 0.16s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.homepage-action-card:hover,
a[href^="#action-"]:hover {
  background: rgba(30, 41, 59, 0.8) !important;
  border-color: rgba(99, 102, 241, 0.8) !important;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.3) !important;
  transform: translateY(-1px) !important;
}

.homepage-action-card [class*="service-icon"],
.homepage-action-card [class*="serviceIcon"],
.homepage-action-card img,
.homepage-action-card svg,
a[href^="#action-"] [class*="service-icon"],
a[href^="#action-"] [class*="serviceIcon"],
a[href^="#action-"] img,
a[href^="#action-"] svg {
  width: 1.15rem !important;
  height: 1.15rem !important;
  min-width: 1.15rem !important;
  max-width: 1.15rem !important;
  flex-shrink: 0 !important;
}

.homepage-action-card [class*="service-name"],
.homepage-action-card [class*="serviceName"],
.homepage-action-card .service-title,
a[href^="#action-"] [class*="service-name"],
a[href^="#action-"] [class*="serviceName"],
a[href^="#action-"] .service-title {
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  color: #f1f5f9 !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
}

.homepage-action-card [class*="service-description"],
.homepage-action-card [class*="serviceDescription"],
.homepage-action-card .service-desc,
a[href^="#action-"] [class*="service-description"],
a[href^="#action-"] [class*="serviceDescription"],
a[href^="#action-"] .service-desc {
  font-size: 0.62rem !important;
  color: #94a3b8 !important;
  line-height: 1.1 !important;
  margin-top: 0.05rem !important;
  opacity: 0.75 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.homepage-action-card.action-running {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.5) !important;
  animation: pulse-glow 1.5s infinite alternate !important;
  pointer-events: none !important;
}

.homepage-action-card.action-success {
  border-color: #22c55e !important;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.6) !important;
}

.homepage-action-card.action-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.6) !important;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 6px rgba(56, 189, 248, 0.3); }
  100% { box-shadow: 0 0 18px rgba(56, 189, 248, 0.7); }
}

/* Red accent on Motherboard Hardware Reset */
a[href="#action-amt-reset"] {
  border-color: rgba(239, 68, 68, 0.35) !important;
  background: rgba(239, 68, 68, 0.08) !important;
}
a[href="#action-amt-reset"]:hover {
  border-color: rgba(239, 68, 68, 0.9) !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4) !important;
}

/* --- Toast Notification System --- */
.homepage-toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 420px;
  width: calc(100% - 3rem);
  pointer-events: none;
}

.homepage-toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  color: #f1f5f9;
  font-size: 0.84rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-12px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.homepage-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.homepage-toast.toast-success {
  border-left: 4px solid #22c55e;
}

.homepage-toast.toast-running {
  border-left: 4px solid #38bdf8;
}

.homepage-toast.toast-error {
  border-left: 4px solid #ef4444;
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.toast-content {
  flex-grow: 1;
  line-height: 1.35;
}

.toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}

.toast-close:hover {
  color: #ffffff;
}

/* --- Compact Dashboard & Sizing Adjustments --- */
[class*="service-container"],
[class*="serviceContainer"],
[class*="service_container"] {
  gap: 0.45rem !important;
}

/* Compact service item cards */
[class*="service_item"],
[class*="serviceItem"],
div[id^="service_"],
a[id^="service_"],
.service-item {
  padding: 0.45rem 0.65rem !important;
  min-height: unset !important;
}

/* Smaller service icons */
[class*="service-icon"],
[class*="serviceIcon"],
[class*="service_item"] img,
[class*="serviceItem"] img,
div[id^="service_"] img,
a[id^="service_"] img,
.service-item img,
[class*="service_item"] svg,
[class*="serviceItem"] svg {
  width: 2rem !important;
  height: 2rem !important;
  min-width: 2rem !important;
  max-width: 2rem !important;
}

/* Smaller service titles */
[class*="service-name"],
[class*="serviceName"],
[class*="service_name"],
.service-title {
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
}

/* Smaller service descriptions */
[class*="service-description"],
[class*="serviceDescription"],
[class*="service_description"],
.service-desc {
  font-size: 0.7rem !important;
  line-height: 1.15 !important;
  margin-top: 0.1rem !important;
  opacity: 0.75 !important;
}

/* Compact widget metrics inside cards */
[class*="service-widget"],
[class*="serviceWidget"],
[class*="service_widget"] {
  font-size: 0.7rem !important;
  padding: 0.15rem 0.35rem !important;
}

/* Smaller group headers */
.group-header,
[class*="group-header"],
[class*="group-title"],
[class*="groupTitle"],
[class*="group_header"] {
  font-size: 0.95rem !important;
  margin-bottom: 0.35rem !important;
  padding-bottom: 0.15rem !important;
}

/* Compact bookmarks */
.bookmark-item,
[class*="bookmark-item"],
[class*="bookmarkItem"] {
  padding: 0.35rem 0.55rem !important;
  font-size: 0.75rem !important;
}

/* Dynamic Auto-Resize: collapse idle now-playing placeholders */
.widget-idle-hidden {
  display: none !important;
  max-height: 0 !important;
  opacity: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* --- Brand Accent Colors & Glowing Hover Effects --- */
div[class*="service_"] > a,
div[class*="service_"] > div,
a.service-item,
div.service-card {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

div[class*="service_"] > a:hover,
div[class*="service_"] > div:hover,
a.service-item:hover,
div.service-card:hover {
  transform: translateY(-2px) !important;
}

/* Glowing Brand Accents */
a[href*="jelly"]:hover { border-color: rgba(168, 85, 247, 0.7) !important; box-shadow: 0 0 18px rgba(168, 85, 247, 0.28) !important; }
a[href*="seerr"]:hover { border-color: rgba(244, 63, 94, 0.7) !important; box-shadow: 0 0 18px rgba(244, 63, 94, 0.28) !important; }
a[href*="tunarr"]:hover { border-color: rgba(14, 165, 233, 0.7) !important; box-shadow: 0 0 18px rgba(14, 165, 233, 0.28) !important; }
a[href*="sonarr"]:hover { border-color: rgba(56, 189, 248, 0.7) !important; box-shadow: 0 0 18px rgba(56, 189, 248, 0.28) !important; }
a[href*="radarr"]:hover { border-color: rgba(251, 191, 36, 0.7) !important; box-shadow: 0 0 18px rgba(251, 191, 36, 0.28) !important; }
a[href*="prowlarr"]:hover { border-color: rgba(249, 115, 22, 0.7) !important; box-shadow: 0 0 18px rgba(249, 115, 22, 0.28) !important; }
a[href*="sabnzbd"]:hover { border-color: rgba(245, 158, 11, 0.7) !important; box-shadow: 0 0 18px rgba(245, 158, 11, 0.28) !important; }
a[href*="qbit"]:hover { border-color: rgba(59, 130, 246, 0.7) !important; box-shadow: 0 0 18px rgba(59, 130, 246, 0.28) !important; }
a[href*="files"]:hover { border-color: rgba(20, 184, 166, 0.7) !important; box-shadow: 0 0 18px rgba(20, 184, 166, 0.28) !important; }
a[href*="bentopdf"]:hover { border-color: rgba(239, 68, 68, 0.7) !important; box-shadow: 0 0 18px rgba(239, 68, 68, 0.28) !important; }
a[href*="budget"]:hover { border-color: rgba(16, 185, 129, 0.7) !important; box-shadow: 0 0 18px rgba(16, 185, 129, 0.28) !important; }
a[href*="docs"]:hover { border-color: rgba(99, 102, 241, 0.7) !important; box-shadow: 0 0 18px rgba(99, 102, 241, 0.28) !important; }
a[href*="dockflare"]:hover { border-color: rgba(249, 115, 22, 0.7) !important; box-shadow: 0 0 18px rgba(249, 115, 22, 0.28) !important; }
a[href*="ntfy"]:hover { border-color: rgba(2, 132, 199, 0.7) !important; box-shadow: 0 0 18px rgba(2, 132, 199, 0.28) !important; }
a[href*="status"]:hover { border-color: rgba(16, 185, 129, 0.7) !important; box-shadow: 0 0 18px rgba(16, 185, 129, 0.28) !important; }
a[href*="scanner"]:hover { border-color: rgba(139, 92, 246, 0.7) !important; box-shadow: 0 0 18px rgba(139, 92, 246, 0.28) !important; }
a[href*="homey"]:hover { border-color: rgba(6, 182, 212, 0.7) !important; box-shadow: 0 0 18px rgba(6, 182, 212, 0.28) !important; }

/* --- Stacked Date & Time Widget --- */
.information-widget-datetime {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
}

.datetime-stacked-custom {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  justify-content: center !important;
  text-align: right !important;
  line-height: 1.1 !important;
}

.datetime-stacked-custom .datetime-time {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
}

.datetime-stacked-custom .datetime-date {
  font-size: 0.725rem !important;
  opacity: 0.8 !important;
  font-weight: 500 !important;
  margin-top: 0.15rem !important;
}
