/* 
  K-OS CORE CRITICAL STYLES 
  This file handles the immediate visual state before the neural mesh (JS/SCSS) boots.
  Full styles have been moved to src/styles/app/
*/

:root {
  --accent-cyan: #00bac4;
  --bg-dark: #070707;
  --hilt-height: 48px;
  --blade-height: 48px;
}

* { 
  box-sizing: border-box; 
  cursor: none !important; 
  -ms-overflow-style: none;
  scrollbar-width: none;
}

*::-webkit-scrollbar { display: none; }

body { 
  margin: 0; background: var(--bg-dark); color: #fff; 
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', 'Courier New', monospace; font-weight: 500;
  overflow: hidden; -webkit-font-smoothing: antialiased;
}

.katana-frame {
  display: flex; flex-direction: column; width: 100vw; height: 100vh;
  background: #000; position: relative;
  overflow: hidden;
}

.katana-frame::after {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.05) 0px, rgba(0, 0, 0, 0.05) 1px, transparent 1px, transparent 2px);
  pointer-events: none; z-index: 100;
}

.hilt {
  height: var(--hilt-height); background: rgba(0, 186, 196, 0.1);
  border-bottom: 1px solid var(--accent-cyan);
}

.blade {
  height: var(--blade-height); background: rgba(0, 186, 196, 0.05);
  border-top: 1px solid var(--accent-cyan);
}

.main-viewport-content {
  flex: 1; position: relative; overflow-y: auto; overflow-x: hidden;
  -ms-overflow-style: none; scrollbar-width: none;
  display: flex; flex-direction: column;
}

.main-viewport-content::-webkit-scrollbar { display: none; }

.status-bar {
  display: flex; justify-content: space-between; align-items: center;
  height: 100%; padding: 0 20px; font-size: 9px; letter-spacing: 2px;
}

.hilt-actions {
  display: flex; gap: 15px;
}

.hilt-btn {
  background: transparent; border: none; color: var(--accent-cyan);
  font-family: inherit; font-size: 8px; font-weight: 700;
  letter-spacing: 1px; cursor: none !important; opacity: 0.6;
  transition: 0.3s; padding: 4px 8px;
}

.hilt-btn:hover {
  opacity: 1; background: rgba(0, 186, 196, 0.1);
}

.status-indicator {
  color: var(--accent-cyan); font-weight: 700;
}

.hilt-expansion-overlay {
  position: fixed; top: var(--hilt-height); right: 20px;
  background: #000; border: 1px solid var(--accent-cyan);
  padding: 20px; z-index: 1000;
  box-shadow: 0 0 30px rgba(0, 186, 196, 0.2);
}

.expansion-modal {
  display: flex; flex-direction: column; align-items: center; gap: 15px;
}

.modal-close {
  position: absolute; top: 5px; right: 8px; font-size: 14px; opacity: 0.5;
}

.qr-placeholder {
  width: 120px; height: 120px; background: rgba(0, 186, 196, 0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; letter-spacing: 1px; text-align: center;
  border: 1px dashed var(--accent-cyan);
}

.qr-text {
  font-size: 8px; opacity: 0.5; letter-spacing: 1px;
}


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

.chat-input::placeholder {
  animation: blink 1s step-end infinite;
}

.blade, .shadow-katana-root, .chat-input {
  cursor: none !important;
}

/* Pointer Calibration Demo Styling */
.pointer-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.demo-title { font-size: 9px; letter-spacing: 4px; opacity: 0.3; }
.demo-row { display: flex; gap: 20px; }
.demo-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 15px; min-width: 90px;
  border: 1px solid rgba(0, 186, 196, 0.1);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.demo-item:hover {
  background: rgba(0, 186, 196, 0.1);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 186, 196, 0.1);
}
.mode-id { font-size: 9px; opacity: 0.2; font-family: monospace; }
.mode-label { font-size: 11px; letter-spacing: 1.5px; opacity: 0.7; }
.demo-item:hover .mode-label { opacity: 1; }


/* Auth / Login Styles */
.login-view {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; width: 100%; gap: 40px;
  background: radial-gradient(circle at center, rgba(0, 186, 196, 0.05) 0%, transparent 70%);
}

.login-header {
  display: flex; flex-direction: column; align-items: center; gap: 15px;
}

.login-title {
  font-size: 10px; letter-spacing: 4px; opacity: 0.5;
}

.auth-methods {
  display: flex; gap: 20px;
}

.auth-method-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px; min-width: 140px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.auth-method-card:hover {
  background: rgba(0, 186, 196, 0.1);
  transform: translateY(-4px);
}

.auth-icon { font-size: 24px; opacity: 0.6; }
.auth-label { font-size: 9px; letter-spacing: 2px; opacity: 0.4; }
.auth-method-card:hover .auth-label { opacity: 1; }

.auth-flow-step {
  display: flex; flex-direction: column; gap: 15px; width: 280px;
}

.auth-flow-step input {
  background: rgba(255, 255, 255, 0.05); border: none;
  padding: 12px; color: #fff; font-family: inherit; font-size: 12px;
  outline: none; transition: 0.3s;
}

.auth-flow-step input:focus {
  background: rgba(0, 186, 196, 0.1);
}

