/* ==========================================================================
   WebHaus Premium Design System — Vanilla CSS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  /* HSL Color Palette */
  --bg-main: hsl(250, 24%, 6%);
  --bg-card: hsla(250, 20%, 12%, 0.6);
  --bg-card-hover: hsla(250, 20%, 16%, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  
  --primary: hsl(270, 76%, 60%);
  --primary-glow: hsla(270, 76%, 60%, 0.3);
  --secondary: hsl(310, 70%, 55%);
  --accent-cyan: hsl(190, 80%, 50%);
  
  --text-main: hsl(0, 0%, 93%);
  --text-muted: hsl(250, 10%, 65%);
  --text-inverse: hsl(250, 24%, 6%);
  
  --success: hsl(145, 65%, 45%);
  --success-glow: hsla(145, 65%, 45%, 0.2);
  --danger: hsl(355, 75%, 50%);
  --danger-glow: hsla(355, 75%, 50%, 0.2);
  --warning: hsl(40, 90%, 55%);
  
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  
  --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  --shadow-neon: 0 0 20px var(--primary-glow);
}

/* Base Reset & Layout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
    radial-gradient(at 50% 0%, hsla(272, 70%, 15%, 0.15) 0, transparent 50%),
    radial-gradient(at 100% 100%, hsla(312, 60%, 10%, 0.1) 0, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Animated Aurora Background Mesh */
.aurora {
  position: absolute;
  top: -20%;
  left: 20%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, hsla(270, 76%, 60%, 0.08) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  animation: float 20s infinite alternate ease-in-out;
}

.aurora-right {
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, hsla(190, 80%, 50%, 0.05) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  animation: float-reverse 15s infinite alternate ease-in-out;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-10%, 10%) scale(1.1); }
}

@keyframes float-reverse {
  0% { transform: translate(0, 0) scale(1.1); }
  100% { transform: translate(10%, -10%) scale(0.9); }
}

/* Glassmorphism Container */
.glass-container {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: var(--shadow-premium);
  transition: var(--transition-smooth);
}

.glass-container:hover {
  border-color: var(--border-hover);
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: linear-gradient(135deg, hsl(0, 0%, 100%) 30%, hsl(250, 10%, 80%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-purple {
  background: linear-gradient(135deg, hsl(270, 76%, 65%) 0%, hsl(310, 70%, 60%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Navigation */
header {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(138, 43, 226, 0.4);
}

.logo-text {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}

.logo-text span {
  color: var(--accent-cyan);
}

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--text-main);
  box-shadow: 0 8px 30px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

.btn-primary:hover::after {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px hsla(270, 76%, 60%, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: hsla(250, 20%, 15%, 0.5);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: hsla(250, 20%, 20%, 0.8);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--danger-glow);
  border: 1px solid var(--danger);
  color: var(--text-main);
}

.btn-danger:hover {
  background: var(--danger);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--danger-glow);
}

.input-field {
  width: 100%;
  padding: 14px 16px;
  background: hsla(250, 20%, 8%, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: var(--transition-smooth);
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
  background: hsla(250, 20%, 8%, 0.8);
}

/* Landing Page Specifics */
main.landing {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.hero-card {
  max-width: 600px;
  width: 100%;
  padding: 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.hero-subtitle {
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-cyan);
}

.hero-title {
  font-size: 40px;
  line-height: 1.2;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 480px;
}

.hero-cta {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Floating Login Link */
.portal-footer {
  padding: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.portal-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-fast);
}

.portal-footer a:hover {
  text-decoration: underline;
  color: var(--secondary);
}

/* Login Page Specifics */
main.auth {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-card {
  max-width: 420px;
  width: 100%;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-header {
  text-align: center;
}

.login-header h2 {
  font-size: 28px;
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  padding-left: 4px;
}

.alert-error {
  background: hsla(355, 75%, 50%, 0.15);
  border: 1px solid var(--danger);
  color: var(--text-main);
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  display: none;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* Admin Dashboard Layout */
.admin-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* Sidebar styling */
.admin-sidebar {
  background: hsla(250, 24%, 4%, 0.9);
  border-right: 1px solid var(--border-color);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.sidebar-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 700;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.sidebar-item:hover, .sidebar-item.active {
  color: var(--text-main);
  background: hsla(250, 20%, 15%, 0.6);
}

.sidebar-item.active {
  border-left: 3px solid var(--primary);
  background: hsla(270, 76%, 60%, 0.1);
  color: var(--text-main);
}

.user-profile {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.user-name {
  font-weight: 600;
  font-size: 14px;
}

.user-role {
  font-size: 12px;
  color: var(--accent-cyan);
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  transition: var(--transition-fast);
}

.logout-btn:hover {
  color: var(--danger);
}

/* Main Dashboard Panel */
.admin-main {
  padding: 40px;
  overflow-y: auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.dashboard-title h1 {
  font-size: 32px;
  margin-bottom: 4px;
}

.dashboard-title p {
  color: var(--text-muted);
  font-size: 15px;
}

.glow-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--success-glow);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--success);
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
}

.glow-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(20, 184, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0); }
}

/* Bento Grid Panels */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.bento-card {
  padding: 32px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
}

.card-header {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 20px;
}

/* Whitelist Guestlist CSS */
.whitelist-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 32px;
}

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

.whitelist-form-box {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.whitelist-table-box {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: hsla(250, 20%, 8%, 0.3);
}

.guest-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.guest-table th {
  padding: 16px;
  background: hsla(250, 20%, 6%, 0.8);
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.guest-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

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

.guest-table tr:hover {
  background: hsla(255, 255%, 255%, 0.02);
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.badge-role {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* Docker Status Page styling */
.docker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, min-min(300px, 1fr));
  gap: 24px;
}

.container-card {
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: hsla(250, 20%, 8%, 0.4);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition-smooth);
}

.container-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.container-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.container-name {
  font-size: 18px;
  font-weight: 600;
}

.container-image {
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
}

.state-badge {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.state-running {
  background: var(--success-glow);
  color: var(--success);
}

.state-exited, .state-stopped {
  background: var(--danger-glow);
  color: var(--danger);
}

.container-details {
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Toast Notification styling */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: var(--shadow-premium);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition-smooth);
  z-index: 9999;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  border-left-color: var(--success);
}

.toast-error {
  border-left-color: var(--danger);
}

/* Tab contents control */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Loading overlay */
.loading-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(15, 12, 27, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-fast);
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

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