/* ============================================
   VlinC Pomodoro - Estilos
   ============================================ */

/* Variables de colores neon */
:root {
  --primary: #ff66cc;
  --secondary: #66ccff;
  --tertiary: #66ffcc;
  --background: #000000;
  --surface: #000000;
  --surface-dim: #050505;
  --surface-container-lowest: #000000;
  --surface-container-low: #0a0a0a;
  --surface-container: #111111;
  --surface-container-high: #1a1a1a;
  --surface-container-highest: #222222;
  --on-background: #ffffff;
  --on-surface: #ffffff;
  --on-surface-variant: #aaaaaa;
  --outline: #66ccff;
  --outline-variant: #ff66cc;
  --error: #ff4444;
  --on-error: #ffffff;
  --on-primary: #000000;
  --on-secondary: #000000;
  --on-tertiary: #000000;
  --primary-fixed: #ff99dd;
  --secondary-fixed: #99ddff;
  --tertiary-fixed: #99ffdd;

  /* Tipografías */
  --font-display: "JetBrains Mono", monospace;
  --font-body: "Inter", sans-serif;

  /* Radios */
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background-color: #000000;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.06) 0px,
      rgba(255, 255, 255, 0.06) 1px,
      transparent 1px,
      transparent 28px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.06) 0px,
      rgba(255, 255, 255, 0.06) 1px,
      transparent 1px,
      transparent 28px
    );
  color: var(--on-surface);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 32px 16px 48px;
}

/* Spotlight que sigue al mouse */
.spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    circle 180px at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.09),
    transparent 100%
  );
  transition: opacity 0.3s ease;
  opacity: 0;
}

body:hover .spotlight {
  opacity: 1;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex: 1;
}

main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.top-row {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: stretch;
}

.top-row > .card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.top-row > .timer-card {
  flex: 1.5;
  border-top: 3px solid var(--primary);
  box-shadow:
    0 0 30px rgba(255, 102, 204, 0.15),
    0 0 60px rgba(255, 102, 204, 0.08);
}

main > .tasks-card {
  display: flex;
  flex-direction: column;
}

/* ============================================
   Header
   ============================================ */

.site-header {
  text-align: center;
  padding-bottom: 8px;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.tomato-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--primary);
}

.tomato-logo svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 6px rgba(255, 102, 204, 0.4));
  transition: transform 0.3s ease;
}

.tomato-logo:hover svg {
  transform: scale(1.15);
}

.site-header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.1rem;
  margin: 0;
  letter-spacing: 0.5px;
  color: var(--primary);
  text-shadow: 0 0 15px rgba(255, 102, 204, 0.5);
}

.site-header h1 span {
  color: var(--secondary);
  font-weight: 600;
}

.tagline {
  margin: 6px 0 0;
  font-size: 0.82rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

/* ============================================
   Tarjetas (Cards)
   ============================================ */

.card {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(102, 204, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 0 20px rgba(102, 204, 255, 0.1);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.card-icon {
  font-size: 1.3rem;
  color: var(--secondary);
}

.card-header h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  color: var(--secondary);
  letter-spacing: 0.3px;
  text-shadow: 0 0 10px rgba(102, 204, 255, 0.5);
}

/* ============================================
   Timer Card
   ============================================ */

.timer-card {
  border-top: 3px solid var(--primary);
  transition: border-color 0.5s ease;
}

.timer-card[data-mode="focus"] {
  border-top-color: var(--primary);
}
.timer-card[data-mode="short"] {
  border-top-color: var(--tertiary);
}
.timer-card[data-mode="long"] {
  border-top-color: var(--secondary);
}

.ticket-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  color: var(--primary);
  text-transform: uppercase;
}

.eyebrow-right {
  color: var(--on-surface-variant);
}

.timer-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 22px 0 4px;
}

.flap {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.4rem;
  line-height: 1;
  background: var(--surface-container);
  color: var(--on-surface);
  padding: 6px 10px;
  border-radius: 8px;
  position: relative;
  min-width: 1.1ch;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -2px 4px rgba(0, 0, 0, 0.4);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.flap::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 50%;
  height: 1px;
  background: rgba(0, 0, 0, 0.45);
}

.colon {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.6rem;
  color: var(--on-surface-variant);
  padding: 0 2px;
}

