:root {
  --bg-dark: #020205;
  --bg-sidebar: rgba(10, 10, 15, 0.7);
  --accent-blue: #00d2ff;
  --accent-purple: #9d50bb;
  --text-main: #e0e0e0;
  --text-dim: #808080;
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glow: 0 0 20px rgba(0, 210, 255, 0.3);
}

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

body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* --- Layout --- */

.sidebar {
  width: 300px;
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 20px;
  z-index: 10;
}

.main-content {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at center, #0a0a1a 0%, #020205 100%);
}

/* --- J-Core Animation --- */

.core-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.1;
  transition: opacity 0.5s, transform 0.5s;
}

.core-container.processing {
  opacity: 0.8;
  transform: translate(-50%, -50%) scale(1.1);
}

.j-core {
  width: 200px;
  height: 200px;
  position: relative;
}

.j-core svg {
  width: 100%;
  height: 100%;
}

.pulse-ring {
  fill: none;
  stroke: var(--accent-blue);
  stroke-width: 2;
  opacity: 0.5;
  transform-origin: center;
  animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.2; }
  50% { transform: scale(1.2); opacity: 0.5; }
  100% { transform: scale(0.8); opacity: 0.2; }
}

/* --- Chat Interface --- */

.chat-area {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  mask-image: linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
}

.message {
  max-width: 80%;
  padding: 15px 20px;
  border-radius: 15px;
  font-size: 0.95rem;
  animation: slideIn 0.3s ease-out;
}

.message.user {
  align-self: flex-end;
  background: var(--glass);
  border: 1px solid var(--glass-border);
}

.message.jarvis {
  align-self: flex-start;
  background: rgba(0, 210, 255, 0.05);
  border-left: 3px solid var(--accent-blue);
}

.summary-card {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 15px;
  border: 1px solid var(--glass-border);
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

.status-success { color: #00ff88; }
.status-error { color: #ff4444; }

/* --- Input Area --- */

.input-container {
  padding: 30px;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
}

.input-box {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  display: flex;
  gap: 15px;
  padding: 10px 20px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.input-box:focus-within {
  border-color: var(--accent-blue);
  box-shadow: var(--glow);
}

input {
  flex: 1;
  background: none;
  border: none;
  color: #fff;
  font-size: 1rem;
  outline: none;
}

.auth-input {
  width: 120px;
  border-right: 1px solid var(--glass-border);
  padding-right: 15px;
}

button {
  background: none;
  border: none;
  color: var(--accent-blue);
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.2s;
}

button:hover {
  transform: scale(1.1);
}

/* --- Misc --- */

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 10px; }

#auth-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px);
  z-index: 100;
  animation: fadeIn 0.5s ease-in-out;
}

.auth-card {
  width: 400px;
  background: var(--bg-sidebar);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.auth-card h3 {
  letter-spacing: 3px;
  font-size: 0.8rem;
  margin-bottom: 25px;
  color: var(--accent-blue);
  text-shadow: var(--glow);
}

.auth-card input {
  width: 100%;
  text-align: center;
  border-bottom: 1px solid var(--glass-border);
  padding: 12px;
  margin-bottom: 30px;
  font-size: 1.1rem;
  letter-spacing: 5px;
}

.auth-card button {
  width: 100%;
  padding: 12px;
  background: rgba(0, 210, 255, 0.1);
  border: 1px solid var(--accent-blue);
  border-radius: 6px;
  color: var(--accent-blue);
  font-size: 0.8rem;
  letter-spacing: 2px;
  transition: all 0.3s;
}

.auth-card button:hover {
  background: var(--accent-blue);
  color: #000;
  box-shadow: var(--glow);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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