/* shadcn/ui inspired design system for Netcup Monitor */

:root {
  /* Fresh Green Theme Colors */
  --background: 120 20% 98%;
  --foreground: 160 15% 15%;
  --card: 0 0% 100%;
  --card-foreground: 160 15% 15%;
  --popover: 0 0% 100%;
  --popover-foreground: 160 15% 15%;
  --primary: 142 76% 36%;
  --primary-foreground: 0 0% 100%;
  --secondary: 120 20% 95%;
  --secondary-foreground: 160 15% 15%;
  --muted: 120 15% 96%;
  --muted-foreground: 160 10% 45%;
  --accent: 142 40% 90%;
  --accent-foreground: 160 15% 15%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 100%;
  --border: 120 20% 90%;
  --input: 120 15% 94%;
  --ring: 142 76% 36%;
  --radius: 0.75rem;
  
  /* Status colors - Green themed */
  --success: 142 76% 36%;
  --success-foreground: 0 0% 100%;
  --warning: 45 93% 47%;
  --warning-foreground: 0 0% 100%;
  --error: 0 84% 60%;
  --error-foreground: 0 0% 100%;
  
  /* Fresh green gradients */
  --gradient-primary: linear-gradient(135deg, hsl(142 76% 36%) 0%, hsl(142 60% 45%) 100%);
  --gradient-secondary: linear-gradient(135deg, hsl(120 40% 88%) 0%, hsl(120 30% 92%) 100%);
  --gradient-accent: linear-gradient(135deg, hsl(142 40% 90%) 0%, hsl(120 30% 95%) 100%);
}

.dark {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;
  --popover: 222.2 84% 4.9%;
  --popover-foreground: 210 40% 98%;
  --primary: 217.2 91.2% 59.8%;
  --primary-foreground: 222.2 84% 4.9%;
  --secondary: 217.2 32.6% 17.5%;
  --secondary-foreground: 210 40% 98%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 210 40% 98%;
  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
  --ring: 224.3 76.3% 94.1%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, hsl(120 30% 97%) 0%, hsl(142 25% 95%) 50%, hsl(120 20% 98%) 100%);
  color: hsl(var(--foreground));
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 80%, hsl(142 40% 85% / 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, hsl(120 50% 88% / 0.2) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, hsl(142 30% 90% / 0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

body::after {
  content: '';
  position: fixed;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: 
    linear-gradient(45deg, transparent 40%, hsl(142 60% 85% / 0.05) 50%, transparent 60%),
    linear-gradient(-45deg, transparent 40%, hsl(120 40% 88% / 0.03) 50%, transparent 60%);
  animation: float 20s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(1deg); }
}

@keyframes pulse-green {
  0%, 100% { 
    opacity: 0.3;
    transform: scale(1);
  }
  50% { 
    opacity: 0.6;
    transform: scale(1.1);
  }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.stats-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    hsl(142 76% 36% / 0.1),
    transparent
  );
  transition: left 0.5s ease-in-out;
}

.stats-card:hover::after {
  left: 100%;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Header */
.header {
  background: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(142 20% 98%) 100%);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 
    0 4px 6px -1px rgb(142 76% 36% / 0.1), 
    0 2px 4px -2px rgb(142 76% 36% / 0.1),
    0 1px 3px 0 rgb(0 0 0 / 0.1);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: calc(var(--radius) + 2px) calc(var(--radius) + 2px) 0 0;
}

.header::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, hsl(142 60% 85% / 0.2) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse-green 4s ease-in-out infinite;
}

.header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.header p {
  color: hsl(var(--muted-foreground));
  font-size: 1rem;
}

/* Cards */
.card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  transition: all 0.2s ease-in-out;
}

.card:hover {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.card-content {
  padding: 1.5rem;
}

.card-footer {
  padding: 1.5rem;
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted) / 0.3);
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stats-card {
  background: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(142 15% 98%) 100%);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 
    0 2px 4px 0 rgb(142 76% 36% / 0.05),
    0 1px 3px 0 rgb(0 0 0 / 0.1), 
    0 1px 2px -1px rgb(0 0 0 / 0.1);
  transition: all 0.3s ease-in-out;
  position: relative;
  overflow: hidden;
}

.stats-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0.8;
}

.stats-card:hover {
  box-shadow: 
    0 8px 25px -5px rgb(142 76% 36% / 0.15),
    0 4px 6px -1px rgb(0 0 0 / 0.1), 
    0 2px 4px -2px rgb(0 0 0 / 0.1);
  transform: translateY(-2px);
}

.stats-card:hover::before {
  opacity: 1;
}

.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.stats-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.stats-icon {
  width: 1rem;
  height: 1rem;
  color: hsl(var(--muted-foreground));
}

.stats-value {
  font-size: 2rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  line-height: 1;
}