.runway {
  position: relative;
  height: 28px;
  margin: 16px 0 2px;
  display: flex;
  align-items: center;
}

.runway-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  transform: translateY(-50%);
  background: var(--surface-container-highest);
  border-radius: 4px;
  overflow: hidden;
}

.runway-track::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--runway-fill, 0%);
  border-radius: 4px;
  background: var(--primary);
  transition: width 1s linear;
}

.timer-card[data-mode="focus"] .runway-track::after {
  background: linear-gradient(90deg, var(--primary), #ff99dd);
  box-shadow: 0 0 8px rgba(255, 102, 204, 0.5);
}
.timer-card[data-mode="short"] .runway-track::after {
  background: linear-gradient(90deg, var(--tertiary), #99ffdd);
  box-shadow: 0 0 8px rgba(102, 255, 204, 0.5);
}
.timer-card[data-mode="long"] .runway-track::after {
  background: linear-gradient(90deg, var(--secondary), #99ddff);
  box-shadow: 0 0 8px rgba(102, 204, 255, 0.5);
}

.runway-plane {
  display: none;
}

.runway-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 0.68rem;
  color: var(--on-surface-variant);
  margin: 0 2px 10px;
}

.ticket-divider {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 6px -24px 18px;
  position: relative;
}

.notch {
  width: 20px;
  height: 20px;
  background: var(--background);
  border-radius: 50%;
  flex: 0 0 auto;
}

.dash-line {
  flex: 1 1 auto;
  height: 1px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--outline) 0 8px,
    transparent 8px 16px
  );
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ============================================
   Botones
   ============================================ */

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    background 0.2s ease;
  color: var(--on-surface);
}

.btn:active {
  transform: scale(0.96);
}
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 0 15px rgba(255, 102, 204, 0.4);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 20px rgba(255, 102, 204, 0.6);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--outline);
  color: var(--on-surface);
  padding: 10px 20px;
}

.btn-ghost:hover {
  background: rgba(102, 204, 255, 0.1);
}

.btn-icon {
  background: var(--surface-container-high);
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

.btn-icon:hover {
  background: var(--surface-container-highest);
}

.btn-round {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-round svg {
  width: 22px;
  height: 22px;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ============================================
   Settings Modal
   ============================================ */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.overlay[hidden] {
  display: none;
}

.modal {
  background: var(--surface-container);
  border: 1px solid var(--outline);
  border-radius: var(--radius-lg);
  padding: 26px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 0 30px rgba(255, 102, 204, 0.2);
}

.modal h3 {
  font-family: var(--font-display);
  margin: 0 0 18px;
  font-size: 1.2rem;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(255, 102, 204, 0.5);
}

.field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.field-row label {
  font-size: 0.87rem;
  color: var(--on-surface-variant);
}

.field-row input {
  width: 72px;
  background: var(--surface-container-high);
  border: 1px solid var(--outline-variant);
  color: var(--on-surface);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: var(--font-display);
  text-align: center;
}

.field-row input:focus-visible {
  outline: 2px solid var(--primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ============================================
   Tasks Card
   ============================================ */

.task-input-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-bottom: 16px;
  min-width: 0;
}

.task-input-row input {
  flex: 1;
  min-width: 0;
  background: var(--surface-container-high);
  border: 1px solid var(--outline);
  color: var(--on-surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.task-input-row input::placeholder {
  color: var(--on-surface-variant);
}
.task-input-row input:focus-visible {
  outline: 2px solid var(--primary);
}

.task-input-row .btn {
  flex-shrink: 0;
}

.music-input-row .btn {
  flex-shrink: 0;
  width: 100%;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px dashed rgba(102, 204, 255, 0.2);
  transition: background 0.2s ease;
}

.task-item:hover {
  background: rgba(102, 204, 255, 0.05);
}

.task-item:last-child {
  border-bottom: none;
}

.task-stamp {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--tertiary);
  background: transparent;
  cursor: pointer;
  position: relative;
  transition:
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.2s ease,
    border-color 0.2s ease;
}

.task-stamp:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.task-item.done .task-stamp {
  background: var(--tertiary);
  border-color: var(--tertiary);
  transform: scale(1.08) rotate(-6deg);
  box-shadow: 0 0 10px rgba(102, 255, 204, 0.5);
}

.task-item.done .task-stamp::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--on-tertiary);
  font-weight: 700;
}

.task-text {
  flex: 1;
  font-size: 0.96rem;
  color: var(--on-surface);
  word-break: break-word;
}

.task-item.done .task-text {
  text-decoration: underline;
  text-decoration-color: var(--tertiary);
  text-underline-offset: 3px;
  color: var(--on-surface-variant);
}

.task-delete {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: var(--on-surface-variant);
  cursor: pointer;
  font-size: 0.95rem;
  opacity: 0;
  transition:
    opacity 0.15s ease,
    color 0.15s ease;
  padding: 4px;
}

.task-item:hover .task-delete,
.task-item:focus-within .task-delete {
  opacity: 1;
}
.task-delete:hover {
  color: var(--error);
}
.task-delete:focus-visible {
  outline: 2px solid var(--primary);
  opacity: 1;
}

.empty-state {
  text-align: center;
  color: var(--on-surface-variant);
  font-size: 0.9rem;
  padding: 18px 8px;
  margin: 0;
  flex: 1;
}

/* ============================================
   Music Card
   ============================================ */

.music-input-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  min-width: 0;
}

.music-input-row input {
  width: 100%;
  min-width: 0;
  background: var(--surface-container-high);
  border: 1px solid var(--outline);
  color: var(--on-surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.9rem;
}

.music-input-row input::placeholder {
  color: var(--on-surface-variant);
}
.music-input-row input:focus-visible {
  outline: 2px solid var(--primary);
}

.player-stage {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.stage-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: auto;
}

.stage-layer.stage-hidden {
  opacity: 0;
  pointer-events: none;
}

.stage-empty-icon {
  font-size: 1.8rem;
}

#player-empty-state p {
  margin: 0;
  color: var(--on-surface-variant);
  font-size: 0.85rem;
}

#sc-embed-wrap {
  position: absolute;
  left: -9999px;
  width: 300px;
  height: 166px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
#sc-embed-wrap iframe {
  width: 300px;
  height: 166px;
  border: none;
}

.transport-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 14px;
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 0 4px;
}

