﻿* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark: #0a0a0a;
  --bg-mid: #0f0f0f;
  --panel: #1a1a1a;
  --panel-2: #1e1e1e;
  --panel-3: #222222;
  --line: #252525;
  --text: #ffffff;
  --muted: #b8b8b8;
  --muted-2: #888888;
  --primary: #0081C9;
  --primary-2: #00A8E8;
  --accent: #F24E1E;
  --success: #99ddff;
  --danger: #ff9999;
  --warning: #ffd966;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  background: linear-gradient(135deg, #0a0a0a 0%, #0f0f0f 50%, #0a0a0a 100%);
  padding: 20px;
  min-height: 100vh;
  color: var(--text);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(0, 129, 201, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 129, 201, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  opacity: 0.5;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 129, 201, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  top: -250px;
  right: -250px;
  pointer-events: none;
  animation: float 20s ease-in-out infinite;
  z-index: 0;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-100px, 100px); }
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  background: linear-gradient(145deg, #161616 0%, #1a1a1a 100%);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 129, 201, 0.2);
  overflow: hidden;
  border: 1px solid #252525;
  position: relative;
  z-index: 1;
}

header {
  background: linear-gradient(135deg, #0081C9 0%, #00A8E8 100%);
  color: white;
  padding: 50px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  font-size: 0.95em;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  margin-bottom: 15px;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

.subtitle {
  font-size: 1.15em;
  opacity: 0.95;
  font-weight: 400;
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
}

.content {
  padding: 32px 30px 36px;
}

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

.section {
  margin-bottom: 25px;
  border: 1px solid #252525;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(145deg, #1a1a1a 0%, #1e1e1e 100%);
  position: relative;
}

.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0081C9, #F24E1E);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.section:hover {
  border-color: #0081C9;
  box-shadow: 0 10px 40px rgba(0, 129, 201, 0.15);
}

.section:hover::before {
  transform: scaleX(1);
}

.section-header {
  background: linear-gradient(145deg, #1e1e1e 0%, #222222 100%);
  padding: 22px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.section-header h2 {
  font-size: 1.4em;
  color: #ffffff;
  font-weight: 700;
  margin: 0;
}

.section-content {
  padding: 25px;
  color: #b8b8b8;
  position: relative;
  z-index: 1;
}

.sidebar {
  position: sticky;
  top: 20px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

label {
  display: block;
  font-size: 0.9em;
  color: #b8b8b8;
  margin-bottom: 8px;
  font-weight: 600;
}

input, textarea, button {
  font: inherit;
}

input, textarea {
  width: 100%;
  border: 1px solid #2d2d2d;
  background: linear-gradient(145deg, #111111 0%, #151515 100%);
  color: #ffffff;
  border-radius: 10px;
  padding: 14px 15px;
  outline: none;
  transition: all 0.25s ease;
}

input:focus, textarea:focus {
  border-color: #0081C9;
  box-shadow: 0 0 0 4px rgba(0, 129, 201, 0.12);
}

textarea {
  min-height: 105px;
  resize: vertical;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 13px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 700;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, #0081C9 0%, #00A8E8 100%);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 129, 201, 0.25);
}

.btn-secondary {
  background: linear-gradient(145deg, #1e1e1e 0%, #252525 100%);
  color: #ffffff;
  border: 1px solid #303030;
}

.footer-note {
  margin-top: 18px;
  color: #888;
  font-size: 0.95em;
  line-height: 1.7;
}

.main-grid {
  display: grid;
  gap: 24px;
}

.meta-text {
  color: #99d6ff;
  font-size: 0.95em;
  font-weight: 600;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.metric {
  background: linear-gradient(145deg, #1e1e1e 0%, #222222 100%);
  padding: 18px;
  border-radius: 10px;
  border-left: 4px solid #0081C9;
  transition: all 0.3s ease;
}

.metric:hover {
  transform: translateX(5px);
  box-shadow: -5px 5px 20px rgba(0, 129, 201, 0.1);
}

.metric .label {
  font-size: 0.9em;
  color: #b8b8b8;
  margin-bottom: 8px;
  font-weight: 600;
}

.metric .value {
  font-size: clamp(1.8rem, 2.8vw, 2.6rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.metric .sub {
  font-size: 0.85em;
  color: #888;
}

.progress-shell {
  background: linear-gradient(145deg, #16232a 0%, #18262e 100%);
  border-left: 4px solid #00A8E8;
  padding: 20px;
  margin: 18px 0;
  border-radius: 8px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  color: #ffffff;
}

.progress-bar {
  height: 18px;
  background: #0a0a0a;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #252525;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0081C9, #00A8E8, #F24E1E);
  border-radius: 999px;
  transition: width 0.7s ease;
  box-shadow: 0 0 20px rgba(0, 168, 232, 0.25);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: #99d6ff;
  font-size: 0.92em;
  gap: 12px;
  flex-wrap: wrap;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.mini-stat {
  padding: 18px;
  border-radius: 10px;
  text-align: center;
  transition: transform 0.3s ease;
  background: linear-gradient(145deg, #162a16 0%, #182e18 100%);
  border: 2px solid #0081C9;
  color: #99ddff;
}

.mini-stat:hover {
  transform: translateY(-5px);
}

.mini-stat strong {
  display: block;
  font-size: 1.9rem;
  margin-bottom: 6px;
  color: #ffffff;
}

.mini-stat span {
  color: #99ddff;
  font-size: 0.9em;
}

.quote {
  color: #ffffff;
  font-size: 1.3rem;
  line-height: 1.7;
  margin: 0;
}

.quote small {
  display: block;
  color: #99d6ff;
  margin-top: 12px;
  font-size: 0.92rem;
}

.bucket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.bucket-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-bottom: 18px;
}

.bucket-list {
  display: grid;
  gap: 12px;
}

.bucket-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 16px;
  background: linear-gradient(145deg, #1e1e1e 0%, #222222 100%);
  border-radius: 8px;
  transition: all 0.3s ease;
  color: #b8b8b8;
  border: 1px solid #2a2a2a;
}

.bucket-status {
  margin-top: 1px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 800;
  border: 1px solid #2a2a2a;
  background: rgba(255, 255, 255, 0.04);
  color: #b8b8b8;
  white-space: nowrap;
}

.bucket-status.is-done {
  border-color: rgba(0, 129, 201, 0.55);
  color: #99ddff;
  background: rgba(0, 129, 201, 0.10);
}

.bucket-status.is-todo {
  border-color: rgba(242, 78, 30, 0.45);
  color: #ffd966;
  background: rgba(242, 78, 30, 0.10);
}

.joy-question {
  display: grid;
  gap: 12px;
}

.joy-prompt {
  font-weight: 900;
  color: #ffffff;
}

.joy-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.theme-toggle {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.18);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 2;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: rgba(0, 0, 0, 0.26);
}

.theme-toggle:active {
  transform: translateY(0);
}

.lang-toggle {
  position: absolute;
  left: 16px;
  top: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.18);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 2;
}

.lang-toggle:hover {
  transform: translateY(-1px);
  background: rgba(0, 0, 0, 0.26);
}

.lang-toggle:active {
  transform: translateY(0);
}

/* Light theme overrides (applied when served via localhost, or file:// if user toggles) */
body[data-theme="light"] {
  background: linear-gradient(135deg, #f5f7fb 0%, #eef2f7 50%, #f5f7fb 100%);
  color: #0b1220;
}

body[data-theme="light"]::before {
  background-image:
    linear-gradient(rgba(0, 129, 201, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 129, 201, 0.06) 1px, transparent 1px);
  opacity: 0.65;
}

body[data-theme="light"] .container {
  background: linear-gradient(145deg, #ffffff 0%, #f7f9fc 100%);
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 20px 60px rgba(0, 129, 201, 0.12);
}

body[data-theme="light"] .section {
  background: linear-gradient(145deg, #ffffff 0%, #f7f9fc 100%);
  border-color: rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .section-header {
  background: linear-gradient(145deg, #f1f5f9 0%, #e9eef5 100%);
}

body[data-theme="light"] .section-header h2 {
  color: #0b1220;
}

body[data-theme="light"] .meta-text,
body[data-theme="light"] .section-content,
body[data-theme="light"] p,
body[data-theme="light"] li {
  color: #334155;
}

body[data-theme="light"] input,
body[data-theme="light"] textarea {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.18);
  color: #0b1220;
}

body[data-theme="light"] .metric {
  background: linear-gradient(145deg, #ffffff 0%, #f7f9fc 100%);
  border-color: rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .metric .value,
body[data-theme="light"] .mini-stat strong,
body[data-theme="light"] .bucket-text,
body[data-theme="light"] .joy-prompt {
  color: #0b1220;
}

body[data-theme="light"] .mini-stat {
  background: linear-gradient(145deg, #ffffff 0%, #f7f9fc 100%);
  border-color: rgba(0, 129, 201, 0.25);
  color: #334155;
}

body[data-theme="light"] .mini-stat span {
  color: #0b1220;
}

body[data-theme="light"] .progress-shell,
body[data-theme="light"] .reflection {
  background: linear-gradient(145deg, #ffffff 0%, #f7f9fc 100%);
  border-color: rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .bucket-item {
  background: linear-gradient(145deg, #ffffff 0%, #f7f9fc 100%);
  border-color: rgba(15, 23, 42, 0.12);
  color: #334155;
}

body[data-theme="light"] .delete-btn {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.35);
  background: rgba(185, 28, 28, 0.06);
}

body[data-theme="light"] .bucket-status {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(2, 6, 23, 0.04);
}

body[data-theme="light"] footer {
  background: linear-gradient(145deg, #ffffff 0%, #f7f9fc 100%);
  border-top-color: rgba(15, 23, 42, 0.12);
  color: #475569;
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  body {
    padding: 0;
    background: #ffffff !important;
    color: #000000 !important;
  }

  body::before,
  body::after,
  .theme-toggle,
  .lang-toggle {
    display: none !important;
  }

  .container {
    box-shadow: none !important;
    border: none !important;
  }

  header {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  button {
    display: none !important;
  }

  input,
  textarea {
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #000000 !important;
  }

  .section,
  .metric,
  .progress-shell,
  .bucket-item,
  footer {
    break-inside: avoid;
  }
}

.bucket-item:hover {
  transform: translateX(5px);
  background: linear-gradient(145deg, #222222 0%, #262626 100%);
}

.bucket-item.done {
  opacity: 0.72;
  border-left: 4px solid #0081C9;
}

.bucket-item.done .bucket-text {
  text-decoration: line-through;
  color: #888;
}

.checkbox {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: #0081C9;
  cursor: pointer;
}

.bucket-text {
  font-size: 1rem;
  line-height: 1.6;
  color: #ffffff;
}

.bucket-time {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: #888;
}

.delete-btn {
  background: transparent;
  color: #ff9999;
  border: 0;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 6px;
  font-weight: 700;
  transition: color 0.2s ease;
}

.delete-btn:hover {
  color: #F24E1E;
}

.empty {
  padding: 18px;
  margin: 10px 0;
  background: linear-gradient(145deg, #1e1e1e 0%, #222222 100%);
  border-radius: 8px;
  color: #b8b8b8;
  text-align: center;
  border: 1px dashed #303030;
}

footer {
  background: linear-gradient(145deg, #1a1a1a 0%, #1e1e1e 100%);
  padding: 26px 30px;
  text-align: center;
  color: #888;
  font-size: 0.95em;
  border-top: 1px solid #252525;
}

footer p {
  color: #888;
  margin: 8px 0;
}

footer p:last-child {
  background: linear-gradient(135deg, #0081C9 0%, #F24E1E 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  font-size: 1.1em;
  margin-top: 15px;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  .content {
    padding: 24px 18px 28px;
  }

  header {
    padding: 36px 20px;
  }

  .metrics,
  .mini-stats,
  .actions,
  .bucket-input {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .bucket-item {
    grid-template-columns: auto 1fr;
  }

  .delete-btn {
    grid-column: 2;
    justify-self: end;
  }
}

/* Corner logo */
.corner-logo {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 56px;
  height: auto;
  z-index: 2;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
}

@media (max-width: 640px) {
  .corner-logo {
    top: 10px;
    right: 10px;
    width: 48px;
  }
}
