/* ============================================
   style.css — OrbitOS Main Stylesheet
   Global styles, glassmorphism, animations,
   loading screen, cursor, toast, nebula, etc.
   ============================================ */

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #000000;
  --bg2: #0a0a1a;
  --accent: #7c3aed;
  --accent2: #06b6d4;
  --accent3: #3b82f6;
  --glass: rgba(255,255,255,0.05);
  --glass-border: rgba(255,255,255,0.10);
  --glass-hover: rgba(255,255,255,0.08);
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --glow-purple: 0 0 20px rgba(124,58,237,0.5);
  --glow-cyan: 0 0 20px rgba(6,182,212,0.5);
  --glow-intense: 0 0 40px rgba(124,58,237,0.8), 0 0 80px rgba(6,182,212,0.4);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  cursor: none;
  user-select: none;
}

/* ── Nebula Background ── */
#nebula-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 20% 50%, rgba(124,58,237,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 80% 30%, rgba(6,182,212,0.10) 0%, transparent 70%),
    radial-gradient(ellipse 40% 50% at 50% 80%, rgba(59,130,246,0.08) 0%, transparent 70%);
  transition: opacity 0.5s;
}

#nebula-bg.intensified {
  background:
    radial-gradient(ellipse 70% 50% at 20% 50%, rgba(124,58,237,0.25) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 30%, rgba(6,182,212,0.22) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 50% 80%, rgba(59,130,246,0.18) 0%, transparent 70%);
}

/* ── Three.js Canvas ── */
#space-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ── Custom Cursor ── */
#cursor-dot {
  position: fixed;
  width: 8px; height: 8px;
  background: var(--accent2);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--accent2), 0 0 20px var(--accent2);
  transition: transform 0.05s;
}

#cursor-ring {
  position: fixed;
  width: 28px; height: 28px;
  border: 1.5px solid rgba(124,58,237,0.7);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease-out, width 0.2s, height 0.2s;
}

.cursor-trail {
  position: fixed;
  width: 6px; height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  transform: translate(-50%, -50%);
  animation: trail-fade 0.5s ease-out forwards;
}

@keyframes trail-fade {
  from { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
  to   { opacity: 0;   transform: translate(-50%, -50%) scale(0.2); }
}

/* ── Loading Screen ── */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.8s ease, visibility 0.8s;
}

#loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  text-align: center;
}

.loading-logo {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.15em;
  text-shadow: 0 0 30px var(--accent), 0 0 60px var(--accent2);
  animation: pulse-glow 2s ease-in-out infinite;
}

.loading-os {
  color: var(--accent2);
  text-shadow: 0 0 20px var(--accent2);
}

.loading-subtitle {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  color: var(--accent2);
  margin-top: 1rem;
  opacity: 0.8;
}

.loading-bar-wrap {
  width: 320px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  margin: 2rem auto 0;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px var(--accent2);
}

.loading-status {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-top: 1rem;
}

/* ── Glassmorphism Base ── */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
}

/* ── Floating Animation ── */
@keyframes float-base {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}
@keyframes float-d1 {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}
@keyframes float-d2 {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

.float-panel { animation: float-base 6s ease-in-out infinite; }
.float-delay-1 { animation: float-d1 7s ease-in-out 1.5s infinite; }
.float-delay-2 { animation: float-d2 5.5s ease-in-out 0.8s infinite; }

/* ── Zero-G Mode ── */
@keyframes zerog-drift-0 {
  0%   { transform: translate(0,0) rotate(0deg); }
  25%  { transform: translate(15px,-20px) rotate(2deg); }
  50%  { transform: translate(-10px,-30px) rotate(-1.5deg); }
  75%  { transform: translate(20px,-10px) rotate(2.5deg); }
  100% { transform: translate(0,0) rotate(0deg); }
}
@keyframes zerog-drift-1 {
  0%   { transform: translate(0,0) rotate(0deg); }
  25%  { transform: translate(-20px,-15px) rotate(-2deg); }
  50%  { transform: translate(10px,-25px) rotate(2deg); }
  75%  { transform: translate(-15px,-5px) rotate(-1deg); }
  100% { transform: translate(0,0) rotate(0deg); }
}
@keyframes zerog-drift-2 {
  0%   { transform: translate(0,0) rotate(0deg); }
  25%  { transform: translate(10px,-25px) rotate(1.5deg); }
  50%  { transform: translate(-20px,-10px) rotate(-2deg); }
  75%  { transform: translate(5px,-20px) rotate(2deg); }
  100% { transform: translate(0,0) rotate(0deg); }
}

.zerog-panel-0 { animation: zerog-drift-0 8s ease-in-out infinite !important; }
.zerog-panel-1 { animation: zerog-drift-1 9s ease-in-out 1s infinite !important; }
.zerog-panel-2 { animation: zerog-drift-2 7s ease-in-out 2s infinite !important; }

/* ── Shooting Star ── */
.shooting-star {
  position: fixed;
  top: 0;
  left: 0;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.9), rgba(6,182,212,0.6));
  border-radius: 1px;
  pointer-events: none;
  z-index: 2;
  animation: shoot 0.8s ease-out forwards;
}

@keyframes shoot {
  0%   { opacity: 1; transform: translateX(0) translateY(0) rotate(var(--angle)); }
  100% { opacity: 0; transform: translateX(300px) translateY(120px) rotate(var(--angle)); }
}

/* ── Toast Notification ── */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5000;
  background: rgba(124,58,237,0.9);
  border: 1px solid var(--accent);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  padding: 10px 24px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: #fff;
  box-shadow: var(--glow-purple);
  animation: toast-in 0.3s ease;
  white-space: nowrap;
}

