:root {
  --bg-void: #050b14;
  --bg-card: rgba(26, 11, 46, 0.6);
  --neon-cyan: #00f0ff;
  --neon-magenta: #ff0055;
  --quantum-violet: #8b5cf6;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glow-cyan: 0 0 15px rgba(0, 240, 255, 0.4);
  --glow-magenta: 0 0 15px rgba(255, 0, 85, 0.4);
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

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

/* Background Effects */
.canvas-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(circle at 50% 50%, #0a1628 0%, #050b14 100%);
  overflow: hidden;
}

.particle-system {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.particle {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0.5;
  filter: blur(1px);
  animation: floatParticle linear infinite;
}

@keyframes floatParticle {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  10% { opacity: 0.5; }
  90% { opacity: 0.5; }
  100% { transform: translateY(-80vh) scale(0.5); opacity: 0; }
}

.nebula-glow {
  position: absolute;
  width: 150%;
  height: 150%;
  top: -25%;
  left: -25%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(0, 240, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 0, 85, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
  filter: blur(60px);
  animation: nebulaDrift 20s ease-in-out infinite alternate;
}

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

.hex-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
}

/* DNA Helix Animation (Pure CSS) */
.dna-container {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 2000px;
  opacity: 0.6;
}

.helix {
  position: relative;
  width: 100px;
  height: 600px;
  transform-style: preserve-3d;
  animation: rotateHelix 15s linear infinite;
}

@keyframes rotateHelix {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

.strand-node {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform-style: preserve-3d;
}

.strand-node::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    top: 50%;
    left: 50%;
    transform-origin: left center;
}

.node-a { background: var(--neon-cyan); box-shadow: var(--glow-cyan); }
.node-b { background: var(--neon-magenta); box-shadow: var(--glow-magenta); }

/* Components */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  animation: shimmer 4s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Typography */
.texa-logo {
  font-size: 2.8rem;
  font-weight: 300;
  letter-spacing: 0.1rem;
  text-align: center;
  margin-bottom: 0.5rem;
  color: #fff;
  font-family: 'Inter', sans-serif;
}

.texa-tagline {
  text-align: center;
  font-size: 0.9rem;
  letter-spacing: 0.3rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  opacity: 0.8;
}

.quantum-header {
  text-align: center;
  margin-bottom: 2rem;
}

.quantum-header h2 {
  font-size: 1rem;
  letter-spacing: 0.2rem;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: white;
}

.quantum-header p {
  font-size: 0.7rem;
  letter-spacing: 0.1rem;
  color: var(--neon-cyan);
  text-transform: uppercase;
}

.shimmer-text {
  background: linear-gradient(90deg, var(--neon-cyan), #fff, var(--neon-magenta));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 3s linear infinite;
}

@keyframes textShimmer {
  to { background-position: 200% center; }
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  padding-left: 1rem;
}

.input-pill {
  width: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 18px 24px;
  color: white;
  font-size: 1.1rem;
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(15px);
}

.input-pill:focus {
  border-color: var(--neon-cyan);
  background: rgba(255, 255, 255, 0.1);
}

.input-pill::placeholder {
  color: rgba(255,255,255,0.5);
}

/* Buttons */
.btn-neon {
  width: 100%;
  padding: 16px;
  border-radius: 50px;
  border: none;
  background: linear-gradient(90deg, var(--neon-cyan), var(--quantum-violet));
  color: white;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glow-cyan);
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

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

.btn-outline {
  width: 100%;
  padding: 16px;
  border-radius: 50px;
  border: 1px solid var(--neon-cyan);
  background: transparent;
  color: var(--neon-cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  cursor: pointer;
  margin-top: 1rem;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-outline:hover {
  background: rgba(0, 240, 255, 0.1);
}

/* Layout helpers */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 420px;
  z-index: 10;
}

.orbital-login {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 3rem auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.orbital-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--neon-cyan);
  border-right-color: var(--neon-magenta);
  border-bottom-color: var(--neon-magenta);
  border-left-color: var(--neon-cyan);
  animation: rotateOrbital 10s linear infinite;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.3), inset 0 0 30px rgba(255, 0, 85, 0.3);
  opacity: 0.8;
}

.orbital-ring::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
}

.orbital-ring.inner {
  width: 85%;
  height: 85%;
  animation-direction: reverse;
  animation-duration: 6s;
  border-color: rgba(255,255,255,0.1);
  border-top-color: var(--neon-cyan);
  box-shadow: none;
}

.login-trigger {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: transparent;
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s;
  z-index: 2;
  text-decoration: none;
  letter-spacing: 0.05rem;
}

.login-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

@keyframes rotateOrbital {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.bottom-info {
  margin-top: 3rem;
  text-align: center;
  font-family: monospace;
  font-size: 0.65rem;
  color: var(--neon-cyan);
  letter-spacing: 0.1rem;
  opacity: 0.6;
}

/* Messaging Layout */
.app-shell {
  display: grid;
  grid-template-columns: 350px 1fr;
  height: 100vh;
  width: 100%;
}

.sidebar {
  border-right: 1px solid var(--glass-border);
  background: rgba(5, 11, 20, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
}

.search-container {
    padding: 20px;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 15px;
    cursor: pointer;
    transition: background 0.3s;
    border-left: 3px solid transparent;
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chat-item.active {
    background: rgba(0, 240, 255, 0.05);
    border-left-color: var(--neon-cyan);
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.chat-preview {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    font-size: 0.7rem;
    color: var(--neon-cyan);
}

.chat-main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
}

.top-bar {
  height: 70px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(26, 11, 46, 0.4);
}

.chat-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-area {
  padding: 20px 30px;
  border-top: 1px solid var(--glass-border);
  background: rgba(5, 11, 20, 0.8);
}

/* Chat Bubbles */
.msg {
  max-width: 60%;
  padding: 16px 20px;
  border-radius: 20px;
  font-size: 0.95rem;
  line-height: 1.5;
  position: relative;
}

.msg.sent {
  align-self: flex-end;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid var(--quantum-violet);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.1);
  border-bottom-right-radius: 4px;
}

.msg.received {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 4px;
}

/* Avatar */
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--neon-cyan);
  padding: 2px;
  background: var(--bg-void);
  box-shadow: var(--glow-cyan);
  position: relative;
}

.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a0b2e, #050b14);
  display: flex;
  justify-content: center;
  align-items: center;
}

