/* ==============================================================================
   Homepage Master CSS Manifest (config/custom.css)
   ============================================================================== */

/* ==============================================================================
   0. GENERAL CUSTOMIZATIONS
   ============================================================================== */

/* ------------------------------------------------------------------------------
   System
   ------------------------------------------------------------------------------ */

/* Allow the ntfy message field to span up to 3 lines */
#id-service-ntfy .widget-block,
#id-service-ntfy span {
  white-space: normal !important;
}

#id-service-ntfy .text-ellipsis,
#id-service-ntfy div:has(> span) {
  display: -webkit-box !important;
  -webkit-line-clamp: 3;             /* Change to 2 or 3 depending on preference */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------------------------
   Sports
   ------------------------------------------------------------------------------ */

/* Custom styling specifically for Liverpool FC */
#OFF-id-sports-efl-liv {
  border-left: 4px solid #c8102e !important; /* Iconic Liverpool Red */
  background-color: #1a0f12 !important;       /* Subtle dark red/charcoal tint */
}

/* Style the service title specifically for LFC */
#OFF-id-sports-efl-liv .service-name {
  color: #f6eb61 !important;                  /* LFC Yellow/Gold accent text */
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 800 !important;
  letter-spacing: 0.05em !important;
}

/* Customize the underlying widget stat blocks for LFC */
#OFF-id-sports-efl-liv .widget-block {
  border: 1px solid rgba(200, 16, 46, 0.3) !important;
}

/* ==========================================================================
   1. MAIN WRAPPER & ANIMATION ENGINE
   ========================================================================== */

/* Outer container bar anchored to top layout */
#custom-ticker-wrapper {
  width: 100%;
  min-height: 38px;
  height: 38px;
  background-color: #0d0f12;
  border-bottom: 2px solid #006d75;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  overflow: hidden;
  user-select: none;
  position: relative;
  z-index: 99;
}

/* Continuous scrolling track wrapper */
#custom-ticker-marquee {
  display: inline-flex !important;
  align-items: center;
  white-space: nowrap !important;
  width: max-content !important; /* Forces full horizontal width calculation */
  animation: ticker-scroll 70s linear infinite; /* Increased from 60s to 70s for smoother pacing */
  will-change: transform;
}

/* Pause scroll when hovering over the marquee */
#custom-ticker-marquee:hover {
  animation-play-state: paused;
}

