/* 1Blue Server Control Center Style Sheet */

:root {
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Color Palette */
  --bg-color: #0b0f19;
  --panel-bg: rgba(22, 28, 45, 0.45);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-glow: rgba(0, 168, 255, 0.03);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* Accent Colors */
  --accent-cyan: #00f0ff;
  --accent-blue: #0088ff;
  --accent-green: #00ff87;
  --accent-purple: #9d4edd;
  --accent-orange: #ff9f1c;
  --accent-yellow: #ffd166;
  
  /* Theme Card Gradients */
  --ford-grad: linear-gradient(135deg, #0d47a1 0%, #1976d2 100%);
  --integration-grad: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
  --hbc-grad: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --portainer-grad: linear-gradient(135deg, #005f73 0%, #0a9396 100%);
  --saas-grad: linear-gradient(135deg, #7209b7 0%, #f72585 100%);
  
  --glass-blur: blur(20px);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Background animated glow spots */
.glass-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background: 
    radial-gradient(circle at 10% 20%, rgba(0, 136, 255, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(157, 78, 221, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.05) 0%, transparent 50%);
  filter: blur(80px);
  animation: bg-pulse 15s ease-in-out infinite alternate;
}

@keyframes bg-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.1) rotate(5deg); }
}

/* Header configuration */
header {
  padding: 1.5rem 2rem;
  background: rgba(11, 15, 25, 0.6);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--panel-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.pulse-icon {
  font-size: 1.75rem;
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.6));
  animation: pulse-glow 2s infinite alternate;
}

@keyframes pulse-glow {
  0% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.4)); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.8)); }
}

.system-meta {
  display: flex;
  gap: 1.5rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.meta-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.meta-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Main Layout */
.dashboard-container {
  max-width: 1200px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  flex-grow: 1;
}

/* Glass panel baseline styling */
.section-card, .metric-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--card-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 16px;
  padding: 1.5rem;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.section-card::before, .metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top left, var(--panel-glow), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}

.section-title i {
  color: var(--accent-cyan);
}

/* App Launcher Cards */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  position: relative;
  z-index: 1;
}

.app-card {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
}

.app-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.app-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: white;
  margin-right: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.ford-theme { background: var(--ford-grad); }
.integration-theme { background: var(--integration-grad); }
.hbc-theme { background: var(--hbc-grad); }
.portainer-theme { background: var(--portainer-grad); }
.saas-theme { background: var(--saas-grad); }

.app-details {
  flex-grow: 1;
}

.app-details h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.app-details p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.app-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-weight: 500;
}

.app-badge.active {
  background: rgba(0, 255, 135, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 255, 135, 0.2);
}

.arrow-icon {
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: var(--transition-smooth);
  margin-left: 0.5rem;
}

.app-card:hover .arrow-icon {
  transform: translateX(4px);
  color: var(--accent-cyan);
}

/* Metrics Section styling */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

.metric-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.metric-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.metric-icon {
  font-size: 1.5rem;
  color: var(--accent-cyan);
}

.metric-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.metric-header p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.percentage-badge {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-cyan);
  font-feature-settings: "tnum";
}

.progress-bar-wrapper {
  width: 100%;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.1, 0.8, 0.25, 1);
}

.cpu-gradient { background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-cyan) 100%); }
.mem-gradient { background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-purple) 100%); }
.disk-gradient { background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-green) 100%); }

/* Docker status table */
.section-header-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
}

.section-header-btn .section-title {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.container-count-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 30px;
  background: rgba(0, 136, 255, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(0, 136, 255, 0.2);
}

.table-container {
  overflow-x: auto;
  position: relative;
  z-index: 1;
}

.container-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.container-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.container-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
}

.container-name {
  font-weight: 600;
  color: var(--text-primary);
}

.container-image {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.up {
  background-color: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

.status-dot.down {
  background-color: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

.status-dot.pending {
  background-color: var(--accent-orange);
  box-shadow: 0 0 6px var(--accent-orange);
}

.table-loading {
  text-align: center;
  padding: 2rem !important;
  color: var(--text-secondary);
}

.table-loading i {
  margin-right: 0.5rem;
}

/* Active sessions list */
.sessions-list-wrapper {
  position: relative;
  z-index: 1;
}

.sessions-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.session-card-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.session-icon {
  font-size: 1.25rem;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.session-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.session-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.session-empty {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
  grid-column: 1 / -1;
  padding: 1.5rem;
}

/* Footer layout */
footer {
  text-align: center;
  padding: 2rem;
  margin-top: auto;
  border-top: 1px solid var(--panel-border);
  background: rgba(11, 15, 25, 0.4);
}

footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Responsive adjustment */
@media (max-width: 768px) {
  .header-content {
    justify-content: center;
    text-align: center;
  }
  
  .logo {
    flex-direction: column;
  }
  
  .system-meta {
    justify-content: center;
    width: 100%;
  }
  
  .meta-item {
    align-items: center;
  }
}

/* Token Overlay & Modal */
.token-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.token-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.token-modal {
  width: 90%;
  max-width: 400px;
  padding: 2.5rem;
  text-align: center;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: modal-enter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-enter {
  0% { transform: scale(0.92) translateY(15px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.token-lock-icon {
  font-size: 3rem;
  color: var(--accent-orange);
  filter: drop-shadow(0 0 8px rgba(255, 159, 28, 0.4));
  margin-bottom: 1.25rem;
}

.token-modal h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.token-modal p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

#token-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#token-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#token-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

#token-submit-btn {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.3s ease;
}

#token-submit-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

#token-submit-btn:active {
  transform: translateY(0);
}

.token-error-msg {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 1rem;
  min-height: 1.25rem;
  font-weight: 500;
}

/* E-Mail Notification Settings */
.email-settings-wrapper {
  position: relative;
  z-index: 1;
}

.email-settings-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.email-settings-form {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.email-input-wrapper {
  position: relative;
  flex-grow: 1;
  min-width: 280px;
}

.email-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.05rem;
  pointer-events: none;
  transition: var(--transition-smooth);
}

#recipient-email-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-family);
  outline: none;
  transition: var(--transition-smooth);
}

#recipient-email-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
}

#recipient-email-input:focus + .email-input-icon {
  color: var(--accent-cyan);
}

#email-settings-submit-btn {
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.2s ease, filter 0.3s ease;
}

#email-settings-submit-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.2);
}

#email-settings-submit-btn:active {
  transform: translateY(0);
}

.email-status-msg {
  font-size: 0.85rem;
  margin-top: 1rem;
  min-height: 1.25rem;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.email-status-msg.success {
  color: var(--accent-green);
  text-shadow: 0 0 8px rgba(0, 255, 135, 0.25);
}

.email-status-msg.error {
  color: #ef4444;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.25);
}

/* Fail2ban Security Charts */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

.chart-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.chart-container h3 {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  align-self: flex-start;
}

.chart-container canvas {
  width: 100% !important;
  max-height: 220px;
}


