/* ARCHIE VPS CONTROL PANEL - Styles */
/* Powered by Archie Tech 2024 */

:root {
  /* Archie Theme Colors */
  --bg-primary: #0a0f1c;
  --bg-secondary: #111827;
  --bg-card: #1f2937;
  --bg-card-hover: #283548;
  --border-color: #374151;
  --border-glow: rgba(139, 92, 246, 0.3);
  
  /* Brand Colors */
  --archie-purple: #8b5cf6;
  --archie-blue: #3b82f6;
  --archie-cyan: #06b6d4;
  --archie-pink: #ec4899;
  --archie-green: #10b981;
  --archie-amber: #f59e0b;
  --archie-red: #ef4444;
  
  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #64748b;
  
  /* Gradients */
  --gradient-purple: linear-gradient(135deg, #8b5cf6, #6366f1);
  --gradient-blue: linear-gradient(135deg, #3b82f6, #0ea5e9);
  --gradient-cyan: linear-gradient(135deg, #06b6d4, #22d3ee);
  --gradient-green: linear-gradient(135deg, #10b981, #34d399);
  
  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.2);
  
  /* Fonts */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

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

/* Animated Background */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.grid-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 15s ease-in-out infinite;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--archie-purple);
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--archie-cyan);
  bottom: -50px;
  right: -50px;
  animation-delay: -5s;
}

.orb-3 {
  width: 250px;
  height: 250px;
  background: var(--archie-blue);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(20px, 30px) scale(1.02); }
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  background: rgba(31, 41, 55, 0.8);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  position: relative;
}

.diamond {
  width: 50px;
  height: 50px;
  position: relative;
  transform: rotate(45deg);
  background: var(--gradient-purple);
  border-radius: 8px;
  animation: pulse 2s ease-in-out infinite;
}

.diamond::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
}

.diamond-inner {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  bottom: 14px;
  background: var(--gradient-purple);
  border-radius: 3px;
}

.diamond.small {
  width: 20px;
  height: 20px;
}

.diamond.small::before {
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.5); }
  50% { box-shadow: 0 0 40px rgba(139, 92, 246, 0.8); }
}

.title-section h1 {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary), var(--archie-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--archie-cyan);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 4px;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 25px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
}

.connection-status.connected .status-dot {
  background: var(--archie-green);
  box-shadow: 0 0 10px var(--archie-green);
}

.connection-status.disconnected {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.connection-status.disconnected .status-dot {
  background: var(--archie-red);
  box-shadow: 0 0 10px var(--archie-red);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--archie-amber);
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.ping-display, .last-update {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.ping-display i, .last-update i {
  color: var(--archie-purple);
}

#pingValue {
  font-weight: 700;
  color: var(--archie-green);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  color: var(--archie-red);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--archie-red);
}

