@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P:wght@400&display=swap');

:root {
  --background: 120 100% 4%;
  --foreground: 120 100% 85%;
  --card: 120 100% 8%;
  --card-foreground: 120 100% 90%;
  --popover: 120 100% 6%;
  --popover-foreground: 120 100% 90%;
  --primary: 120 100% 25%;
  --primary-foreground: 120 100% 95%;
  --secondary: 120 50% 15%;
  --secondary-foreground: 120 100% 85%;
  --muted: 120 50% 12%;
  --muted-foreground: 120 50% 60%;
  --accent: 120 100% 20%;
  --accent-foreground: 120 100% 90%;
  --destructive: 0 100% 35%;
  --destructive-foreground: 0 0% 100%;
  --border: 120 100% 18%;
  --input: 120 100% 10%;
  --ring: 120 100% 40%;
  --radius: 2px;
  --terminal-green: #00ff00;
  --terminal-bright: #33ff33;
  --terminal-dim: #009900;
  --security-red: #ff3333;
  --warning-amber: #ffaa00;
}

* {
  border-color: hsl(var(--border));
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

body {
  background: 
    radial-gradient(circle at 25% 25%, rgba(0, 255, 0, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(0, 255, 0, 0.05) 0%, transparent 50%),
    linear-gradient(135deg, hsl(var(--background)) 0%, #001100 100%);
  background-attachment: fixed;
  color: var(--terminal-green);
  font-family: 'Press Start 2P', monospace;
  margin: 0;
  padding: 0;
  line-height: 1.8;
  font-size: 12px;
  text-shadow: 0 0 3px currentColor;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 255, 0, 0.03) 2px,
      rgba(0, 255, 0, 0.03) 4px
    );
  pointer-events: none;
  z-index: 1000;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  position: relative;
  z-index: 1;
}

.card {
  background: linear-gradient(145deg, hsl(var(--card)), #002200);
  color: hsl(var(--card-foreground));
  border: 2px solid var(--terminal-green);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 
    0 0 10px rgba(0, 255, 0, 0.3),
    inset 0 1px 0 rgba(0, 255, 0, 0.1),
    0 4px 8px rgba(0, 0, 0, 0.5);
  position: relative;
  backdrop-filter: blur(1px);
}

.card::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  height: 2px;
  background: linear-gradient(90deg, var(--terminal-green), transparent);
  opacity: 0.6;
}

.card-header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0, 255, 0, 0.3);
  padding-bottom: 1rem;
}

.card-title {
  font-size: 16px;
  font-weight: 400;
  margin: 0 0 0.5rem 0;
  color: var(--terminal-bright);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 5px currentColor;
}

.card-description {
  color: hsl(var(--muted-foreground));
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 10px;
  font-weight: 400;
  cursor: pointer;
  border: 2px solid;
  transition: all 0.2s ease;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Press Start 2P', monospace;
  position: relative;
  overflow: hidden;
}

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

.button:hover::before {
  left: 100%;
}

