/* 
 * Lumon MDR Terminal Theme for Glance
 * Inspired by the terminal interfaces from Apple TV's "Severance"
 */

/* Base colors and styling */
:root {
  --color-background: #000920;
  --color-primary: #00e5ff;
  --color-accent: #9fefff;
  --glow-shadow: 0 0 5px rgba(0, 229, 255, 0.4), 0 0 10px rgba(0, 229, 255, 0.2);
  --strong-glow: 0 0 10px var(--color-primary), 0 0 20px var(--color-primary);
}

/* Main background and base styling */
body {
  background-color: var(--color-background) !important;
  color: var(--color-primary) !important;
  font-family: "Courier New", monospace !important;
  text-shadow: var(--glow-shadow) !important;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -999;
  background-color: #0a192f;
  box-shadow: inset 0 0 150px rgba(0, 60, 120, 0.5), 
              inset 0 0 50px rgba(0, 30, 60, 0.5) !important;
  pointer-events: none;
}

/* Scanlines effect */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 229, 255, 0.03) 50%, rgba(0, 0, 0, 0.2) 50%);
  background-size: 100% 2px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.3;
}

/* Header styling */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-primary) !important;
  text-shadow: var(--strong-glow) !important;
  font-weight: 400 !important;
  letter-spacing: 2px !important;
}

/* Add blinking cursor effect on main headings */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

h1::after {
  content: "_";
  animation: blink 1s infinite;
  color: var(--color-primary);
  font-weight: normal;
}

/* Widget styling */
.border {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.25) !important;
  background-color: rgba(0, 29, 58, 0.7) !important;
}

.widget {
  background-color: rgba(0, 29, 58, 0.7) !important;
  border: 1px solid rgba(0, 229, 255, 0.4) !important;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.25) !important;
  transition: all 0.3s ease !important;
}

.widget:hover {
  background-color: rgba(0, 56, 101, 0.8) !important;
  border: 1px solid var(--color-primary) !important;
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.7) !important;
}

/* Widget titles */
.widget-title {
  border-bottom: 1px solid var(--color-primary) !important;
  padding-bottom: 5px !important;
  text-transform: uppercase !important;
  letter-spacing: 2px !important;
}

.widget-title a {
  color: var(--color-primary) !important;
  text-shadow: var(--strong-glow) !important;
}

/* Links */
a {
  color: var(--color-primary) !important;
  text-shadow: var(--glow-shadow) !important;
  transition: all 0.2s ease-out !important;
}

a:hover {
  color: var(--color-accent) !important;
  text-shadow: var(--strong-glow) !important;
}

/* Navigation */
.navigation {
  border-color: var(--color-primary) !important;
}

.navigation a {
  color: var(--color-primary) !important;
  text-shadow: var(--glow-shadow) !important;
}

.navigation a:hover, .navigation a.active {
  background-color: rgba(0, 56, 101, 0.8) !important;
  color: var(--color-accent) !important;
  text-shadow: var(--strong-glow) !important;
}

/* CRT animations */
@keyframes flicker {
  0% { opacity: 1.0; }
  1% { opacity: 0.92; }
  2% { opacity: 1.0; }
  67% { opacity: 1.0; }
  68% { opacity: 0.95; }
  69% { opacity: 1.0; }
  70% { opacity: 1.0; }
  71% { opacity: 0.97; }
  72% { opacity: 1.0; }
}

@keyframes distort {
  0% { transform: translateX(0); }
  5% { transform: translateX(-0.5px); }
  10% { transform: translateX(0.5px); }
  15% { transform: translateX(0); }
  100% { transform: translateX(0); }
}

body {
  animation: flicker 8s infinite, distort 4s infinite;
}

/* Specific widget customizations */
/* Calendar widget */
.calendar-widget table {
  border-color: rgba(0, 229, 255, 0.4) !important;
}

.calendar-widget th {
  background-color: rgba(0, 56, 101, 0.8) !important;
  color: var(--color-primary) !important;
}

.calendar-widget td {
  color: var(--color-primary) !important;
}

.calendar-widget .today {
  background-color: rgba(0, 229, 255, 0.2) !important;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.4) !important;
}

/* Monitor widget */
.monitor-widget .online {
  color: var(--color-primary) !important;
  text-shadow: var(--glow-shadow) !important;
}

.monitor-widget .offline {
  color: #ff5555 !important;
  text-shadow: 0 0 5px rgba(255, 85, 85, 0.4), 0 0 10px rgba(255, 85, 85, 0.2) !important;
}

/* Docker containers widget */
.docker-widget .running {
  color: var(--color-primary) !important;
}

.docker-widget .stopped {
  color: #ff5555 !important;
}

/* Search widget */
.search-widget input {
  background-color: rgba(13, 42, 73, 0.7) !important;
  border: 1px solid rgba(0, 229, 255, 0.3) !important;
  color: var(--color-primary) !important;
  box-shadow: inset 0 0 10px rgba(0, 60, 120, 0.3) !important;
}

.search-widget input:focus {
  border: 1px solid var(--color-primary) !important;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3) !important;
}

/* Images and icons */
img, svg {
  filter: drop-shadow(0 0 3px var(--color-primary)) brightness(1.1) !important;
  transition: all 0.3s ease !important;
}

img:hover, svg:hover {
  filter: drop-shadow(0 0 6px var(--color-primary)) brightness(1.5) !important;
}

/* Charts and graphs styling */
.chart rect, .chart path, .chart line {
  stroke: var(--color-primary) !important;
}

.chart text {
  fill: var(--color-primary) !important;
}

/* Apply additional glowing effects to important elements */
.urgent, .important, .highlight {
  text-shadow: var(--strong-glow) !important;
}