/* ============================================
   features.css — OrbitOS Part 2 Feature Styles
   Docking Mode, Warp Drive, Flight Log,
   Voice Comm, Quick Capture, Deadline,
   Transmission, Mobile fixes
   ============================================ */

/* ════════════════════════════════════════
   PART 1 FIX — Enhanced Glassmorphism
   ════════════════════════════════════════ */

/* Stronger glass effect on all panels */
.panel {
  background: rgba(4, 4, 20, 0.55) !important;
  border: 1px solid rgba(124, 58, 237, 0.18) !important;
  backdrop-filter: blur(28px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(28px) saturate(1.4) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 4px 32px rgba(0,0,0,0.5),
    0 0 20px rgba(124,58,237,0.08);
}

.panel:hover {
  border-color: rgba(124, 58, 237, 0.35) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06) inset,
    0 4px 40px rgba(0,0,0,0.6),
    0 0 30px rgba(124,58,237,0.2),
    0 0 60px rgba(6,182,212,0.08) !important;
}

/* Colored glow per panel type */
#panel-notes:hover  { border-color: rgba(6,182,212,0.35) !important; }
#panel-tasks:hover  { border-color: rgba(124,58,237,0.4) !important; }
#panel-focus:hover  { border-color: rgba(59,130,246,0.35) !important; }
#panel-weather:hover { border-color: rgba(56,189,248,0.35) !important; }
#panel-habits:hover { border-color: rgba(245,158,11,0.35) !important; }
#panel-links:hover  { border-color: rgba(167,139,250,0.35) !important; }

/* ════════════════════════════════════════
   MOBILE RESPONSIVENESS
   ════════════════════════════════════════ */

@media (max-width: 768px) {
  /* All panels become full-width stacked on mobile */
  .panel {
    position: fixed !important;
    width: calc(100vw - 20px) !important;
    left: 10px !important;
    right: 10px !important;
    max-width: 400px;
    /* Reset animation/transform on mobile */
    animation: none !important;
    transform: none !important;
  }

  /* Stack panels vertically */
  #panel-notes  { top: 70px !important; }
  #panel-tasks  { top: calc(70px + 380px + 10px) !important; }
  #panel-focus  { top: calc(70px + 380px + 10px + 330px + 10px) !important; }
  #panel-weather { display: none !important; } /* hide extra panels on mobile */
  #panel-habits  { display: none !important; }
  #panel-links   { display: none !important; }
  #panel-flightlog { display: none !important; }

  /* HUD compacted on mobile */
  .hud-center { display: none; }
  #hud-battery { display: none; }
  #hud-fps     { display: none; }
  .hud-version { display: none; }

  /* Hide cursor effects on mobile */
  #cursor-dot, #cursor-ring { display: none !important; }

  /* Zero-g button smaller */
  #zerog-btn { padding: 10px 18px; font-size: 0.65rem; }
}

@media (max-width: 480px) {
  .panel { width: calc(100vw - 16px) !important; left: 8px !important; }
  #hud-bar { padding: 0 12px; }
  .hud-logo { font-size: 1rem; }
}

/* Overflow protection — panels never go off-screen */
.panel { max-height: calc(100vh - 80px); }
.panel-body { overflow-y: auto; }

/* ════════════════════════════════════════
   DOCKING MODE
   ════════════════════════════════════════ */

.docked-out {
  opacity: 0.06 !important;
  filter: blur(3px) !important;
  pointer-events: none !important;
  transition: opacity 0.4s ease, filter 0.4s ease !important;
}

.panel.docked {
  z-index: 300 !important;
  box-shadow:
    0 0 0 2px rgba(124,58,237,0.5),
    0 0 60px rgba(124,58,237,0.6),
    0 0 120px rgba(6,182,212,0.25),
    0 8px 60px rgba(0,0,0,0.8) !important;
  border-color: rgba(124,58,237,0.7) !important;
  transition: box-shadow 0.4s ease, border-color 0.4s ease !important;
}

#dock-hud-msg {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--accent2);
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(6,182,212,0.3);
  border-radius: 6px;
  padding: 6px 16px;
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
#dock-hud-msg.visible { opacity: 1; }