.toast.hidden { display: none; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Timer Complete Notification ── */
.timer-notif {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  z-index: 6000;
  background: rgba(0,0,0,0.9);
  border: 2px solid var(--accent2);
  border-radius: 16px;
  padding: 24px 48px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.15em;
  color: var(--accent2);
  box-shadow: var(--glow-cyan), inset 0 0 40px rgba(6,182,212,0.1);
  animation: timer-pulse 0.6s ease-in-out infinite alternate;
}

.timer-notif.hidden { display: none; }

@keyframes timer-pulse {
  from { box-shadow: 0 0 20px var(--accent2); }
  to   { box-shadow: 0 0 60px var(--accent2), 0 0 100px rgba(6,182,212,0.4); }
}

/* ── Zero-G Button ── */
#zerog-btn {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  border-radius: 50px;
  padding: 12px 28px;
  color: var(--text);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  cursor: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

#zerog-btn:hover {
  background: rgba(124,58,237,0.2);
  border-color: var(--accent);
  box-shadow: var(--glow-purple);
}

#zerog-btn.active {
  background: rgba(124,58,237,0.3);
  border-color: var(--accent);
  box-shadow: var(--glow-intense);
  color: #fff;
}

.zerog-icon { font-size: 1.1rem; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.4); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Glow Pulse ── */
@keyframes pulse-glow {
  0%, 100% { text-shadow: 0 0 30px var(--accent), 0 0 60px var(--accent2); }
  50%       { text-shadow: 0 0 50px var(--accent), 0 0 100px var(--accent2), 0 0 120px var(--accent); }
}

/* ── Panel Entrance Animation ── */
@keyframes panel-beam-in {
  from { opacity: 0; transform: translateY(80px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.panel-beam-in {
  animation: panel-beam-in 0.7s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

/* ════════════════════════════════════
   ADDITIONAL POLISH — appended
   ════════════════════════════════════ */

/* Panel starts invisible, JS adds .visible + animation */
.panel {
  opacity: 0;
  transition: box-shadow 0.3s ease;
}

.panel.visible {
  opacity: 1;
}

/* Ensure focus panel doesn't clip */
#panel-focus .panel-body {
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

/* Maximize makes panels wider with smooth width */
.panel.maximized {
  width: 480px !important;
  transition: width 0.3s ease, box-shadow 0.3s ease;
}

/* Minimized panel — compact header only */
.panel.minimized {
  height: auto !important;
}
.panel.minimized .panel-body {
  display: none !important;
  max-height: 0;
  overflow: hidden;
}

/* Drag handle cursor fix */
.panel-header {
  cursor: grab !important;
}
.panel-header:active {
  cursor: grabbing !important;
}

/* Make buttons use pointer (override cursor:none for functional areas) */
button, [role="button"] {
  cursor: none;
}

/* Focus mode color adjustments for active ring */
.timer-progress-ring { stroke: #7c3aed; }

/* Panel close animation */
.panel.closed {
  display: none !important;
}

/* Scan line subtle overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.015) 2px,
    rgba(0,0,0,0.015) 4px
  );
}

/* Responsive: ensure panels don't overlap badly on smaller screens */
@media (max-width: 1200px) {
  #panel-focus {
    right: 10px !important;
  }
  #panel-tasks {
    left: calc(50% - 150px) !important;
  }
}

/* HUD clickable buttons - ensure cursor revert */
.hud-btn, .panel-btn, .mode-btn, .task-add-btn, .timer-btn,
.timer-mode-btn, .track-btn, .completed-toggle, .task-delete,
.task-checkbox, #zerog-btn {
  cursor: none;
}

/* ── New Panel Titles ── */
.weather-title {
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56,189,248,0.7);
}
.habits-title {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 6px rgba(245,158,11,0.5));
}
.links-title {
  color: #a78bfa;
  text-shadow: 0 0 10px rgba(167,139,250,0.7);
}

/* ── Zero-G for extra panels ── */
@keyframes zerog-drift-3 {
  0%   { transform: translate(0,0) rotate(0deg); }
  25%  { transform: translate(-8px,-18px) rotate(1.2deg); }
  50%  { transform: translate(18px,-25px) rotate(-1.8deg); }
  75%  { transform: translate(-12px,-8px) rotate(1.5deg); }
  100% { transform: translate(0,0) rotate(0deg); }
}
@keyframes zerog-drift-4 {
  0%   { transform: translate(0,0) rotate(0deg); }
  25%  { transform: translate(12px,-22px) rotate(-1.5deg); }
  50%  { transform: translate(-8px,-12px) rotate(2deg); }
  75%  { transform: translate(10px,-28px) rotate(-1deg); }
  100% { transform: translate(0,0) rotate(0deg); }
}
@keyframes zerog-drift-5 {
  0%   { transform: translate(0,0) rotate(0deg); }
  25%  { transform: translate(-15px,-10px) rotate(2.5deg); }
  50%  { transform: translate(8px,-30px) rotate(-2deg); }
  75%  { transform: translate(-5px,-15px) rotate(1.8deg); }
  100% { transform: translate(0,0) rotate(0deg); }
}
.zerog-panel-3 { animation: zerog-drift-3 10s ease-in-out 0.5s infinite !important; }
.zerog-panel-4 { animation: zerog-drift-4 8.5s ease-in-out 1.5s infinite !important; }
.zerog-panel-5 { animation: zerog-drift-5 9.5s ease-in-out 2.5s infinite !important; }

/* ── Ctrl+K Command Palette Hint ── */
#cmd-hint {
  position: fixed;
  bottom: 36px;
  right: 24px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.3);
  pointer-events: none;
}
#cmd-hint kbd {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.4);
}