.status-ring {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: #00ff66;
  border: 2px solid var(--bg-void);
  border-radius: 50%;
  box-shadow: 0 0 10px #00ff66;
}

/* HUD elements */
.hud-label {
  font-size: 0.65rem;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

/* Call Hub */
.call-hub {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100vh;
    padding: 60px 20px;
    text-align: center;
}

.radar-container {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.radar-ring {
    position: absolute;
    border: 1px solid var(--neon-cyan);
    border-radius: 50%;
    animation: radarPulse 4s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    opacity: 0;
}

@keyframes radarPulse {
    0% { width: 40px; height: 40px; opacity: 1; }
    100% { width: 300px; height: 300px; opacity: 0; }
}

.call-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--neon-cyan);
    padding: 5px;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.5);
    z-index: 5;
    background: var(--bg-void);
}

.call-controls {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

.call-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.call-btn.end {
    background: rgba(255, 0, 85, 0.2);
    border-color: var(--neon-magenta);
    color: var(--neon-magenta);
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.3);
}

.call-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--neon-cyan);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.placeholder-icon {
  width: 24px;
  height: 24px;
  color: var(--neon-cyan);
}

/* Responsive Styles */
@media (max-width: 800px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  /* Simple mobile navigation: hide sidebar by default in a real app, 
     but for this wireframe we'll stack them or use a toggle state. 
     Since we can't use JS, we'll make them stackable or provide a way to switch. */
  
  .sidebar {
    height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
  }

  .chat-main {
    height: 60vh;
  }

  .msg {
    max-width: 85%;
  }

  .top-bar {
    padding: 0 15px;
  }

  .chat-content, .input-area {
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .glass-card {
    padding: 24px;
    border-radius: 16px;
  }

  .texa-logo {
    font-size: 2.2rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .call-avatar {
    width: 80px;
    height: 80px;
  }

  .radar-container {
    width: 200px;
    height: 200px;
  }

  @keyframes radarPulse {
      0% { width: 40px; height: 40px; opacity: 1; }
      100% { width: 200px; height: 200px; opacity: 0; }
  }

  .call-controls {
    gap: 15px;
  }

  .call-btn {
    width: 50px;
    height: 50px;
  }

  /* Specific fix for chat.html layout on mobile */
  .app-shell {
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    height: 100vh; /* Ensure it fits the screen */
  }

  .sidebar {
    flex-shrink: 0;
    height: 250px; /* Reduced fixed height for mobile list */
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
  }

  .chat-main {
    flex: 1;
    height: calc(100vh - 250px); /* Fill remaining space */
    overflow: hidden;
  }

  .input-pill {
    padding: 14px 18px;
    font-size: 0.95rem;
  }
  
  .chat-item {
    padding: 10px 15px;
  }

  .stat-card {
    grid-column: span 1 !important;
  }

  .shimmer-text {
    font-size: 2rem !important;
  }
}