/* VPS Info Bar */
.vps-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background: rgba(31, 41, 55, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-item i {
  color: var(--archie-purple);
  font-size: 1rem;
}

.info-item .label {
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.info-item .value {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Stat Cards */
.stat-card {
  background: rgba(31, 41, 55, 0.8);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  padding: 25px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-card);
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--archie-purple);
  box-shadow: var(--shadow-glow);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.card-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
}

.card-icon.cpu { background: var(--gradient-purple); }
.card-icon.memory { background: var(--gradient-green); }
.card-icon.storage { background: var(--gradient-blue); }
.card-icon.network { background: var(--gradient-cyan); }

.card-title h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.card-subtitle {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  display: block;
  margin-top: 2px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Gauge */
.gauge-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
}

.gauge {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-bg {
  fill: none;
  stroke: var(--bg-secondary);
  stroke-width: 10;
}

.gauge-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 1s ease-out;
}

.cpu-gauge { stroke: var(--archie-purple); }
.memory-gauge { stroke: var(--archie-green); }
.storage-gauge { stroke: var(--archie-blue); }
.network-gauge { stroke: var(--archie-cyan); }

.gauge-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.gauge-value .percentage {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.gauge-value .percent-sign {
  font-size: 1rem;
  color: var(--text-tertiary);
}

/* Stat Details */
.stat-details {
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.detail-label {
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.detail-value {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Network Card Specific */
.network-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
  padding: 20px 0;
}

.network-stat {
  display: flex;
  align-items: center;
  gap: 12px;
}

.network-stat i {
  font-size: 1.5rem;
}

.network-stat.download i { color: var(--archie-green); }
.network-stat.upload i { color: var(--archie-cyan); }

.network-info {
  display: flex;
  flex-direction: column;
}

.network-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.network-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Uptime Section */
.uptime-section {
  margin-bottom: 20px;
}

.uptime-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 25px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.uptime-icon {
  width: 60px;
  height: 60px;
  background: var(--gradient-purple);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
}

.uptime-info {
  display: flex;
  flex-direction: column;
}

.uptime-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.uptime-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
}

/* Bottom Section */
.bottom-section {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 1000px) {
  .bottom-section {
    grid-template-columns: 1fr;
  }
}

/* Panels */
.panel {
  background: rgba(31, 41, 55, 0.8);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-header h3 i {
  color: var(--archie-purple);
}

.panel-body {
  padding: 15px 20px;
  max-height: 300px;
  overflow-y: auto;
}

/* Process Table */
.process-table {
  width: 100%;
  border-collapse: collapse;
}

.process-table th,
.process-table td {
  padding: 10px 8px;
  text-align: left;
  font-size: 0.85rem;
}

.process-table th {
  color: var(--text-tertiary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.process-table td {
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}

.process-table tr:hover td {
  background: rgba(139, 92, 246, 0.1);
}

.process-table .loading {
  text-align: center;
  color: var(--text-tertiary);
  padding: 30px;
}

/* Services List */
.services-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.service-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.service-item:hover {
  border-color: var(--archie-purple);
  background: rgba(139, 92, 246, 0.1);
}

.service-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

.service-status {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.service-status.running {
  background: rgba(16, 185, 129, 0.2);
  color: var(--archie-green);
}

.service-status.stopped {
  background: rgba(239, 68, 68, 0.2);
  color: var(--archie-red);
}

/* Actions Grid */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 15px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--archie-purple);
  transform: scale(1.02);
}

.action-btn.danger {
  border-color: rgba(239, 68, 68, 0.3);
}

.action-btn.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--archie-red);
}

.action-btn.danger i {
  color: var(--archie-red);
}

.action-btn i {
  font-size: 1.5rem;
  color: var(--archie-purple);
}

.refresh-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.refresh-btn:hover {
  color: var(--archie-purple);
  background: rgba(139, 92, 246, 0.1);
}

/* Terminal Section */
.terminal-section {
  margin-bottom: 20px;
}

.terminal-panel {
  background: rgba(10, 15, 28, 0.95);
}

.terminal-body {
  padding: 0;
}

.terminal-output {
  padding: 15px 20px;
  min-height: 200px;
  max-height: 300px;
  overflow-y: auto;
  font-family: 'Courier New', 'Fira Code', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

.terminal-line {
  margin-bottom: 5px;
}

.terminal-line .prompt {
  color: var(--archie-green);
  margin-right: 10px;
}

.terminal-line .text {
  color: var(--text-secondary);
}

.terminal-line.success .text {
  color: var(--archie-green);
}

.terminal-line.error .text {
  color: var(--archie-red);
}

.terminal-line.welcome .text {
  color: var(--archie-cyan);
}

.terminal-line.info .text {
  color: var(--text-tertiary);
  font-style: italic;
}

.terminal-input-container {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--border-color);
}

.terminal-prompt {
  color: var(--archie-green);
  font-family: 'Courier New', monospace;
  margin-right: 10px;
  white-space: nowrap;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  outline: none;
}

.terminal-input::placeholder {
  color: var(--text-tertiary);
}

.terminal-send {
  background: var(--gradient-purple);
  border: none;
  color: white;
  padding: 10px 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.terminal-send:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

.terminal-clear {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.terminal-clear:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--archie-red);
  color: var(--archie-red);
}

/* Footer */
.footer {
  padding: 20px;
  text-align: center;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.footer-brand strong {
  color: var(--archie-purple);
}

.footer-links a {
  color: var(--archie-green);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.footer-links a:hover {
  color: var(--archie-cyan);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  max-width: 400px;
  width: 90%;
  overflow: hidden;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--archie-red);
}

.modal-body {
  padding: 25px 20px;
  color: var(--text-secondary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.1);
  border-top: 1px solid var(--border-color);
}

.btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-cancel {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-cancel:hover {
  background: var(--border-color);
}

.btn-confirm {
  background: var(--gradient-purple);
  color: white;
}

.btn-confirm:hover {
  transform: scale(1.02);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 15px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  animation: toastIn 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.success {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--archie-green);
  color: var(--archie-green);
}

.toast.error {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--archie-red);
  color: var(--archie-red);
}

.toast.info {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid var(--archie-blue);
  color: var(--archie-blue);
}

.toast.warning {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid var(--archie-amber);
  color: var(--archie-amber);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--archie-purple);
}

/* Loading State */
.loading {
  color: var(--text-tertiary);
  text-align: center;
  padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 15px;
  }
  
  .header-stats {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .title-section h1 {
    font-size: 1.4rem;
    text-align: center;
  }
  
  .vps-info-bar {
    justify-content: center;
  }
  
  .uptime-value {
    font-size: 1.5rem;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}