.button-primary {
  background: linear-gradient(145deg, var(--terminal-green), var(--terminal-dim));
  color: #000000;
  border-color: var(--terminal-bright);
  text-shadow: none;
  box-shadow: 
    0 0 10px rgba(0, 255, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.button-primary:hover {
  background: linear-gradient(145deg, #003300, var(--terminal-dim));
  color: var(--terminal-bright);
  box-shadow: 
    0 0 15px rgba(0, 255, 0, 0.8),
    inset 0 1px 0 rgba(0, 255, 0, 0.2);
  transform: translateY(-1px);
}

.button-secondary {
  background: linear-gradient(145deg, hsl(var(--secondary)), #003300);
  color: var(--terminal-green);
  border-color: var(--terminal-dim);
  box-shadow: 
    0 0 5px rgba(0, 255, 0, 0.3),
    inset 0 1px 0 rgba(0, 255, 0, 0.1);
}

.button-secondary:hover {
  background: linear-gradient(145deg, hsl(var(--accent)), #004400);
  box-shadow: 
    0 0 10px rgba(0, 255, 0, 0.5),
    inset 0 1px 0 rgba(0, 255, 0, 0.2);
}

.button-destructive {
  background: linear-gradient(145deg, var(--security-red), #cc0000);
  color: #ffffff;
  border-color: #ff6666;
  box-shadow: 
    0 0 10px rgba(255, 51, 51, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.button-destructive:hover {
  background: linear-gradient(145deg, #ff6666, var(--security-red));
  box-shadow: 
    0 0 15px rgba(255, 51, 51, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--terminal-dim);
  border-radius: var(--radius);
  background: linear-gradient(145deg, hsl(var(--input)), #001100);
  color: var(--terminal-green);
  font-size: 10px;
  box-sizing: border-box;
  font-family: 'Press Start 2P', monospace;
  text-shadow: 0 0 2px currentColor;
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.5),
    0 0 5px rgba(0, 255, 0, 0.2);
}

.input:focus {
  outline: none;
  border-color: var(--terminal-bright);
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(0, 255, 0, 0.6),
    0 0 5px rgba(0, 255, 0, 0.4);
  background: linear-gradient(145deg, #002200, hsl(var(--input)));
}

.input::placeholder {
  color: rgba(0, 255, 0, 0.5);
  text-shadow: none;
}

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

.label {
  display: block;
  font-size: 10px;
  font-weight: 400;
  margin-bottom: 0.5rem;
  color: var(--terminal-bright);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 3px currentColor;
}

.nav {
  background: linear-gradient(145deg, hsl(var(--card)), #001a00);
  border-bottom: 2px solid var(--terminal-green);
  padding: 1rem 0;
  margin-bottom: 2rem;
  box-shadow: 
    0 2px 10px rgba(0, 255, 0, 0.3),
    inset 0 1px 0 rgba(0, 255, 0, 0.1);
  position: relative;
}

.nav::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    var(--terminal-green) 0px,
    var(--terminal-green) 4px,
    transparent 4px,
    transparent 8px
  );
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-size: 20px;
  font-weight: 400;
  color: var(--terminal-bright);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 
    0 0 10px currentColor,
    0 0 20px currentColor,
    0 0 30px currentColor;
  position: relative;
}

.nav-brand::before {
  content: '> ';
  color: var(--terminal-green);
}

.nav-brand::after {
  content: ' _';
  animation: blink 1s infinite;
}

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

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--terminal-green);
  text-decoration: none;
  font-weight: 400;
  transition: all 0.3s ease;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 12px;
  border: 1px solid transparent;
  position: relative;
}

.nav-links a::before {
  content: '[';
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-links a::after {
  content: ']';
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-links a:hover {
  color: var(--terminal-bright);
  text-shadow: 0 0 8px currentColor;
  border-color: var(--terminal-green);
  background: rgba(0, 255, 0, 0.1);
}

.nav-links a:hover::before,
.nav-links a:hover::after {
  opacity: 1;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  
  body {
    font-size: 10px;
  }
  
  .nav-brand {
    font-size: 16px;
    letter-spacing: 2px;
  }
  
  .nav-links {
    gap: 1rem;
  }
}

.chat-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.chat-item {
  padding: 1rem;
  border-bottom: 1px solid rgba(0, 255, 0, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.05), transparent);
}

.chat-item::before {
  content: '>';
  position: absolute;
  left: 8px;
  color: var(--terminal-green);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.chat-item:hover {
  background: linear-gradient(90deg, rgba(0, 255, 0, 0.1), rgba(0, 255, 0, 0.2), rgba(0, 255, 0, 0.1));
  border-color: var(--terminal-bright);
  box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.3);
  padding-left: 2rem;
}

.chat-item:hover::before {
  opacity: 1;
}

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

.chat-name {
  font-weight: 400;
  margin-bottom: 0.5rem;
  color: var(--terminal-bright);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.chat-preview {
  color: hsl(var(--muted-foreground));
  font-size: 8px;
  letter-spacing: 0.5px;
}

.message-container {
  max-height: 400px;
  overflow-y: auto;
  border: 2px solid var(--terminal-green);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(145deg, hsl(var(--background)), #000800);
  box-shadow: 
    inset 0 0 20px rgba(0, 0, 0, 0.7),
    0 0 10px rgba(0, 255, 0, 0.3);
  position: relative;
}

.message-container::before {
  content: '=== SECURE CHANNEL ===';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: hsl(var(--background));
  color: var(--terminal-green);
  padding: 0 10px;
  font-size: 8px;
  letter-spacing: 1px;
}

.message-container::-webkit-scrollbar {
  width: 12px;
}

.message-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 0;
}

.message-container::-webkit-scrollbar-thumb {
  background: var(--terminal-green);
  border-radius: 0;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.message {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: linear-gradient(145deg, hsl(var(--muted)), #002200);
  border: 1px solid rgba(0, 255, 0, 0.3);
  position: relative;
  font-size: 10px;
}

.message::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border: 1px solid rgba(0, 255, 0, 0.2);
  border-radius: 1px;
  pointer-events: none;
}

.message-own {
  background: linear-gradient(145deg, var(--terminal-dim), #006600);
  color: var(--terminal-bright);
  margin-left: 2rem;
  border-color: var(--terminal-bright);
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.4);
}

.message-own::after {
  content: '[SENT]';
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 6px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 1px;
}

.message-other {
  margin-right: 2rem;
}

.message-other::after {
  content: '[RECV]';
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 6px;
  color: rgba(0, 255, 0, 0.6);
  letter-spacing: 1px;
}

.message-header {
  font-size: 8px;
  color: rgba(0, 255, 0, 0.7);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.message-own .message-header {
  color: rgba(255, 255, 255, 0.8);
}

.message-input-form {
  display: flex;
  gap: 0.5rem;
  position: relative;
}

.message-input-form::before {
  content: 'INPUT:';
  position: absolute;
  top: -20px;
  left: 0;
  font-size: 8px;
  color: var(--terminal-green);
  letter-spacing: 1px;
}

.message-input {
  flex: 1;
  background: linear-gradient(145deg, #000a00, hsl(var(--input)));
}

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.spinner {
  border: 3px solid rgba(0, 255, 0, 0.3);
  border-top: 3px solid var(--terminal-green);
  border-radius: 0;
  width: 24px;
  height: 24px;
  animation: retro-spin 0.8s linear infinite;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

@keyframes retro-spin {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(90deg); }
  50% { transform: rotate(180deg); }
  75% { transform: rotate(270deg); }
  100% { transform: rotate(360deg); }
}

.hero {
  text-align: center;
  padding: 4rem 0;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--terminal-green), transparent);
  opacity: 0.8;
}

.hero-title {
  font-size: 32px;
  font-weight: 400;
  margin-bottom: 2rem;
  color: var(--terminal-bright);
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow: 
    0 0 10px currentColor,
    0 0 20px currentColor,
    0 0 30px currentColor;
  position: relative;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 
      0 0 10px currentColor,
      0 0 20px currentColor,
      0 0 30px currentColor;
  }
  to {
    text-shadow: 
      0 0 15px currentColor,
      0 0 25px currentColor,
      0 0 35px currentColor,
      0 0 40px currentColor;
  }
}

.hero-description {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.8;
  letter-spacing: 1px;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.feature-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(0, 255, 0, 0.3);
  position: relative;
  transition: all 0.3s ease;
}

.feature-item::before {
  content: '█';
  position: absolute;
  left: -10px;
  color: var(--terminal-green);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-item:hover {
  padding-left: 20px;
  background: rgba(0, 255, 0, 0.05);
}

.feature-item:hover::before {
  opacity: 1;
}

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

.feature-title {
  font-weight: 400;
  margin-bottom: 0.5rem;
  color: var(--terminal-bright);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
}

.feature-description {
  color: hsl(var(--muted-foreground));
  font-size: 10px;
  line-height: 1.6;
}

.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 2px solid;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  animation: scan 2s linear infinite;
}

@keyframes scan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.alert-success {
  background: linear-gradient(145deg, rgba(0, 255, 0, 0.1), rgba(0, 255, 0, 0.05));
  color: var(--terminal-bright);
  border-color: var(--terminal-green);
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.alert-success::before {
  background: linear-gradient(90deg, transparent, var(--terminal-green), transparent);
}

.alert-success::after {
  content: '[OK]';
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 8px;
  color: var(--terminal-green);
}

.alert-error {
  background: linear-gradient(145deg, rgba(255, 51, 51, 0.1), rgba(255, 51, 51, 0.05));
  color: #ff6666;
  border-color: var(--security-red);
  box-shadow: 0 0 10px rgba(255, 51, 51, 0.3);
}

.alert-error::before {
  background: linear-gradient(90deg, transparent, var(--security-red), transparent);
}

.alert-error::after {
  content: '[ERR]';
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 8px;
  color: var(--security-red);
}

.hidden {
  display: none;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mt-4 {
  margin-top: 1rem;
}

.text-sm {
  font-size: 8px;
}

.font-semibold {
  font-weight: 400;
  color: var(--terminal-bright);
}

textarea.input {
  resize: vertical;
  min-height: 60px;
  font-family: 'Press Start 2P', monospace;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Press Start 2P', monospace;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--terminal-bright);
  text-shadow: 0 0 5px currentColor;
}

a {
  color: var(--terminal-green);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--terminal-bright);
  text-shadow: 0 0 5px currentColor;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.button:disabled:hover {
  transform: none;
  box-shadow: none;
}

.button:disabled::before {
  display: none;
}

select.input {
  background-image: 
    linear-gradient(45deg, transparent 50%, var(--terminal-green) 50%),
    linear-gradient(135deg, var(--terminal-green) 50%, transparent 50%);
  background-position: 
    calc(100% - 15px) center,
    calc(100% - 10px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
  cursor: pointer;
}

.security-badge {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(145deg, rgba(0, 255, 0, 0.9), rgba(0, 255, 0, 0.7));
  color: #000000;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid var(--terminal-green);
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
  z-index: 1001;
  animation: security-pulse 3s ease-in-out infinite;
}

@keyframes security-pulse {
  0%, 100% { 
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
    background: linear-gradient(145deg, rgba(0, 255, 0, 0.9), rgba(0, 255, 0, 0.7));
  }
  50% { 
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.8);
    background: linear-gradient(145deg, rgba(0, 255, 0, 1), rgba(0, 255, 0, 0.8));
  }
}