/* Seamless 50% translation loop */
@keyframes ticker-scroll {
  0%   { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

/* Prevent track-to-track overlap at loop boundary */
.ticker-track {
  display: inline-flex;
  align-items: center;
  padding-right: 150px; /* Generous trailing buffer so the final Feed & Servers fully clear view */
  box-sizing: border-box;
}

/* ==========================================================================
   2. GLOBAL ELEMENTS, ICONS & TYPOGRAPHY
   ========================================================================== */

/* Base horizontal layout for item links */
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 28px;
  color: #e5e7eb !important;
  text-decoration: none;
  flex-shrink: 0;
  vertical-align: middle;
}

.ticker-item:hover {
  color: #ffffff !important;
}

/* Unified sizing and vertical alignment for logos & crests */
.league-icon,
.team-crest,
.server-icon,
.ticker-icon {
  height: 24px;
  width: auto;
  object-fit: contain;
  margin-right: 4px;
  flex-shrink: 0;
  display: inline-block !important;
  vertical-align: middle !important;
}

.ticker-icon {
  font-size: 1rem;
  line-height: 1;
}

/* ==========================================================================
   3. CATEGORY HIERARCHY & THEMING (NO SHADOWS)
   ========================================================================== */

.ticker-category,
.category-major,
.category-minor,
.ticker-item.category-item,
.ticker-category *,
.category-major * {
  text-shadow: none !important;
  box-shadow: none !important;
  filter: none !important;
}

.ticker-category,
.category-major,
.category-minor,
.ticker-item.category-item {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px;
  color: #e0f2fe !important;
  text-transform: uppercase;
  flex-shrink: 0;
  vertical-align: middle !important;
}

/* Major Category Header Pill (Deep Pacific Teal Background) */
.ticker-category,
.category-major,
.ticker-item.category-item.major {
  background-color: #004d5a !important;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.8px;
  padding: 3px 10px;
  border-radius: 4px;
  border-left: 3px solid #00a3b4;
  margin: 0 6px 0 16px;
}

/* Minor Subcategory Header Pill (Ocean Dark Teal Background) */
.category-minor,
.ticker-item.category-item.minor {
  background-color: #002f38 !important;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.6px;
  padding: 2px 8px;
  border-radius: 4px;
  border-left: 2px solid #00838f;
  margin: 0 6px 0 10px;
}

.ticker-category.cat-sports,
.ticker-category[data-theme="sports"] {
  background-color: #005b66 !important;
  border: 1px solid #00808c !important;
}

/* ==========================================================================
   4. STOCK TYPOGRAPHY & ALERT BADGES (3%+ MOVES & 52-WEEK EXTREMES)
   ========================================================================== */

.ticker-item.stock-item {
  font-family: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace;
  letter-spacing: -0.2px;
  gap: 6px;
}

/* CNBC Style Index Name */
.stock-index-name {
  color: #ffd700 !important; /* CNBC Yellow */
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
  margin-right: 2px;
}

.stock-symbol {
  font-weight: 700;
  color: #e2e8f0 !important;
  margin-right: 2px;
}

/* Price & Change Directions */
.stock-price.up,
.stock-change.up {
  color: #4ade80 !important; /* Vivid Green */
  font-weight: 600;
}

.stock-price.down,
.stock-change.down {
  color: #f87171 !important; /* Vivid Red */
  font-weight: 600;
}

.stock-price.neutral,
.stock-change.neutral {
  color: #ffffff !important;
  font-weight: 500;
}

/* BuyVM-Style Solid Alert Boxes for 3%+ Moves */
.stock-change.stock-alert-green {
  background-color: rgba(34, 197, 94, 0.25) !important;
  color: #4ade80 !important;
  border: 1px solid #22c55e;
  border-radius: 3px;
  padding: 1px 5px;
  font-weight: 700;
}

.stock-change.stock-alert-red {
  background-color: rgba(239, 68, 68, 0.25) !important;
  color: #ff4d4d !important;
  border: 1px solid #ef4444;
  border-radius: 3px;
  padding: 1px 5px;
  font-weight: 700;
}

/* 52-Week Extreme Alert Badges */
.stock-extreme {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

/* 52-Week High Pill (Gold / Amber Theme with Pulse + Border Glow) */
.stock-extreme.high {
  background-color: rgba(255, 215, 0, 0.25) !important;
  color: #ffd700 !important;
  border: 1px solid #ffd700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
  animation: badge-pulse-gold 1.5s infinite ease-in-out;
}

/* 52-Week Low Pill (Cyan / Ice Theme with Pulse + Border Glow) */
.stock-extreme.low {
  background-color: rgba(0, 229, 255, 0.25) !important;
  color: #00e5ff !important;
  border: 1px solid #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
  animation: badge-pulse-cyan 1.5s infinite ease-in-out;
}

/* Badge Glow & Pulse Keyframes */
@keyframes badge-pulse-gold {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.9);
  }
}

@keyframes badge-pulse-cyan {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.9);
  }
}

/* ==========================================================================
   5. GLOBAL FEED STAMP & TIME-DECAY GRADIENT
   ========================================================================== */

.ticker-item.feed-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: monospace;
  font-weight: 700;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
  vertical-align: middle !important;
}

.feed-item .feed-label {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #ffffff !important;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
  margin-right: 4px;
}

.feed-item .feed-icon {
  font-size: 0.82rem;
  margin-left: 2px;
  display: inline-block;
  transition: all 0.3s ease;
}

.feed-item .feed-icon.metric-alert-yellow {
  color: #ffd700 !important;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
}

.feed-item .feed-icon.metric-alert-red {
  color: #ff4d4d !important;
  filter: drop-shadow(0 0 6px rgba(255, 77, 77, 0.8));
  animation: feed-pulse-red 1.8s infinite ease-in-out;
}