.stats-description {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.btn-sm {
  height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
}

.btn-md {
  height: 2.5rem;
  padding: 0 1rem;
}

.btn-lg {
  height: 2.75rem;
  padding: 0 2rem;
}

.btn-primary {
  background: var(--gradient-primary);
  color: hsl(var(--primary-foreground));
  border: 1px solid hsl(142 76% 32%);
  box-shadow: 0 2px 4px 0 rgb(142 76% 36% / 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, hsl(142 76% 32%) 0%, hsl(142 60% 41%) 100%);
  box-shadow: 0 4px 8px 0 rgb(142 76% 36% / 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.btn-secondary:hover {
  background-color: hsl(var(--secondary) / 0.8);
}

.btn-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.btn-destructive:hover {
  background-color: hsl(var(--destructive) / 0.9);
}

.btn-outline {
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

.btn-outline:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-ghost {
  background-color: transparent;
  color: hsl(var(--foreground));
}

.btn-ghost:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

/* Table */
.table-container {
  background: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(142 10% 99%) 100%);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 
    0 2px 4px 0 rgb(142 76% 36% / 0.05),
    0 1px 3px 0 rgb(0 0 0 / 0.1), 
    0 1px 2px -1px rgb(0 0 0 / 0.1);
  position: relative;
}

.table-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0.6;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table thead {
  background: linear-gradient(135deg, hsl(142 30% 95%) 0%, hsl(120 20% 96%) 100%);
}

.table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  border-bottom: 1px solid hsl(var(--border));
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}

.table tbody tr:hover {
  background-color: hsl(var(--muted) / 0.3);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: calc(var(--radius) - 2px);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  border: 1px solid transparent;
}

.badge-success {
  background-color: hsl(var(--success) / 0.1);
  color: hsl(var(--success));
  border-color: hsl(var(--success) / 0.2);
}

.badge-warning {
  background-color: hsl(var(--warning) / 0.1);
  color: hsl(var(--warning));
  border-color: hsl(var(--warning) / 0.2);
}

.badge-error {
  background-color: hsl(var(--error) / 0.1);
  color: hsl(var(--error));
  border-color: hsl(var(--error) / 0.2);
}

.badge-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

/* Status specific badges */
.status-running {
  background-color: hsl(var(--success) / 0.1);
  color: hsl(var(--success));
  border-color: hsl(var(--success) / 0.2);
}

.status-shutoff {
  background-color: hsl(var(--error) / 0.1);
  color: hsl(var(--error));
  border-color: hsl(var(--error) / 0.2);
}

.status-paused {
  background-color: hsl(var(--warning) / 0.1);
  color: hsl(var(--warning));
  border-color: hsl(var(--warning) / 0.2);
}

.status-unknown {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.status-throttled {
  background-color: hsl(var(--warning) / 0.1);
  color: hsl(var(--warning));
  border-color: hsl(var(--warning) / 0.2);
}

.status-normal {
  background-color: hsl(var(--success) / 0.1);
  color: hsl(var(--success));
  border-color: hsl(var(--success) / 0.2);
}

/* Whitelist Toggle */
.whitelist-toggle {
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.whitelist-toggle:hover {
  opacity: 0.8;
}

.whitelist-enabled {
  background-color: hsl(var(--success) / 0.1);
  color: hsl(var(--success));
  border-color: hsl(var(--success) / 0.2);
}

.whitelist-disabled {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.whitelist-toggle.disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.form-control {
  display: flex;
  height: 2.5rem;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: all 0.2s ease-in-out;
}

.form-control:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.form-control:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Alerts */
.alert {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 1rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.alert-info {
  background-color: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  border-color: hsl(var(--primary) / 0.2);
}

.alert-success {
  background-color: hsl(var(--success) / 0.1);
  color: hsl(var(--success));
  border-color: hsl(var(--success) / 0.2);
}

.alert-warning {
  background-color: hsl(var(--warning) / 0.1);
  color: hsl(var(--warning));
  border-color: hsl(var(--warning) / 0.2);
}

.alert-error {
  background-color: hsl(var(--error) / 0.1);
  color: hsl(var(--error));
  border-color: hsl(var(--error) / 0.2);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgb(0 0 0 / 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  max-width: 32rem;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted) / 0.3);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Loading */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid hsl(var(--muted));
  border-top: 2px solid hsl(var(--primary));
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .header {
    padding: 1.5rem;
  }
  
  .header h1 {
    font-size: 1.875rem;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  .modal-content {
    width: 95%;
    margin: 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0.75rem;
  }
  
  .header {
    padding: 1rem;
  }
  
  .header h1 {
    font-size: 1.5rem;
  }
  
  .stats-card {
    padding: 1rem;
  }
  
  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

/* Animations */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}

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

/* Focus styles for accessibility */
.btn:focus-visible,
.form-control:focus,
.whitelist-toggle:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}