.auth-flow-step button {
  background: var(--accent-cyan); color: #000; border: none;
  padding: 12px; font-family: inherit; font-size: 10px; font-weight: 700;
  letter-spacing: 2px; transition: 0.3s;
  clip-path: polygon(0 0, 95% 0, 100% 25%, 100% 100%, 5% 100%, 0 75%);
}

.auth-flow-step button:hover:not(:disabled) {
  background: #fff; transform: translateY(-2px);
}

.auth-flow-step button:active:not(:disabled) {
  transform: translateY(0);
}

.auth-flow-step button:disabled {
  opacity: 0.5;
}

.back-link {
  font-size: 9px; opacity: 0.3; text-align: center; margin-top: 10px;
  transition: 0.3s;
}

.back-link:hover { opacity: 1; }

.auth-error {
  color: #ff4444; font-size: 10px; padding: 10px;
  background: rgba(255, 68, 68, 0.1); width: 280px; text-align: center;
}

.auth-info {
  font-size: 9px; opacity: 0.5; text-align: center;
}

.auth-placeholder {
  font-size: 10px; opacity: 0.4; letter-spacing: 2px;
}

/* Welcome Screen / Pre-Init Styles */
.sealed-pre-init {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(0, 186, 196, 0.05) 0%, transparent 70%);
  position: absolute;
  top: 0;
  left: 0;
}

.init-prompt {
  font-size: 14px;
  letter-spacing: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-shadow: 0 0 20px rgba(0, 186, 196, 0.4);
  animation: pulse-glow 2s infinite ease-in-out;
  cursor: pointer;
  margin-bottom: 80px;
  user-select: none;
  text-align: center;
  width: 100%;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.4; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1); }
}

/* Pointer Calibration Demo Styling */
.pointer-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  margin-top: 40px;
}

.demo-label {
  font-size: 9px;
  letter-spacing: 4px;
  opacity: 0.4;
  text-transform: uppercase;
}

.demo-row {
  display: flex;
  gap: 20px;
}

.demo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
  min-width: 80px;
}

.demo-item:hover {
  background: rgba(0, 186, 196, 0.1);
  transform: translateY(-2px);
}

.mode-id {
  font-size: 10px;
  font-family: monospace;
  opacity: 0.3;
}

.mode-label {
  font-size: 8px;
  letter-spacing: 2px;
  opacity: 0.6;
}

/* Debug Console Styles */
.kos-debug-console {
  position: absolute; top: 20px; left: 20px;
  width: 320px; max-height: 200px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(0, 186, 196, 0.2);
  display: flex; flex-direction: column;
  z-index: 100; font-family: monospace;
}

.debug-header {
  font-size: 8px; padding: 6px 10px;
  background: rgba(0, 186, 196, 0.1);
  color: var(--accent-cyan); letter-spacing: 1px;
}

.debug-body {
  flex: 1; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 4px;
}

.log-item { font-size: 9px; line-height: 1.2; }
.log-item.info { color: #aaa; }
.log-item.action { color: var(--accent-cyan); font-weight: 700; }
.log-item.warn { color: #ffcc00; }
.log-item.error { color: #ff4444; }
.log-item .time { opacity: 0.3; margin-right: 6px; }

/* Custom Cursor Styles */
.sealed-cursor-root {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  pointer-events: none;
  z-index: 9999;
  translate: var(--mouse-x, 0) var(--mouse-y, 0);
  rotate: var(--cursor-rot, -45deg);
  scale: var(--cursor-scale, 1);
  will-change: translate, rotate, scale;
  transition: scale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
              rotate 0.2s ease-out;
}

.sealed-cursor-root:not([data-mode="0"]) {
  --cursor-scale: 1.1;
}

.cursor-main {
  width: 100%;
  height: 100%;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cursor-main svg {
  display: none;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 4px rgba(0, 186, 196, 0.4));
}

.sealed-cursor-root[data-mode="0"] .icon-neutral { 
  display: block;
  animation: cursor-breathe 4s infinite ease-in-out;
}

@keyframes cursor-breathe {
  0%, 100% { opacity: 0.6; scale: 1; }
  50% { opacity: 1; scale: 1.05; }
}

.sealed-cursor-root[data-mode="1"] .icon-arrow { display: block; }
.sealed-cursor-root[data-mode="2"] .icon-dot { display: block; }
.sealed-cursor-root[data-mode="3"] .icon-energy { display: block; }
.sealed-cursor-root[data-mode="4"] .icon-investigation { display: block; }
.sealed-cursor-root[data-mode="5"] .icon-comm { display: block; }

.sealed-cursor-root svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 4px rgba(0, 186, 196, 0.4));
}

/* Shadow Katana / Blade CLI Styles */
.shadow-katana {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0 20px;
  gap: 15px;
}

.shadow-katana input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 2px;
  outline: none !important;
  height: 100%;
}

.shadow-katana input::placeholder {
  color: rgba(0, 186, 196, 0.3);
}

.kat-status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 8px;
  letter-spacing: 2px;
  text-transform: uppercase;
  pointer-events: none;
}

.kat-status .label {
  color: var(--accent-cyan);
  opacity: 0.8;
  padding: 2px 6px;
  background: rgba(0, 186, 196, 0.1);
  border-radius: 2px;
}

.kat-status .response {
  color: #fff;
  opacity: 0.4;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
