﻿/* Created by Łukasz Misiura (c) 2026 | www.lm-ads.com */
:root {
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.5);
  --secondary: #6366f1;
  --accent: #f59e0b;
  --bg-dark: #0f172a; /* Darker */
  --card-bg: rgba(30, 41, 59, 0.5); /* Much darker */
  --card-border: rgba(255, 255, 255, 0.1); /* Subtle border */
  --text-main: #ffffff;
  --text-muted: #94a3b8; /* Classic muted */
  --success: #10b981;
  --danger: #ef4444;
}

html {
  font-size: 110%; /* Scale up everything slightly for better legibility */
}

body {
  background-color: #020617; /* Deepest dark */
  background-image:
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(15, 23, 42, 1) 0px, transparent 80%);
  color: var(--text-main);
  font-family: "Inter", sans-serif;
  min-height: 100vh;
  letter-spacing: -0.01em;
}

.glass-card {
  background: rgba(30, 41, 59, 0.4); /* Darker glass */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08); /* Thinner border */
  border-radius: 1.25rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

/* Premium Glows */
.stat-glow-blue {
  box-shadow: 0 0 35px -10px rgba(59, 130, 246, 0.3);
}
.stat-glow-purple {
  box-shadow: 0 0 35px -10px rgba(168, 85, 247, 0.3);
}
.stat-glow-amber {
  box-shadow: 0 0 35px -10px rgba(245, 158, 11, 0.3);
}
.stat-glow-emerald {
  box-shadow: 0 0 35px -10px rgba(16, 185, 129, 0.3);
}
.stat-glow-pink {
  box-shadow: 0 0 35px -10px rgba(236, 72, 153, 0.3);
}

/* Resource Grid Premium */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .resource-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .resource-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.resource-card {
  position: relative;
  padding: 1.25rem;
  border-radius: 1.25rem;
  background: rgba(30, 41, 59, 0.6); /* Lighter and more opaque */
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: all 0.3s ease;
}

.resource-card:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
}

.resource-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  transition: all 0.3s ease;
}

.resource-card.online::before {
  background: #10b981;
  box-shadow: 0 0 15px #10b981;
}
.resource-card.offline::before {
  background: #ef4444;
  box-shadow: 0 0 15px #ef4444;
}

.vlan-badge {
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #cbd5e1; /* Brighter secondary text */
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@keyframes pulse-soft {
  0%,
  100% {
    opacity: 0.9;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

.pulsing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse-soft 2s infinite ease-in-out;
}

.vlan-bar-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.vlan-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  border-radius: 4px;
  transition: width 1s ease-out;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Modal System */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  width: 95%;
  /* max-width is handled by utility classes or inline often, but default here is ok */
  max-width: 900px;
  max-height: 85vh;
  background: rgba(15, 23, 42, 0.65); /* Darker, more transparent */
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 1.5rem 2rem;
  overflow-y: auto;
}

/* Client Table */
.client-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.client-table th {
  padding: 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #cbd5e1; /* Brighter headers */
  letter-spacing: 0.08em;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.client-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
}

.client-table tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.client-table tr:last-child td {
  border-bottom: none;
}

/* Resource Grid (monitored.php) */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

.resource-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.resource-card:hover {
  transform: translateY(-4px);
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.4);
}

.resource-card.online::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--success);
  box-shadow: 0 2px 10px var(--success);
}

.resource-card.offline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--danger);
}
/* Fix for dropdown hover gap */
.dropdown-proxy .group-hover\:opacity-100::before {
  content: "";
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  height: 20px;
  background: transparent;
}

/* ============================================
   SECURITY SHIELD ANIMATIONS
   ============================================ */

/* Safe shield - gentle glow */
.shield-safe {
  filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.4));
  animation: shield-glow 3s ease-in-out infinite;
}

@keyframes shield-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 30px rgba(16, 185, 129, 0.6));
  }
}

/* Danger shield - pulsing red */
.shield-danger {
  filter: drop-shadow(0 0 25px rgba(239, 68, 68, 0.6));
  animation: shield-pulse-bg 1.5s ease-in-out infinite;
}

@keyframes shield-pulse-bg {
  0%,
  100% {
    filter: drop-shadow(0 0 25px rgba(239, 68, 68, 0.6));
    opacity: 0.1;
  }
  50% {
    filter: drop-shadow(0 0 40px rgba(239, 68, 68, 0.9));
    opacity: 0.15;
  }
}

/* Small shield icon pulse */
.shield-pulse {
  animation: shield-pulse-icon 1.5s ease-in-out infinite;
}

@keyframes shield-pulse-icon {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.5));
  }
  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.8));
  }
}

/* ============================================
   CUSTOM SCROLLBARS - Glassmorphism Theme
   ============================================ */

/* Webkit Browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(59, 130, 246, 0.4) 0%,
    rgba(99, 102, 241, 0.4) 100%
  );
  border-radius: 10px;
  border: 2px solid rgba(15, 23, 42, 0.5);
  transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(59, 130, 246, 0.7) 0%,
    rgba(99, 102, 241, 0.7) 100%
  );
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

::-webkit-scrollbar-thumb:active {
  background: linear-gradient(
    180deg,
    rgba(59, 130, 246, 0.9) 0%,
    rgba(99, 102, 241, 0.9) 100%
  );
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.4) rgba(15, 23, 42, 0.5);
}

/* Modal scrollbars - slightly thinner */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.3);
  border-radius: 8px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(59, 130, 246, 0.5) 0%,
    rgba(99, 102, 241, 0.5) 100%
  );
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.3);
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(59, 130, 246, 0.8) 0%,
    rgba(99, 102, 241, 0.8) 100%
  );
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

/* Dark Option Styling for Selects */
select option {
  background-color: #0f172a !important; /* Matches --bg-dark */
  color: #e2e8f0 !important; /* Slate-200 */
  padding: 10px;
}
