﻿/* ============================================
   panels.css — OrbitOS Panel Styles
   Glassmorphism panels, controls, notes,
   tasks, timer, and music player styles.
   ============================================ */

/* ── Panel Base ── */
.panel {
  position: fixed;
  width: 320px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  z-index: 100;
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.15s ease;
  will-change: transform;
  opacity: 0;
}

.panel.visible {
  opacity: 1;
}

.panel:hover {
  box-shadow: 0 0 25px rgba(124,58,237,0.35), 0 0 50px rgba(6,182,212,0.15);
  border-color: rgba(124,58,237,0.35);
}

.panel.minimized .panel-body {
  display: none;
}

.panel.maximized {
  width: 480px;
}

.panel.closed {
  display: none;
}

/* ── Panel Header ── */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  cursor: grab;
  user-select: none;
  min-height: 48px;
}

.panel-header:active {
  cursor: grabbing;
}

.panel-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.notes-title  { color: var(--accent2); text-shadow: 0 0 10px rgba(6,182,212,0.7); }
.tasks-title  { color: var(--accent);  text-shadow: 0 0 10px rgba(124,58,237,0.7); }
.focus-title  {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(124,58,237,0.6));
}

/* ── Panel Controls ── */
.panel-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}

.panel-btn:hover { background: rgba(255,255,255,0.2); }
.minimize-btn:hover { background: rgba(251,191,36,0.3); border-color: #fbbf24; }
.maximize-btn:hover { background: rgba(34,197,94,0.3); border-color: #22c55e; }
.close-btn:hover    { background: rgba(239,68,68,0.3);  border-color: #ef4444; }

/* ── Panel Body ── */
.panel-body {
  padding: 14px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

/* ═════════════════════════════════
   PANEL 1: ORBIT NOTES
   ═════════════════════════════════ */
.notes-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.mode-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(6,182,212,0.4);
  background: transparent;
  color: var(--text-dim);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  cursor: none;
  transition: all 0.2s;
}

.mode-btn.active,
.mode-btn:hover {
  background: rgba(6,182,212,0.15);
  border-color: var(--accent2);
  color: var(--accent2);
  box-shadow: 0 0 8px rgba(6,182,212,0.3);
}

.notes-save-status {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  color: var(--accent2);
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 0.3s;
  margin-left: auto;
}

.notes-save-status.visible { opacity: 1; }

.notes-textarea {
  width: 100%;
  min-height: 280px;
  max-height: 350px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  line-height: 1.6;
  padding: 12px;
  resize: vertical;
  outline: none;
  cursor: text;
  transition: border-color 0.2s;
}

.notes-textarea:focus {
  border-color: rgba(6,182,212,0.5);
  box-shadow: 0 0 12px rgba(6,182,212,0.15);
}

.notes-preview {
  width: 100%;
  min-height: 280px;
  max-height: 350px;
  overflow-y: auto;
  padding: 12px;
  font-size: 0.83rem;
  line-height: 1.7;
  color: var(--text);
}

.notes-preview.hidden { display: none; }
.notes-textarea.hidden { display: none; }

/* Markdown styles in preview */
.notes-preview h1 { font-family: 'Orbitron', sans-serif; font-size: 1.1rem; color: var(--accent2); margin-bottom: 8px; border-bottom: 1px solid rgba(6,182,212,0.3); padding-bottom: 4px; }
.notes-preview h2 { font-family: 'Orbitron', sans-serif; font-size: 0.9rem; color: var(--accent); margin: 10px 0 6px; }
.notes-preview h3 { font-size: 0.85rem; color: var(--text); margin: 8px 0 4px; }
.notes-preview p  { margin-bottom: 8px; }
.notes-preview ul, .notes-preview ol { padding-left: 16px; margin-bottom: 8px; }
.notes-preview li { margin-bottom: 4px; }
.notes-preview strong { color: var(--accent2); font-weight: 600; }
.notes-preview em { color: var(--accent); font-style: italic; }
.notes-preview code { background: rgba(124,58,237,0.2); padding: 1px 5px; border-radius: 4px; font-size: 0.8rem; color: var(--accent2); }
.notes-preview blockquote { border-left: 3px solid var(--accent); padding-left: 10px; color: var(--text-dim); margin: 8px 0; }

/* ═════════════════════════════════
   PANEL 2: MISSION CONTROL (TASKS)
   ═════════════════════════════════ */
.task-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  background: rgba(124,58,237,0.2);
  border: 1px solid rgba(124,58,237,0.5);
  border-radius: 20px;
  padding: 2px 8px;
  color: var(--accent);
  white-space: nowrap;
}

.task-input-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.task-input {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  padding: 8px 12px;
  outline: none;
  cursor: text;
  transition: border-color 0.2s;
}

.task-input:focus {
  border-color: rgba(124,58,237,0.5);
  box-shadow: 0 0 10px rgba(124,58,237,0.15);
}

.task-input::placeholder { color: var(--text-dim); }

.task-add-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(124,58,237,0.5);
  background: rgba(124,58,237,0.15);
  color: var(--accent);
  font-size: 1.2rem;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.task-add-btn:hover {
  background: rgba(124,58,237,0.3);
  box-shadow: var(--glow-purple);
}

.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 10px;
  max-height: 200px;
  overflow-y: auto;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  cursor: grab;
  transition: all 0.2s;
  animation: task-slide-in 0.25s ease;
}

@keyframes task-slide-in {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.task-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(124,58,237,0.3);
}

.task-item.completed {
  opacity: 0.5;
  text-decoration: line-through;
}

.task-checkbox {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(124,58,237,0.5);
  background: transparent;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  font-size: 0.7rem;
}

.task-checkbox.checked {
  background: rgba(34,197,94,0.3);
  border-color: #22c55e;
  box-shadow: 0 0 8px rgba(34,197,94,0.5);
  color: #22c55e;
}

.task-text {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}

.task-delete {
  width: 20px; height: 20px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: rgba(239,68,68,0.5);
  font-size: 0.9rem;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  opacity: 0;
}

.task-item:hover .task-delete { opacity: 1; }
.task-delete:hover { color: #ef4444; text-shadow: 0 0 8px #ef4444; }

.task-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-style: italic;
}

.task-empty.hidden { display: none; }

.completed-section { margin-top: 10px; }

.completed-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.75rem;
  cursor: none;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.completed-toggle:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.completed-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.completed-list.expanded { max-height: 200px; }

/* sortable ghost */
.sortable-ghost {
  opacity: 0.3;
  background: rgba(124,58,237,0.2) !important;
}

/* ═════════════════════════════════
   PANEL 3: DEEP SPACE FOCUS
   ═════════════════════════════════ */
#panel-focus { width: 320px; }

.focus-subsection { padding: 4px 0; }

.timer-modes {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  justify-content: center;
}

.timer-mode-btn {
  flex: 1;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: var(--text-dim);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: none;
  text-transform: uppercase;
  transition: all 0.2s;
}

.timer-mode-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.timer-mode-btn.active[data-mode="focus"] {
  background: rgba(124,58,237,0.2);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(124,58,237,0.3);
}

.timer-mode-btn.active[data-mode="short"] {
  background: rgba(6,182,212,0.2);
  border-color: var(--accent2);
  color: var(--accent2);
  box-shadow: 0 0 10px rgba(6,182,212,0.3);
}

.timer-mode-btn.active[data-mode="long"] {
  background: rgba(59,130,246,0.2);
  border-color: var(--accent3);
  color: var(--accent3);
  box-shadow: 0 0 10px rgba(59,130,246,0.3);
}

.timer-ring-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  width: 150px; height: 150px;
}