@keyframes feed-pulse-red {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: 0.65; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   6. WEATHER WIDGET & TEMPERATURE SCALE
   ========================================================================== */

.weather-location { font-weight: 600; color: #ffffff !important; }
.weather-cond { color: #d1d5db !important; }
.weather-temp { font-weight: 700; }
.weather-hilow { color: #9ca3af !important; }
.weather-wind { color: #9ca3af !important; font-size: 12px; }

.icon-sunny { color: #ffd700 !important; }
.icon-rain  { color: #00aaff !important; }
.icon-snow  { color: #e0ffff !important; }
.icon-cloud { color: #a0b0c0 !important; }
.icon-fog   { color: #90a0a0 !important; }
.icon-wind  { color: #81d4fa !important; }

.wind-breezy   { color: #81d4fa !important; }
.wind-advisory { color: #ffcc00 !important; font-weight: bold; }
.wind-high     { color: #ff3333 !important; font-weight: bold; text-shadow: 0 0 4px rgba(255, 51, 51, 0.5); }

.temp-extreme-heat { color: #ff0055 !important; text-shadow: 0 0 5px rgba(255, 0, 85, 0.6); font-weight: bold; }
.temp-hot     { color: #ff3333 !important; font-weight: bold; }
.temp-amber   { color: #ff8800 !important; font-weight: bold; }
.temp-yellow  { color: #ffcc00 !important; font-weight: bold; }
.temp-normal  { color: #ffffff !important; }
.temp-cool    { color: #81d4fa !important; }
.temp-cold    { color: #00b0ff !important; }
.temp-freezing{ color: #00e5ff !important; text-shadow: 0 0 5px rgba(0, 229, 255, 0.6); font-weight: bold; }

/* ==========================================================================
   7. SPORTS & SERVER METRICS
   ========================================================================== */

.sports-league { font-size: 11px; background: #374151; color: #d1d5db !important; padding: 1px 4px; border-radius: 3px; margin-right: 4px; }
.game-live { color: #4ade80 !important; font-weight: 600; }
.sports-teams { color: #e5e7eb !important; }
.sports-score { color: #ffffff !important; font-weight: 700; margin: 0 4px; }
.sports-status { color: #9ca3af !important; }

.highlight-SJS { color: #00a3b0 !important; font-weight: 800 !important; }
.highlight-LFC { color: #ef4444 !important; font-weight: 800 !important; }
.highlight-WXM { color: #f87171 !important; font-weight: 800 !important; }
.highlight-NYY { color: #38bdf8 !important; font-weight: 800 !important; }
.highlight-PHX { color: #fb923c !important; font-weight: 800 !important; }
.highlight-CHC { color: #60a5fa !important; font-weight: 800 !important; }
.highlight-LVA { color: #facc15 !important; font-weight: 800 !important; }
.highlight-DAL { color: #818cf8 !important; font-weight: 800 !important; }
.highlight-MIA { color: #2dd4bf !important; font-weight: 800 !important; }
.highlight-HSK { color: #a855f7 !important; font-weight: 800 !important; }
.highlight-LVL { color: #38bdf8 !important; font-weight: 800 !important; }
.highlight-CAL { color: #facc15 !important; font-weight: 800 !important; }

.server-item { display: inline-flex !important; flex-direction: row !important; align-items: center !important; gap: 10px; text-decoration: none; }
.server-name { display: inline-flex !important; align-items: center !important; gap: 6px; line-height: 1 !important; font-weight: 700; color: #ffffff !important; }
.server-offline { opacity: 0.65; }
.server-metric { font-size: 13px; color: #d1d5db !important; }

.metric-alert-red {
  background-color: rgba(239, 68, 68, 0.25) !important;
  color: #ff4d4d !important;
  border: 1px solid #ef4444;
  border-radius: 3px;
  padding: 1px 4px;
  font-weight: bold;
}

.metric-alert-yellow {
  background-image: none !important;
  background-color: rgba(234, 179, 8, 0.2) !important;
  color: #facc15 !important;
  border: 1px solid #eab308;
  border-radius: 3px;
  padding: 1px 4px;
  font-weight: bold;
}


