:root {
  --primary: #00f0ff;
  --secondary: #ff00e4;
  --accent: #7c3aed;
  --dark: #0a0a14;
  --darker: #05050c;
  --light: rgba(255, 255, 255, 0.9);
  --glass: rgba(20, 20, 40, 0.6);
  --glass-light: rgba(255, 255, 255, 0.05);
  --error: #ff3860;
  --success: #2ecc71;
  --warning: #f39c12;
  --info: #3498db;
  --border: rgba(0, 240, 255, 0.2);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

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

body {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--darker) 0%, #0f0f23 50%, var(--dark) 100%);
  font-family: 'Space Grotesk', sans-serif;
  overflow-x: hidden;
  position: relative;
}

/* Background Animations */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: 
    radial-gradient(circle at 20% 80%, rgba(0, 240, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 0, 228, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(124, 58, 237, 0.1) 0%, transparent 50%);
  animation: bgShift 20s ease-in-out infinite;
}

@keyframes bgShift {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(1deg); }
}

.cyber-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(rgba(0, 240, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.02) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -1;
  animation: gridMove 30s linear infinite;
}

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

.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.6;
  animation: float 20s infinite linear;
  box-shadow: 0 0 10px var(--primary);
}

@keyframes float {
  0% { transform: translateY(100vh) translateX(0) scale(0); opacity: 0; }
  10% { opacity: 0.6; transform: scale(1); }
  90% { opacity: 0.6; }
  100% { transform: translateY(-100vh) translateX(100px) scale(0); opacity: 0; }
}

.main-container {
  display: flex;
  min-height: 100vh;
  padding: 20px;
  gap: 30px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

/* Stats Panel */
.stats-panel {
  width: 320px;
  background: var(--glass);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  padding: 30px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stats-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: shimmer 3s ease-in-out infinite;
}

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

.stats-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark);
  font-size: 18px;
  font-weight: 600;
}

.stats-title {
  color: var(--light);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item:last-child {
  border-bottom: none;
}

.stat-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-value {
  color: var(--primary);
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

/* Cyber Container */
.cyber-container {
  width: 420px;
  background: var(--glass);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 40px;
  position: relative;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cyber-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--primary), var(--secondary), var(--accent), var(--primary));
  background-size: 400% 400%;
  border-radius: 26px;
  z-index: -1;
  animation: borderFlow 3s ease infinite;
}

@keyframes borderFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.cyber-container::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--glass);
  border-radius: 22px;
  z-index: -1;
}

.cyber-header {
  text-align: center;
  margin-bottom: 35px;
  position: relative;
}

.cyber-title {
  font-size: 2.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-shadow: 0 0 30px rgba(0, 240, 255, 0.3);
}

.cyber-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* Input Fields */
.input-field {
  position: relative;
  margin-bottom: 30px;
}

.input-field input {
  width: 100%;
  padding: 18px 24px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(0, 240, 255, 0.2);
  border-radius: 16px;
  color: var(--light);
  font-size: 1.1rem;
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.input-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 240, 255, 0.1);
  background: rgba(0, 0, 0, 0.6);
}

.input-field label {
  position: absolute;
  top: 18px;
  left: 24px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.1rem;
  font-family: 'JetBrains Mono', monospace;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-field input:focus + label,
.input-field input:not(:placeholder-shown) + label {
  top: -12px;
  left: 20px;
  font-size: 0.85rem;
  background: var(--darker);
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--primary);
}

/* Buttons */
.cyber-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  border-radius: 16px;
  color: var(--dark);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cyber-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 240, 255, 0.3);
}

.cyber-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Result Area */
.result-container {
  margin-top: 30px;
  padding: 25px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 16px;
  border: 1px solid var(--border);
  display: none;
  animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

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

.result-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--light);
  background: rgba(0, 0, 0, 0.6);
  padding: 15px 20px;
  border-radius: 12px;
  margin: 20px 0;
  text-align: center;
  border-left: 4px solid var(--primary);
  letter-spacing: 2px;
  /* Support for long Session IDs */
  word-wrap: break-word;
  word-break: break-all;
  white-space: normal;
  transition: all 0.5s ease;
}

.success-glow {
  border-color: var(--success) !important;
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.3);
}

.copy-btn {
  width: 100%;
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1rem;
  text-transform: uppercase;
}

.copy-btn.copied {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

#res-status-text{
color: var(--primary);
}
/* Loading & Polling Effects */
.loading {
  display: none;
  text-align: center;
  margin: 25px 0;
}

.cyber-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid transparent;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: relative;
  margin: 0 auto 20px;
}

.cyber-spinner::before {
  content: '';
  position: absolute;
  top: 6px; left: 6px; right: 6px; bottom: 6px;
  border: 3px solid transparent;
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 1.5s linear infinite reverse;
}

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

.loading-text {
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

/* Dynamic Polling Animation */
.checking-active {
  animation: pulse-cyan 2s infinite;
  letter-spacing: 2px;
  color: var(--primary);
}

@keyframes pulse-cyan {
  0%, 100% { text-shadow: 0 0 5px var(--primary); opacity: 0.7; }
  50% { text-shadow: 0 0 15px var(--primary), 0 0 20px var(--primary); opacity: 1; }
}

#session-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  margin-top: 15px;
  text-align: center;
}

/* Error Messages */
.error-message {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 8px;
  display: none;
  padding: 10px;
  background: rgba(255, 56, 96, 0.1);
  border-radius: 8px;
  border-left: 3px solid var(--error);
}

/* Media Queries */
@media (max-width: 768px) {
  .main-container { flex-direction: column; padding: 15px; }
  .stats-panel, .cyber-container { width: 100%; max-width: 400px; }
  .cyber-title { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}