.volume-pct {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--on-surface-variant);
  min-width: 36px;
  text-align: right;
  user-select: none;
}

.volume-row input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
  height: 6px;
}

.now-playing {
  text-align: center;
  font-size: 0.92rem;
  color: var(--primary);
  font-style: italic;
  margin: 0;
  min-height: 1.3em;
}

.queue-info {
  text-align: center;
  font-size: 0.75rem;
  color: var(--on-surface-variant);
  margin: 4px 0 0;
}

/* ============================================
   Footer
   ============================================ */

.site-footer p {
  text-align: center;
  padding-top: 6px;
  border-top: 1px dashed rgba(102, 204, 255, 0.2);
  margin: 16px 0 0;
  font-size: 0.82rem;
  color: var(--on-surface-variant);
}

.site-footer p a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.site-footer p a:hover {
  color: var(--secondary);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .top-row {
    flex-direction: column;
  }
  .app-shell {
    max-width: 480px;
  }
}

@media (max-width: 480px) {
  .flap {
    font-size: 2.5rem;
    padding: 4px 7px;
  }
  .colon {
    font-size: 1.9rem;
  }
  .card {
    padding: 18px;
  }
  .ticket-divider {
    margin: 6px -18px 18px;
  }
  .site-header h1 {
    font-size: 1.7rem;
  }
}

/* ---- Streak Widget ---- */

.streak-widget {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 102, 204, 0.3);
  border-radius: 22px;
  box-shadow: 0 0 16px rgba(255, 102, 204, 0.1);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  animation: streak-glow 3s ease-in-out infinite;
  user-select: none;
  cursor: default;
}

.streak-widget:hover {
  box-shadow: 0 0 28px rgba(255, 102, 204, 0.25);
  transform: scale(1.08);
}

.streak-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.streak-count {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
  line-height: 1;
}

@keyframes streak-glow {
  0%, 100% {
    box-shadow: 0 0 16px rgba(255, 102, 204, 0.08);
  }
  50% {
    box-shadow: 0 0 22px rgba(255, 102, 204, 0.18);
  }
}

@media (max-width: 768px) {
  .streak-widget {
    top: 8px;
    left: 8px;
    padding: 6px 12px;
    gap: 6px;
  }

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

  .streak-count {
    font-size: 0.9rem;
  }
}