.timer-svg { position: absolute; top: 0; left: 0; }

.timer-bg-ring {
  fill: none;
  stroke: rgba(255,255,255,0.05);
  stroke-width: 6;
}

.timer-progress-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.timer-display {
  position: absolute;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 0 15px var(--accent);
  letter-spacing: 0.05em;
  z-index: 1;
}

.timer-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 10px;
}

.timer-btn {
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: none;
  transition: all 0.2s;
}

.timer-start {
  border-color: rgba(124,58,237,0.5);
  background: rgba(124,58,237,0.15);
  color: var(--accent);
}

.timer-start:hover {
  background: rgba(124,58,237,0.3);
  box-shadow: var(--glow-purple);
}

.timer-start.running {
  border-color: rgba(251,191,36,0.5);
  background: rgba(251,191,36,0.15);
  color: #fbbf24;
}

.timer-reset:hover {
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.timer-sessions {
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.focus-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  margin: 14px 0;
}

.music-section { padding-bottom: 4px; }

.music-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent2);
  margin-bottom: 10px;
  text-shadow: 0 0 8px rgba(6,182,212,0.5);
}

.youtube-wrap {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(6,182,212,0.3);
  box-shadow: 0 0 15px rgba(6,182,212,0.15);
  margin-bottom: 10px;
  background: #000;
}

.youtube-wrap iframe {
  width: 100%;
  height: 160px;
  display: block;
}

.alt-tracks {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.track-btn {
  padding: 7px 12px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  cursor: none;
  text-align: left;
  transition: all 0.2s;
}

.track-btn:hover {
  background: rgba(6,182,212,0.1);
  border-color: rgba(6,182,212,0.4);
  color: var(--accent2);
  box-shadow: 0 0 8px rgba(6,182,212,0.15);
}

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.volume-label { font-size: 0.85rem; color: var(--text-dim); }

.volume-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) 50%, rgba(255,255,255,0.1) 50%);
  outline: none;
  cursor: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  cursor: none;
}
