:root {
  --bg: #050505;
  --surface: rgba(15, 15, 15, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --muted: #666;
  --accent: #ff0000;
  --accent-glow: rgba(255, 0, 0, 0.4);
  --serif: 'DM Serif Display', serif;
  --sans: 'Manrope', sans-serif;
  
  /* Cyber Glass Effects */
  --glass-blur: blur(16px);
  --glass-sh: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
  --neon-sh: 0 0 15px var(--accent-glow);
  --neon-text: 0 0 8px var(--accent-glow);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body, html {
  background: var(--bg);
  background-image: 
    radial-gradient(circle at 50% 50%, #0a0a0a 0%, #050505 100%),
    url("https://www.transparenttextures.com/patterns/carbon-fibre.png");
  color: var(--text);
  font-family: var(--sans);
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* SCROLLBAR */
#messages::-webkit-scrollbar { width: 4px; }
#messages::-webkit-scrollbar-track { background: transparent; }
#messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.05); }

/* LANDING */
#landing {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.brand {
  font-family: var(--serif);
  font-size: clamp(3.5rem, 10vw, 6rem);
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 0.5rem;
  color: #fff;
  text-shadow: 0 0 20px rgba(255,255,255,0.1);
}

.tagline {
  color: var(--muted);
  margin-bottom: 3.5rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.72rem;
  font-weight: 600;
}

.modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  max-width: 900px;
  width: 100%;
}

.mode-card {
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 3.5rem 2.5rem;
  border-radius: 0;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-sh);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.mode-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
  transform: translateX(-100%);
  transition: 0.6s;
}

.mode-card:hover { 
  border-color: var(--accent);
  box-shadow: var(--neon-sh), var(--glass-sh);
  transform: translateY(-4px);
  background: rgba(20, 20, 20, 0.8);
}

.mode-card:hover::after {
  transform: translateX(100%);
}

.mode-card h2 { font-family: var(--serif); font-size: 1.85rem; margin-bottom: 0.8rem; font-weight: 400; color: #fff; letter-spacing: 1px; }
.mode-card p { color: var(--muted); font-size: 0.85rem; line-height: 1.6; }

#file-input { display: none; }

/* CHAT */
#chat-view {
  display: none;
  flex-direction: column;
  height: 100dvh;
}

.chat-header {
  padding: 1rem 2.5rem;
  background: rgba(0,0,0,0.6);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  z-index: 100;
}

.chat-brand { font-family: var(--serif); font-size: 2rem; color: var(--accent); font-weight: 700; text-shadow: var(--neon-sh); }

.reset-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  color: #888;
  cursor: pointer;
  padding: 0.6rem 1.5rem;
  border-radius: 0;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.2s;
}
.reset-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: var(--neon-sh); }

.heartbeat {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.heartbeat .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: var(--neon-sh);
  animation: pulse 1s infinite;
}

.heartbeat .count { color: #fff; font-weight: 800; }

/* SIDEBAR ARCHIVE */
#sidebar-archive {
  position: fixed;
  top: 0; right: -350px;
  width: 350px; height: 100%;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--glass-border);
  z-index: 1000;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

#sidebar-archive.open { right: 0; }

.archive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--accent);
}

.archive-header button {
  background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer;
}

#archive-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.archive-item {
  padding: 1.25rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  font-size: 0.85rem;
  line-height: 1.6;
  color: #ccc;
  position: relative;
}

.archive-item::before {
  content: 'SIN';
  position: absolute;
  top: 5px; right: 10px;
  font-size: 0.5rem; color: var(--accent); opacity: 0.5;
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  scroll-behavior: smooth;
}

.msg { max-width: 85%; line-height: 1.8; position: relative; animation: msgIn 0.3s ease both; }

.msg.user {
  align-self: flex-end;
  color: #fff;
  font-size: 0.95rem;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(4px);
  border: 1px solid var(--glass-border);
  padding: 1rem 1.5rem;
  border-radius: 0;
}

.msg.bot {
  align-self: flex-start;
  font-family: var(--serif);
  font-size: 1.45rem;
  color: #fff;
  padding: 0.5rem 0;
  border-left: 2px solid var(--accent);
  padding-left: 2.5rem;
  text-shadow: 0 0 20px rgba(0,0,0,0.8);
}

.file-badge {
  display: inline-block;
  font-size: 0.65rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.1rem 0.6rem;
  border-radius: 0;
  margin-bottom: 0.5rem;
  font-family: var(--sans);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
}