/* Dock button in panel header */
.dock-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
  flex-shrink: 0;
}
.dock-btn:hover {
  background: rgba(124,58,237,0.3);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 8px rgba(124,58,237,0.4);
}

/* ════════════════════════════════════════
   WARP DRIVE THEME SWITCHER
   ════════════════════════════════════════ */

#warp-switcher {
  position: fixed;
  bottom: 36px;
  left: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

#warp-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
}

.warp-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  cursor: none;
  transition: all 0.2s;
  position: relative;
}

.warp-btn:hover, .warp-btn.active {
  transform: scale(1.3);
  border-color: rgba(255,255,255,0.6);
}

.warp-btn.active::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.5;
}

.warp-btn[data-theme="nebula"]  { background: #7c3aed; box-shadow: 0 0 10px #7c3aed; }
.warp-btn[data-theme="solar"]   { background: #f97316; box-shadow: 0 0 10px #f97316; }
.warp-btn[data-theme="void"]    { background: #22c55e; box-shadow: 0 0 10px #22c55e; }
.warp-btn[data-theme="aurora"]  { background: #06b6d4; box-shadow: 0 0 10px #06b6d4; }

/* Warp flash effect */
#warp-flash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  background: white;
  transition: opacity 0.05s;
}
#warp-flash.flashing {
  opacity: 0.15;
  transition: opacity 0.05s;
}

/* ════════════════════════════════════════
   FLIGHT LOG PANEL
   ════════════════════════════════════════ */

#panel-flightlog { width: 320px; }

.flightlog-section {
  margin-bottom: 12px;
}

.fl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.fl-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.fl-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.fl-bar-wrap {
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.fl-bar {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fl-bar-tasks   { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.fl-bar-focus   { background: linear-gradient(90deg, #3b82f6, var(--accent2)); }
.fl-bar-habits  { background: linear-gradient(90deg, #f59e0b, #22c55e); }
.fl-bar-streak  { background: linear-gradient(90deg, #ef4444, #f59e0b); }

.fl-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  margin: 10px 0;
}

.fl-refresh-btn {
  width: 100%;
  padding: 7px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  cursor: none;
  transition: all 0.2s;
}
.fl-refresh-btn:hover {
  background: rgba(124,58,237,0.15);
  border-color: rgba(124,58,237,0.4);
  color: var(--accent);
}

.flightlog-title {
  background: linear-gradient(90deg, #22d3ee, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 6px rgba(34,211,238,0.5));
}

/* ════════════════════════════════════════
   VOICE COMM
   ════════════════════════════════════════ */

#voice-btn {
  /* Inherits .hud-btn style */
  position: relative;
}

#voice-btn.listening {
  border-color: rgba(239,68,68,0.7) !important;
  color: #ef4444 !important;
  background: rgba(239,68,68,0.15) !important;
  animation: mic-pulse 0.8s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.7); }
  50%       { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
}

.voice-wave {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
}
.voice-wave span {
  display: inline-block;
  width: 2px;
  height: 8px;
  background: currentColor;
  border-radius: 1px;
  animation: wave-bar 0.6s ease-in-out infinite;
}
.voice-wave span:nth-child(2) { animation-delay: 0.1s; height: 12px; }
.voice-wave span:nth-child(3) { animation-delay: 0.2s; height: 6px; }
.voice-wave span:nth-child(4) { animation-delay: 0.3s; height: 10px; }

@keyframes wave-bar {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(0.3); }
}

/* ════════════════════════════════════════
   QUICK CAPTURE FAB
   ════════════════════════════════════════ */

#quick-capture-fab {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 600;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(124,58,237,0.6);
  background: rgba(124,58,237,0.2);
  color: var(--accent);
  font-size: 1.3rem;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  box-shadow: 0 0 20px rgba(124,58,237,0.3);
  backdrop-filter: blur(10px);
}
#quick-capture-fab:hover {
  background: rgba(124,58,237,0.35);
  box-shadow: 0 0 30px rgba(124,58,237,0.5);
  transform: scale(1.1);
}

#quick-capture-popover {
  position: fixed;
  bottom: 144px;
  right: 24px;
  z-index: 700;
  width: 280px;
  background: rgba(8,8,28,0.96);
  border: 1px solid rgba(124,58,237,0.5);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 0 40px rgba(124,58,237,0.3);
  backdrop-filter: blur(20px);
  transform-origin: bottom right;
  animation: qc-open 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
#quick-capture-popover.hidden { display: none; }

@keyframes qc-open {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.qc-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 3px;
}
.qc-tab {
  flex: 1;
  padding: 5px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.07em;
  cursor: none;
  transition: all 0.15s;
  text-align: center;
}
.qc-tab.active {
  background: rgba(124,58,237,0.25);
  color: var(--accent);
}
.qc-input {
  width: 100%;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.83rem;
  padding: 9px 12px;
  outline: none;
  margin-bottom: 8px;
  cursor: text;
}
.qc-input:focus { border-color: rgba(124,58,237,0.5); }
.qc-input::placeholder { color: var(--text-dim); }
.qc-submit {
  width: 100%;
  padding: 9px;
  border-radius: 8px;
  border: 1px solid rgba(124,58,237,0.5);
  background: rgba(124,58,237,0.2);
  color: var(--accent);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  cursor: none;
  transition: all 0.2s;
}
.qc-submit:hover {
  background: rgba(124,58,237,0.35);
  box-shadow: var(--glow-purple);
}

/* ════════════════════════════════════════
   MISSION DEADLINE
   ════════════════════════════════════════ */

.task-deadline-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  color: var(--text-dim);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 1px 6px;
  margin-top: 3px;
}
.task-deadline-chip.urgent {
  color: #ef4444;
  border-color: rgba(239,68,68,0.4);
  background: rgba(239,68,68,0.08);
  animation: deadline-pulse 1.5s ease-in-out infinite;
}
@keyframes deadline-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

.task-deadline-btn {
  width: 20px; height: 20px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.3);
  font-size: 0.75rem;
  cursor: none;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s;
  flex-shrink: 0;
  opacity: 0;
}
.task-item:hover .task-deadline-btn { opacity: 1; }
.task-deadline-btn:hover { color: var(--accent2); }

/* Deadline countdown in task panel header */
#deadline-countdown {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: var(--accent2);
  padding: 2px 8px;
  border: 1px solid rgba(6,182,212,0.3);
  border-radius: 4px;
  white-space: nowrap;
}
#deadline-countdown.urgent { color: #ef4444; border-color: rgba(239,68,68,0.4); animation: deadline-pulse 1s infinite; }

/* ════════════════════════════════════════
   TRANSMISSION MODAL
   ════════════════════════════════════════ */

#transmission-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}
#transmission-modal.open { display: flex; }

.tx-box {
  width: 500px;
  max-width: 92vw;
  background: rgba(6,6,22,0.98);
  border: 1px solid rgba(124,58,237,0.5);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 0 60px rgba(124,58,237,0.3);
  animation: cmd-drop 0.2s cubic-bezier(0.34,1.56,0.64,1);
}

.tx-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.tx-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--accent2);
  text-shadow: 0 0 10px rgba(6,182,212,0.5);
}
.tx-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.tx-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.tx-option {
  padding: 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.tx-option:hover {
  background: rgba(124,58,237,0.12);
  border-color: rgba(124,58,237,0.4);
}
.tx-option-icon { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.tx-option-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.tx-result { margin-top: 12px; }
.tx-textarea {
  width: 100%;
  height: 160px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Inter', monospace;
  font-size: 0.75rem;
  padding: 10px 12px;
  resize: none;
  outline: none;
  margin-bottom: 10px;
  cursor: text;
}
.tx-btn-row { display: flex; gap: 8px; }
.tx-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
}
.tx-btn-primary {
  border-color: rgba(124,58,237,0.5);
  background: rgba(124,58,237,0.2);
  color: var(--accent);
}
.tx-btn-primary:hover { background: rgba(124,58,237,0.35); box-shadow: var(--glow-purple); }

.tx-loading {
  text-align: center;
  padding: 24px;
  color: var(--text-dim);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
}

/* ════════════════════════════════════════
   MISSION ORBIT — Task orbit points UI hint
   ════════════════════════════════════════ */

.orbit-indicator {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ffdd88;
  box-shadow: 0 0 6px #ffdd88;
  margin-left: 4px;
  vertical-align: middle;
  animation: orbit-blink 2s ease-in-out infinite;
}
@keyframes orbit-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
