:root {
  --bg-primary: #0b0a12;
  --bg-surface: rgba(18, 16, 28, 0.7);
  --bg-surface-hover: rgba(26, 23, 41, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(124, 58, 237, 0.3);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  
  --color-primary: #8b5cf6;
  --color-primary-hover: #a78bfa;
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
}

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

/* Glowing Backgrounds */
.glow-bg {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(150px);
  z-index: -1;
  opacity: 0.15;
}
.glow-1 {
  background: var(--color-primary);
  top: -100px;
  right: -100px;
}
.glow-2 {
  background: #3b82f6;
  bottom: -150px;
  left: -150px;
}

/* Header & Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2.5rem;
  background: rgba(11, 10, 18, 0.6);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
}
.nav-logo-icon {
  background: linear-gradient(135deg, var(--color-primary), #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Main Layout */
.main-content {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Card Elements (Glassmorphism) */
.glass-card {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.glass-card:hover {
  border-color: rgba(124, 58, 237, 0.25);
  box-shadow: 0 8px 32px 0 rgba(124, 58, 237, 0.08);
}

/* Forms */
.form-container {
  max-width: 420px;
  margin: 4rem auto;
}
.form-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  text-align: center;
  font-weight: 700;
}
.form-subtitle {
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 2rem;
}
.form-group {
  margin-bottom: 1.25rem;
}
.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  outline: none;
  font-size: 0.95rem;
  transition: border 0.2s;
}
.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--color-primary);
  color: white;
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}
.btn-danger {
  background: var(--color-danger);
  color: white;
}
.btn-danger:hover {
  opacity: 0.9;
}
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: 8px;
}
.btn-block {
  width: 100%;
}

/* Dashboard Elements */
.dash-header {
  display: flex;
  justify-content: flex-between;
  align-items: center;
  margin-bottom: 2rem;
}
.dash-title-group h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
}
.dash-title-group p {
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.site-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.site-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.site-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}
.site-domain {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
}
.site-domain:hover {
  color: var(--color-primary-hover);
}
.badge {
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.badge-suspended {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.site-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Deploy Form Area */
.deploy-box {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  background: rgba(255, 255, 255, 0.01);
  margin: 1.5rem 0;
  position: relative;
}
.deploy-box:hover, .deploy-box.dragover {
  border-color: var(--color-primary);
  background: rgba(124, 58, 237, 0.02);
}
.deploy-box input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Tables (Admin panel) */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}
.admin-table th, .admin-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.admin-table th {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 100;
}
.toast {
  background: #1f1d2e;
  border-left: 4px solid var(--color-primary);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease-out;
}
.toast-success {
  border-left-color: var(--color-success);
}
.toast-error {
  border-left-color: var(--color-danger);
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Modal styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
}
.modal {
  width: 90%;
  max-width: 500px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
}
.modal-close:hover {
  color: var(--text-primary);
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gap-2 {
  gap: 0.5rem;
}
.text-center {
  text-align: center;
}
.mt-3 {
  margin-top: 1.5rem;
}

/* ====================================================
   PTERODACTYL-INSPIRED DASHBOARD STYLES
   ==================================================== */

.site-subheader {
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin: -2rem -2rem 2rem -2rem;
  padding: 0 2rem;
  display: flex;
  gap: 1.5rem;
}

.site-tab-item {
  color: var(--text-secondary);
  text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  padding: 1.25rem 0.25rem;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.site-tab-item:hover, .site-tab-item.active {
  color: var(--text-primary);
  border-bottom-color: var(--color-primary);
}

.console-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

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

.metric-card {
  padding: 1.25rem;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 1rem;
}

.metric-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.metric-value {
  font-size: 1.35rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text-primary);
}

.terminal-window {
  border-radius: 12px;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: 'Courier New', Courier, monospace;
  overflow: hidden;
  height: 400px;
  display: flex;
  flex-direction: column;
}

.terminal-header {
  background: #161b22;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.terminal-body {
  padding: 1.25rem;
  flex-grow: 1;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #c9d1d9;
}

.terminal-line {
  margin-bottom: 0.5rem;
  word-break: break-all;
  white-space: pre-wrap;
}

.terminal-line.info { color: #58a6ff; }
.terminal-line.success { color: #3fb950; }
.terminal-line.warn { color: #d29922; }
.terminal-line.error { color: #f85149; }
.terminal-line.log { color: #8b949e; }

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

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

.chart-card {
  padding: 1.5rem;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  height: 250px;
  position: relative;
}

.file-list {
  background: rgba(17, 24, 39, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
}

.file-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr 8rem 8rem;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

.file-row:last-child {
  border-bottom: none;
}

.file-row:hover:not(.file-header-row) {
  background: rgba(255, 255, 255, 0.02);
}

.file-header-row {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 24, 39, 0.5);
}

.file-name-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.file-name-link:hover {
  color: var(--color-primary-hover);
}

.file-icon {
  font-size: 1.15rem;
}
.file-icon.folder {
  color: #f0c674;
}
.file-icon.file {
  color: #81a2be;
}
.file-icon.html {
  color: #de935f;
}
.file-icon.css {
  color: #8abeb7;
}
.file-icon.js {
  color: #b5bd68;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.5rem;
}
.status-dot.active { background: #3fb950; box-shadow: 0 0 8px #3fb950; }
.status-dot.stopped { background: #f85149; box-shadow: 0 0 8px #f85149; }
.status-dot.starting { background: #d29922; box-shadow: 0 0 8px #d29922; }