/* SHAME CARD */
.aukaat-block {
  align-self: stretch;
  margin-top: 2rem;
  animation: hologramIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.aukaat-card {
  background: rgba(15, 0, 0, 0.9); /* More opaque for capture safety */
  backdrop-filter: var(--glass-blur);
  padding: 5rem 3rem;
  border: 1px solid var(--accent);
  box-shadow: var(--neon-sh), inset 0 0 30px rgba(255, 0, 0, 0.1);
  text-align: center;
  position: relative;
}

.aukaat-card::before {
  content: 'SYSTEM VERDICT';
  position: absolute;
  top: 20px;
  left: 25px;
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 4px;
  opacity: 0.8;
}

.aukaat-label {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.6em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2.5rem;
  text-shadow: var(--neon-sh);
}

.aukaat-text {
  font-family: var(--serif);
  font-size: 2.8rem;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 3.5rem;
  font-weight: 400;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.share-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.no-capture {
  transition: opacity 0.3s ease;
}

.share-btn {
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid var(--accent);
  color: #fff;
  padding: 0.8rem 3rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.share-btn:hover {
  background: var(--accent);
  box-shadow: var(--neon-sh);
  transform: translateY(-2px);
}

@keyframes hologramIn {
  from { opacity: 0; transform: translateY(30px) scale(0.9); filter: brightness(3) blur(10px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: brightness(1) blur(0); }
}

/* INPUT */
.input-area {
  flex-shrink: 0;
  padding: 2.5rem 3rem;
  background: transparent;
}

.input-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: var(--glass-blur);
  padding: 1.25rem 2rem;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-sh);
}

.attach-btn {
  flex-shrink: 0;
  width: 52px; height: 52px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  color: #fff;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.attach-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--neon-sh); }
.attach-btn.active { background: var(--accent); color: #fff; border-color: #fff; box-shadow: var(--neon-sh); }

#user-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 0;
  color: #fff;
  font-family: var(--sans);
  font-size: 1.05rem;
  resize: none;
  outline: none;
  line-height: 1.6;
  max-height: 150px;
  transition: border-color 0.3s;
}
#user-input:focus { border-color: var(--accent); }
#user-input::placeholder { color: #333; }
#user-input:disabled { opacity: 0.1; cursor: not-allowed; }

.send-btn {
  flex-shrink: 0;
  width: 52px; height: 52px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  text-shadow: var(--neon-sh);
}
.send-btn:hover { background: var(--accent); color: #fff; box-shadow: var(--neon-sh); }
.send-btn:disabled { opacity: 0.1; cursor: not-allowed; border-color: rgba(255,255,255,0.05); color: #222; text-shadow: none; }

/* THINKING */
.thinking { display: flex; gap: 10px; align-items: center; padding: 1.5rem 0; }
.thinking span {
  width: 6px; height: 6px; background: var(--accent);
  box-shadow: var(--neon-sh);
  animation: pulse 1.4s ease-in-out infinite;
}
.thinking span:nth-child(2) { animation-delay: 0.2s; }
.thinking span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.9); box-shadow: none; }
  40% { opacity: 1; transform: scale(1.2); box-shadow: var(--neon-sh); }
}

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

@media (max-width: 600px) {
  .msg { max-width: 95%; }
  #messages { padding: 1.5rem; }
  .input-area { padding: 1rem; }
  .input-inner { padding: 0.75rem 1rem; }
}

.burn {
  animation: burnAway 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes burnAway {
  0% { filter: brightness(1) blur(0); transform: scale(1); opacity: 1; }
  50% { filter: brightness(5) sepia(1) hue-rotate(-50deg) blur(5px); transform: scale(1.05); opacity: 0.8; }
  100% { filter: brightness(0) blur(20px); transform: scale(0.9); opacity: 0; }
}

/* SETTINGS MODAL */
#settings-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

#settings-modal.open { display: flex; }

.settings-content {
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  width: 100%;
  max-width: 450px;
  padding: 2.5rem;
  box-shadow: var(--glass-sh);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  font-family: var(--serif);
  font-size: 1.5rem;
  color: #fff;
}

.settings-header button {
  background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer;
}

.setting-item {
  margin-bottom: 2rem;
}

.setting-item label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.setting-item input, .setting-item select {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  padding: 0.75rem 1rem;
  color: #fff;
  font-family: var(--sans);
  outline: none;
}

.setting-item input:focus, .setting-item select:focus {
  border-color: var(--accent);
}

.setting-item .hint {
  font-size: 0.65rem;
  color: #444;
  margin-top: 0.5rem;
  line-height: 1.4;
}

.setting-item select option {
  background: #000;
}
