/* =============================================
   Music Scheduler — Premium Dark Web App
   ============================================= */

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

:root {
  --bg: #0d0e14;
  --surface: #13141f;
  --surface2: #1b1c2b;
  --border: rgba(255, 255, 255, 0.07);
  --accent: #7c5cfc;
  --accent2: #a78bfa;
  --accent-glow: rgba(124, 92, 252, 0.35);
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --text: #e8e9f4;
  --text-muted: #8b8ca4;
  --radius: 14px;
  --radius-sm: 8px;
  --tr: 0.2s ease;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ---------- Animated Background Orbs ---------- */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  animation: floatOrb 12s ease-in-out infinite alternate;
}

.orb1 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(124, 92, 252, 0.22) 0%, transparent 70%);
  top: -120px;
  left: -120px;
  animation-duration: 14s;
}

.orb2 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.16) 0%, transparent 70%);
  bottom: 60px;
  right: -80px;
  animation-duration: 10s;
}

.orb3 {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.10) 0%, transparent 70%);
  top: 55%;
  left: 38%;
  animation-duration: 18s;
}

@keyframes floatOrb {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(30px, 40px) scale(1.1);
  }
}

/* ---------- App Wrapper ---------- */
.app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

/* ---------- Header ---------- */
.app-header {
  padding: 32px 0 28px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(124, 92, 252, 0.5));
  transition: transform 0.3s ease;
}

.logo-img:hover {
  transform: rotate(5deg) scale(1.1);
}

.logo-title {
  font-size: 1.7rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.logo-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* ---------- Stats Bar ---------- */
.stats-bar {
  display: flex;
  gap: 10px;
}

.stat-pill {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 8px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
  transition: transform var(--tr), box-shadow var(--tr);
}

.stat-pill:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-num {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent2);
  line-height: 1;
}

.stat-label {
  font-size: 0.67rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: box-shadow var(--tr);
}

.card:hover {
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

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

/* ---------- Form ---------- */
.input-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 160px;
}

.field-group.narrow {
  min-width: 120px;
  max-width: 160px;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.field-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 13px;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--tr), box-shadow var(--tr), background var(--tr);
  outline: none;
  width: 100%;
}

.field-input::placeholder {
  color: var(--text-muted);
}

.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.2);
  background: #1e1f30;
}

.field-select {
  cursor: pointer;
}

.field-select option {
  background: #1b1c2b;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.char-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform var(--tr), box-shadow var(--tr), background var(--tr), opacity var(--tr);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #9f7aea);
  color: #fff;
  box-shadow: 0 4px 18px rgba(124, 92, 252, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(124, 92, 252, 0.55);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--surface2);
  color: var(--text);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.8rem;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 5px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  transition: color var(--tr), background var(--tr);
}

.btn-icon:hover {
  color: var(--text);
  background: var(--surface2);
}

.btn-icon.danger:hover {
  color: var(--red);
}

.btn-icon.complete:hover {
  color: var(--green);
}

/* ---------- Filter Bar ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 13px 10px 38px;
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--tr), box-shadow var(--tr);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.18);
}

.filter-tabs {
  display: flex;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--tr), color var(--tr);
  font-family: inherit;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
}

.tab-btn:hover:not(.active) {
  background: var(--surface2);
  color: var(--text);
}

.sort-select {
  min-width: 148px;
}

/* ---------- Tasks List ---------- */
.tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- Task Item ---------- */
.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: border-color var(--tr), box-shadow var(--tr), opacity var(--tr), transform var(--tr);
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.task-item:hover {
  border-color: rgba(124, 92, 252, 0.35);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.task-item.done {
  opacity: 0.55;
}

.task-item.done .task-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Checkbox */
.task-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--tr), background var(--tr);
  background: transparent;
}

.task-check:hover {
  border-color: var(--green);
}

.task-item.done .task-check {
  background: var(--green);
  border-color: var(--green);
}

.task-check svg {
  display: none;
}

.task-item.done .task-check svg {
  display: block;
}

/* Priority strip */
.task-priority-strip {
  width: 4px;
  align-self: stretch;
  border-radius: 4px;
  flex-shrink: 0;
}

.priority-high {
  background: var(--red);
}

.priority-medium {
  background: var(--yellow);
}

.priority-low {
  background: var(--green);
}

.task-info {
  flex: 1;
  min-width: 0;
}

.task-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.task-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 50px;
  background: rgba(124, 92, 252, 0.15);
  border: 1px solid rgba(124, 92, 252, 0.25);
  color: var(--accent2);
  font-weight: 500;
}

.task-dur {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-actions {
  display: flex;
  gap: 4px;
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 52px 24px;
  color: var(--text-muted);
}

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

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 14px;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.875rem;
}

/* ---------- Progress ---------- */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.progress-bar-bg {
  flex: 1;
  height: 10px;
  background: var(--surface2);
  border-radius: 50px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 50px;
  transition: width 0.5s cubic-bezier(.4, 0, .2, 1);
  width: 0%;
}

.progress-pct {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent2);
  min-width: 38px;
}

.time-summary {
  display: flex;
  align-items: center;
  gap: 20px;
}

.time-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.time-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.time-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.time-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ---------- Footer ---------- */
/* ---------- Footer Branding ---------- */
.software-logos {
  margin-bottom: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.software-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.logo-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.logo-strip:hover {
  opacity: 1;
}

.soft-icon-img {
  height: 40px;
  object-fit: contain;
  filter: grayscale(0.5) contrast(1.2);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.soft-icon-img:hover {
  filter: grayscale(0) contrast(1);
  transform: scale(1.05);
}

.app-footer {
  text-align: center;
  padding: 40px 0 60px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow);
  animation: modalIn 0.25s cubic-bezier(.34, 1.4, .64, 1);
}

@keyframes modalIn {
  from {
    transform: scale(0.92);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--tr);
}

.modal-close:hover {
  background: var(--surface2);
}

/* ---------- Responsive ---------- */
@media (max-width: 620px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-bar {
    width: 100%;
  }

  .stat-pill {
    flex: 1;
  }

  .input-row {
    flex-direction: column;
  }

  .field-group.narrow {
    max-width: 100%;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .sort-select {
    width: 100%;
  }

  .time-summary {
    justify-content: space-around;
  }
}