* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

/* Disable dragging for all images globally */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  pointer-events: auto;
}

/* ==========================================================================
   CSS CUSTOM PROPERTIES
   ========================================================================== */
:root {
  --dropdown-background: rgba(0, 0, 0, 0.9);
  --dropdown-border: rgba(255, 255, 255, 0.2);
  --dropdown-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --bg-image: url("assets/images/street.jpg");
}

/* ==========================================================================
   DROPDOWN COMPONENTS
   ========================================================================== */
.dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--dropdown-background);
  border: 1px solid var(--dropdown-border);
  border-radius: 16px;
  padding: 8px;
  z-index: 2000;
  display: none;
  box-shadow: var(--dropdown-shadow);
  margin-top: 4px;
  flex-direction: column;
}

.dropdown.show {
  display: flex;
}

.dropdown--small {
  min-width: 100px;
  padding: 4px 0;
}

.dropdown--medium {
  min-width: 120px;
  max-width: 160px;
  max-height: 50vh;
  gap: 10px;
  align-items: center;
  overflow-y: auto;
}

.dropdown--large {
  min-width: 140px;
  max-width: 160px;
}

/* Opens upward — for dropdowns near the bottom edge */
.dropdown--up {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 6px;
}

/* Background picker grid */
.background-container {
  position: relative;
}

.background-dropdown {
  min-width: 280px;
  padding: 10px;
}

.background-dropdown.show {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.background-option {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 6px;
  background-color: transparent;
  border: 2px solid transparent;
  border-radius: 10px;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.background-option img,
.background-option video {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  background-color: rgba(255, 255, 255, 0.05);
}

.background-option span {
  text-align: center;
  opacity: 0.8;
}

.background-option:hover {
  background-color: rgba(255, 255, 255, 0.08);
  transform: none;
}

.background-option.active {
  border-color: white;
}

.background-option.active span {
  opacity: 1;
}

#background-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#background-btn img {
  width: 26px;
  height: 26px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

#background-btn:hover img {
  opacity: 1;
}

/* Scrollbar styles for dropdowns */
.dropdown::-webkit-scrollbar {
  width: 6px;
}

.dropdown::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

h1{
  font-size: clamp(120px, 15vw, 200px);
  font-weight: bold;
}

h2{
  font-size: clamp(48px, 6vw, 68px);
  font-weight: 600;
}

h3{
  font-size: clamp(24px, 4vw, 40px);
  font-weight: bold;
}

h4{

  font-size: 20px;
  font-weight: 500;
  font-style: normal;
}

body {
  background: var(--bg-image) center/cover no-repeat fixed;
  color: white;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-x: hidden;
  transition: background-image 0.4s ease;
}

/* Fullscreen video background — shown only when a video option is active */
.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  display: none;
  pointer-events: none;
}

.bg-video.active {
  display: block;
}

/* Hide the static image background while a video is playing behind */
body.has-video-bg {
  background: #000;
}

/* Soft radial darken behind the timer/quote for legibility */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 55% 45% at 36% 55%, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 75%);
  pointer-events: none;
  z-index: 0;
}

/* Right-side gradient so the glass cards pop against the background */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.45) 78%, rgba(0, 0, 0, 0.7) 100%);
  pointer-events: none;
  z-index: 0;
}

.main-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.container{
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 95vh;
  flex-wrap: wrap;
  padding: 20px 0;
}

.bottom-section{
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  height: 5%;
  margin-right: 54px;
  margin-bottom: 24px;
}

.left-section{
  flex: 5;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.right-section{
  flex: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-height: 100%;
  gap: 20px;
  padding: 20px 0px;
  margin-right: 54px;
}

#title{
  position: absolute;
  top: 80px;
  left: 80px;
  font-weight: 400;
  font-size: 32px;
  font-family: 'Nothing You Could Do', cursive;
}

.center-display{
  text-align: center;
}

/* ==========================================================================
   POMODORO TIMER COMPONENT
   ========================================================================== */
.pomodoro-timer{
  display: flex;
  padding: 16px;
  justify-content: center;
  align-items: center;
  margin: 0;
  border-radius: 20px;
  gap: 27px;
  background-color: rgba(53, 53, 53, 0.4);
  width: 100%;
  max-width: clamp(300px, 40vw, 420px);
  height: auto;
  min-height: 160px;
  box-sizing: border-box;
}

.timer-left{
  display: flex;
  flex-direction: column;
  flex: 3;
}


#vertical-line{
  width: 0.5px;
  min-height: clamp(155px, 12vh, 200px);
  border-color: rgba(133, 133, 133, 0.4);
}

.timer-right{
  display: flex;
  flex-direction: column;
  flex: 2;
  gap:16px;
}

.timer-right button{
  width: clamp(120px, 12vw, 160px);
  height: clamp(36px, 4vh, 48px);
}

.timer-right button.active{
  background-color: white;
  color: black;
}


#time{
  width: 100%;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.timer-controls{
  display: flex;
  align-items: center;
  justify-content: center;
}

#start{
  width: clamp(70px, 8vw, 100px);
  height: clamp(36px, 4vh, 48px);
  text-align: center;
}

.pomodoro-timer button{
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: clamp(16px, 1.5vw, 20px);
  color: white;
  border: 1px solid white;
  padding: clamp(6px, 0.8vw, 10px) clamp(12px, 1.5vw, 20px);
  border-radius: 36px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

button{
  cursor: pointer;
  background-color: transparent;
  border: none;
}

button:hover {
  transform: translateY(-1px);
}

#timer-setting{
  border: none;
  border-radius: 50%;
}

#timer-setting img{
  width: clamp(28px, 3vw, 40px);
  height: clamp(28px, 3vw, 40px);
  object-fit: contain;
}

/* Timer Settings Dropdown */
.timer-setting {
  position: relative;
}

/* Timer settings dropdown uses .dropdown and .dropdown--large classes */

.timer-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: clamp(6px, 0.8vw, 10px) clamp(8px, 1vw, 12px);
  background-color: transparent;
  border: none;
  border-radius: 8px;
  color: white;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: clamp(14px, 1.2vw, 16px);
}

.timer-name {
  font-weight: 500;
  font-size: clamp(14px, 1.2vw, 16px);
  color: white;
  margin-bottom: 4px;
  text-align: left;
}

.timer-input-container {
  display: flex;
  align-items: center;
  position: relative;
}

.timer-input {
  background-color: transparent;
  border: 1px solid white;
  border-radius: 6px;
  padding: 6px 40px 6px 10px;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: clamp(14px, 1.2vw, 16px);
  font-weight: 500;
  width: 90px;
  text-align: center;
  box-sizing: border-box;
  position: relative;
}

.timer-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.8);
  background-color: rgba(255, 255, 255, 0.05);
}

.timer-input::-webkit-outer-spin-button,
.timer-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.timer-input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.timer-unit {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(12px, 1vw, 14px);
  color: white;
  font-weight: 400;
  pointer-events: none;
}

/* ==========================================================================
   MUSIC PLAYER COMPONENT
   ========================================================================== */
.music-section{
  display: flex;
  flex-direction: row;
  gap: clamp(16px, 2vw, 24px);
  align-items: stretch;
  width: 100%;
  max-width: clamp(300px, 40vw, 420px);
  border-radius: 20px;
  box-sizing: border-box;
}

.music-player {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  padding: clamp(12px, 1.5vw, 20px);
  background-color: rgba(53, 53, 53, 0.4);
  flex: 1;
  gap: clamp(10px, 1.2vw, 14px);
  min-width: 0;
  box-sizing: border-box;
  transition: background-color 0.2s ease, border-radius 0.2s ease;
}

/* When Spotify is active, the embed ships with its own container — drop the
   outer glass to avoid a "box in a box" and let the embed span the full
   width the glass would have occupied. */
.music-player.music-player--spotify {
  background-color: transparent;
  border-radius: 0;
  padding: 0;
}

.music-source-toggle {
  display: inline-flex;
  align-self: center;
  margin-right: auto;
  margin-left: 54px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  padding: 3px;
  gap: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.source-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-family: 'Inter', sans-serif;
  font-size: clamp(11px, 0.85vw, 12px);
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.source-option svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 0.18s ease, color 0.18s ease;
}

.source-option:hover:not(.active) {
  color: rgba(255, 255, 255, 0.9);
}

.source-option:hover:not(.active) svg {
  opacity: 1;
}

.source-option.active {
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
}

.source-option.active svg {
  opacity: 1;
}

.source-option.active[data-source="soundcloud"] svg {
  color: #ff5500;
}

.source-option.active[data-source="spotify"] svg {
  color: #1db954;
}

.player-soundcloud {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.5vw, 16px);
  flex: 1;
  min-width: 0;
}

.player-spotify {
  display: block;
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 152px;
  overflow: hidden;
  border-radius: 12px;
  background: #181818;
}

.player-soundcloud[hidden],
.player-spotify[hidden] {
  display: none !important;
}

.player-spotify iframe {
  width: 100%;
  height: 152px;
  border: 0;
  display: block;
  color-scheme: normal;
}

.music-taste{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: clamp(60px, 6vw, 75px);
  flex-shrink: 0;
  box-sizing: border-box;
}

.taste-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.taste-group[hidden] {
  display: none !important;
}

/* In Spotify mode the picker column is irrelevant — collapse it so the
   embed gets the full width of the music-section. */
.music-section:has(.player-spotify:not([hidden])) .music-taste {
  display: none;
}

/* Slim "paste your playlist link" pill that sits below the embed,
   right-aligned so it visually anchors the bottom-right of the music
   section without overlaying the iframe (which has its own controls
   in that corner). Subtle by default, Spotify-green on focus. */
.spotify-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: stretch;
  width: 100%;
  padding: 4px 5px 4px 12px;
  box-sizing: border-box;
  background: rgba(30, 30, 30, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.spotify-input-bar[hidden] {
  display: none !important;
}

.spotify-input-bar:focus-within {
  border-color: rgba(29, 185, 84, 0.5);
  background: rgba(30, 30, 30, 0.75);
}

.spotify-input-bar.error {
  border-color: #ff6b6b;
  animation: spotify-shake 0.36s ease-in-out;
}

@keyframes spotify-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.spotify-input-icon {
  width: 14px;
  height: 14px;
  color: #1db954;
  flex-shrink: 0;
}

.spotify-input-bar .spotify-link-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  padding: 4px 0;
}

.spotify-input-bar .spotify-link-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.spotify-input-bar .spotify-link-load {
  flex-shrink: 0;
  padding: 4px 12px;
  background: #1db954;
  color: black;
  border: none;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.spotify-input-bar .spotify-link-load:hover {
  background: #1ed760;
}
.track-thumbnail{
  width: clamp(80px, 8vw, 120px);
  height: clamp(80px, 8vw, 120px);
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.track-details{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1vw, 16px);
  flex: 1;
  min-width: 0;
}

.track-title{
  line-height: 1.2;
  text-align: center;
  font-size: clamp(14px, 1.2vw, 16px);
}

.author-name {
  line-height: 1.2;
  text-align: center;
  font-size: 20px;
  font-weight: 500;
  font-style: normal;
}

.track-controls{
  display: flex;
  gap: clamp(12px, 1.5vw, 24px);
  align-items: center;
}

.track-controls button {
  width: auto;
  height: auto;
  border: none;
  border-radius: 50%;
}

.track-controls button img {
  width: clamp(20px, 2vw, 28px);
  height: clamp(20px, 2vw, 28px);
}

#play img{
  width: clamp(40px, 4vw, 56px);
  height: clamp(40px, 4vw, 56px);
}

.music-taste button{
  width: clamp(60px, 6vw, 75px);
  height: clamp(60px, 6vw, 75px);
  border: none;
  background-color: transparent;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.music-taste button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.music-taste button img {
  width: clamp(60px, 6vw, 75px);
  height: clamp(60px, 6vw, 75px);
  object-fit: contain;
  filter: brightness(0.9);
}

/* Genre dropdown styles */
.genre-container {
  position: relative;
}

/* Genre dropdown uses .dropdown and .dropdown--medium classes */

.genre-option {
  width: 100%;
  max-height: 40px;
  padding: clamp(6px, 0.8vw, 10px) clamp(12px, 1.5vw, 20px);
  background-color: transparent;
  border: 1px solid white;
  border-radius: 36px;
  color: white;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: clamp(14px, 1.2vw, 16px);
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.genre-option.active {
  background-color: white;
  color: black;
}

.genre-option:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Mood dropdown styles */
.mood-container {
  position: relative;
}

/* Mood dropdown uses .dropdown and .dropdown--medium classes */

.mood-option {
  width: 100%;
  max-height: 40px;
  padding: clamp(6px, 0.8vw, 10px) clamp(12px, 1.5vw, 20px);
  background-color: transparent;
  border: 1px solid white;
  border-radius: 36px;
  color: white;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: clamp(14px, 1.2vw, 16px);
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.mood-option.active {
  background-color: white;
  color: black;
}

.mood-option:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   TODO LIST COMPONENT
   ========================================================================== */
.todo-list{
  background-color: rgba(53, 53, 53, 0.4);
  border-radius: 20px;
  width: 100%;
  max-width: clamp(300px, 40vw, 420px);
  min-height: clamp(200px, 25vh, 280px);
  max-height: clamp(300px, 35vh, 450px);
  padding: clamp(12px, 1.5vw, 20px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.todo-header {
  margin-bottom: clamp(12px, 1.5vw, 20px);
}

#add-task {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 0px 12px 0px;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 400;
  width: 100%;
  text-align: left;
  cursor: pointer;
  line-height: 1;
}

#add-task span {
  font-size: 36px;
  font-weight: 300;
  line-height: 0.8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

#add-task:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: none;
}

.task-separator {
  border: none;
  height: 1px;
  background-color: white;
  width: 100%;
}

.todo-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 200px;
  min-height: 120px;
  padding-right: 4px;
}

.todo-items::-webkit-scrollbar {
  width: 6px;
}

.todo-items::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.todo-items::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.todo-items::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  transition: all 0.3s ease;
}

.task-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  background-color: transparent;
  cursor: pointer;
  appearance: none;
  position: relative;
}

.task-checkbox:checked {
  background-color: white;
  border-color: white;
}

.task-checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: -2px;
  left: 2px;
  color: black;
  font-size: 14px;
  font-weight: bold;
}

.task-label {
  flex: 1;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
}

.task-checkbox:checked + .task-label {
  text-decoration: line-through;
  opacity: 0.6;
}

.task-options {
  background-color: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
  position: relative;
}

.task-options:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  transform: none;
}

.task-options-container {
  position: relative;
}

/* Task dropdown uses .dropdown and .dropdown--small classes with position: fixed */
.task-dropdown {
  position: fixed; /* Only unique property - needs fixed positioning */
}

.task-dropdown button {
  width: 100%;
  padding: 8px 16px;
  background-color: transparent;
  border: none;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
}

.task-dropdown button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: none;
}

.task-dropdown .delete-btn:hover {
  background-color: rgba(255, 0, 0, 0.2);
  color: #ff6b6b;
}

/* ==========================================================================
   STATS BUTTON & MODAL
   ========================================================================== */
.stats-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-button img {
  width: 28px;
  height: 28px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.stats-button:hover img {
  opacity: 1;
}

/* ── Modal container & animation ── */
#stats-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
}

.stats-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

#stats-modal.visible .stats-overlay {
  background-color: rgba(0, 0, 0, 0.7);
}

.stats-content {
  background-color: rgba(40, 40, 40, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 28px;
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  color: white;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: scale(0.95) translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  position: relative;
}

#stats-modal.visible .stats-content {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.stats-content::-webkit-scrollbar {
  width: 6px;
}

.stats-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.stats-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* ── Header ── */
.stats-header {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
}

.stats-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.stats-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  margin-left: auto;
}

.stats-close:hover {
  color: white;
  transform: none;
}

/* ── Streak badge ── */
.stats-streak {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 160, 50, 0.12);
  border: 1px solid rgba(255, 160, 50, 0.25);
  border-radius: 20px;
  padding: 4px 12px 4px 6px;
}

.streak-flame {
  font-size: 16px;
  line-height: 1;
}

.streak-count {
  font-size: 14px;
  font-weight: 600;
  color: #ffb347;
}

.streak-label {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 179, 71, 0.7);
}

/* ── Top row: goal ring + summary cards ── */
.stats-top-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: center;
}

/* ── Daily goal ring ── */
.stats-goal-ring {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}

.goal-svg {
  width: 110px;
  height: 110px;
}

.goal-progress-circle {
  transition: stroke-dashoffset 0.6s ease;
}

.goal-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.goal-percent {
  display: block;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
}

.goal-label {
  display: block;
  font-size: 10px;
  opacity: 0.5;
  white-space: nowrap;
}

.goal-edit-btn {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.goal-edit-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: none;
}

/* ── Goal editor overlay ── */
.goal-editor-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.goal-editor {
  background: rgba(50, 50, 50, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
}

.goal-editor h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 500;
}

.goal-editor-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.goal-editor-input {
  width: 80px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}

.goal-editor-input::-webkit-outer-spin-button,
.goal-editor-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.goal-editor-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.6);
}

.goal-editor-unit {
  font-size: 14px;
  opacity: 0.5;
}

.goal-editor-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.goal-editor-actions button {
  padding: 6px 20px;
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.goal-editor-cancel {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
}

.goal-editor-cancel:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
  transform: none;
}

.goal-editor-save {
  background: white;
  border: none;
  color: black;
}

.goal-editor-save:hover {
  transform: none;
  opacity: 0.9;
}

/* ── Summary cards ── */
.stats-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.stats-card {
  background-color: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stats-card-value {
  font-size: 18px;
  font-weight: 600;
}

.stats-card-label {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.45;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Weekly bar chart ── */
.stats-chart-section {
  margin-bottom: 24px;
}

.stats-section-title {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 12px 0;
  opacity: 0.6;
}

.stats-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 100px;
  padding: 0 4px;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
}

.chart-bar-container {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar {
  width: 100%;
  max-width: 36px;
  border-radius: 4px 4px 2px 2px;
  background: rgba(255, 255, 255, 0.2);
  position: relative;
  transition: height 0.4s ease;
  min-height: 2px;
}

.chart-col--today .chart-bar {
  background: linear-gradient(to top, rgba(180, 140, 255, 0.5), rgba(255, 255, 255, 0.4));
}

.chart-bar--empty {
  background: rgba(255, 255, 255, 0.06);
}

.chart-bar-tooltip {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.chart-bar:hover .chart-bar-tooltip {
  opacity: 1;
}

.chart-day-label {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.4;
}

.chart-col--today .chart-day-label {
  opacity: 0.9;
  font-weight: 500;
}

/* ── History section with tabs ── */
.stats-history {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
}

.stats-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 3px;
}

.stats-tab {
  flex: 1;
  padding: 7px 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.stats-tab:hover {
  color: rgba(255, 255, 255, 0.7);
  transform: none;
}

.stats-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.stats-history-list {
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

.stats-history-list::-webkit-scrollbar {
  width: 4px;
}

.stats-history-list::-webkit-scrollbar-track {
  background: transparent;
}

.stats-history-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* ── Empty state ── */
.stats-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0;
  gap: 8px;
}

.stats-empty-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
}

.stats-empty-text {
  font-size: 15px;
  font-weight: 500;
  opacity: 0.4;
  margin: 0;
}

.stats-empty-subtext {
  font-size: 13px;
  opacity: 0.25;
  margin: 0;
}

/* ── Session rows ── */
.stats-date-group {
  margin-bottom: 12px;
}

.stats-date-label {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.35;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-session-row {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 3px;
  gap: 8px;
}

.stats-session-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stats-session-type {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
}

.stats-session-time {
  font-size: 12px;
  opacity: 0.35;
  flex-shrink: 0;
}

.stats-session-duration {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.7;
  text-align: right;
  min-width: 44px;
  flex-shrink: 0;
}

/* ── Export / Import buttons ── */
.stats-data-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-export-btn,
.stats-import-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.55);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.stats-export-btn:hover,
.stats-import-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
  transform: none;
}

/* ==========================================================================
   EDITABLE LAYOUT (MOVE & RESIZE UTILITY BLOCKS)
   ========================================================================== */
#edit-layout-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

#edit-layout-btn svg {
  width: 26px;
  height: 26px;
  opacity: 0.8;
  transition: opacity 0.2s ease, color 0.2s ease;
}

#edit-layout-btn:hover svg {
  opacity: 1;
}

#edit-layout-btn.active svg {
  opacity: 1;
  color: #9ecbff;
}

#reset-layout-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

#reset-layout-btn[hidden] {
  display: none;
}

#reset-layout-btn svg {
  width: 24px;
  height: 24px;
  opacity: 0.8;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#reset-layout-btn:hover svg {
  opacity: 1;
  transform: rotate(-30deg);
}

/* Blocks that have been frozen into free-floating mode.
   Geometry is persisted to localStorage (studyspot_layout) and
   restored on reload; the reset button clears it. */
.pomodoro-timer.floating,
.music-section.floating,
.todo-list.floating {
  position: fixed;
  margin: 0 !important;
  max-width: none !important;
  max-height: none !important;
  z-index: 50;
}

/* Edit-mode visual + interaction lock: the block itself handles pointer
   events for dragging, children are inert so clicks don't toggle UI. */
body.edit-mode .pomodoro-timer.floating,
body.edit-mode .music-section.floating,
body.edit-mode .todo-list.floating {
  outline: 2px dashed rgba(255, 255, 255, 0.6);
  outline-offset: 4px;
  cursor: move;
  user-select: none;
}

body.edit-mode .pomodoro-timer.floating *,
body.edit-mode .music-section.floating *,
body.edit-mode .todo-list.floating * {
  pointer-events: none;
  user-select: none;
}

body.edit-mode .resize-handle {
  pointer-events: auto !important;
}

.resize-handle {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 16px;
  height: 16px;
  border-right: 3px solid rgba(255, 255, 255, 0.75);
  border-bottom: 3px solid rgba(255, 255, 255, 0.75);
  border-radius: 2px;
  cursor: nwse-resize;
  display: none;
  z-index: 5;
}

body.edit-mode .resize-handle {
  display: block;
}

/* ==========================================================================
   RESPONSIVE DESIGN - MEDIA QUERIES
   ========================================================================== */

/* Tablet Portrait - 768px and below */
@media screen and (max-width: 768px) {
  .main-wrapper {
    max-width: 100%;
    padding: 0 16px;
  }

  .container {
    flex-direction: column;
    height: auto;
    gap: 20px;
    padding: 20px 0;
  }

  .left-section {
    flex: none;
    width: 100%;
    height: auto;
    order: 1;
  }

  .right-section {
    flex: none;
    width: 100%;
    height: auto;
    margin-right: 0;
    order: 2;
  }

  #title {
    position: static;
    text-align: center;
    margin-bottom: 20px;
  }

  h1 {
    font-size: 120px;
  }

  h2 {
    font-size: 48px;
  }

  h3 {
    font-size: 28px;
  }

  .center-display {
    padding: 20px 0;
  }

  .pomodoro-timer {
    margin: 20px 0;
    min-height: 140px;
    padding: 24px;
    gap: 12px;
  }

  .bottom-section {
    margin-right: 16px;
    margin-bottom: 16px;
  }
}

/* Mobile Landscape - 600px and below */
@media screen and (max-width: 600px) {
  h1 {
    font-size: 80px;
  }

  h2 {
    font-size: 36px;
  }

  h3 {
    font-size: 24px;
  }

  .pomodoro-timer {
    flex-direction: column;
    gap: 16px;
    min-height: auto;
    padding: 20px 24px;
  }

  .timer-left {
    flex: none;
    text-align: center;
  }

  .timer-right {
    flex: none;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .timer-right button {
    width: auto;
    padding: 8px 12px;
    font-size: 16px;
  }

  #vertical-line {
    display: none;
  }

  .music-section {
    flex-direction: column;
    gap: 16px;
  }

  .music-player {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .player-soundcloud {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .track-thumbnail {
    width: 100px;
    height: 100px;
  }

  .track-controls {
    gap: 16px;
  }

  .music-taste {
    flex-direction: row;
    justify-content: center;
    gap: 16px;
  }

  .music-taste button {
    width: 60px;
    height: 60px;
  }

  .todo-list {
    min-height: 150px;
    max-height: 300px;
  }
}

/* Mobile Portrait - 480px and below */
@media screen and (max-width: 480px) {
  .main-wrapper {
    padding: 0 12px;
  }

  h1 {
    font-size: 64px;
  }

  h2 {
    font-size: 32px;
  }

  h3 {
    font-size: 20px;
  }

  h4 {
    font-size: 18px;
  }

  .container {
    gap: 16px;
    padding: 16px 0;
  }

  .pomodoro-timer {
    padding: 16px 12px;
    max-width: 100%;
  }

  .music-section {
    max-width: 100%;
  }

  .todo-list {
    max-width: 100%;
  }

  .timer-right {
    gap: 6px;
  }

  .timer-right button {
    padding: 6px 10px;
    font-size: 14px;
  }

  #start {
    width: 70px;
    height: 36px;
    font-size: 16px;
  }

  .track-thumbnail {
    width: 80px;
    height: 80px;
  }

  .track-controls button img {
    width: 22px;
    height: 22px;
  }

  #play img {
    width: 44px;
    height: 44px;
  }

  .music-taste button {
    width: 50px;
    height: 50px;
  }

  .bottom-section {
    margin-right: 12px;
    margin-bottom: 12px;
  }
}

/* Small Mobile - 360px and below */
@media screen and (max-width: 360px) {
  .main-wrapper {
    padding: 0 16px;
  }

  .container {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
  }

  .left-section {
    width: 100%;
    order: 1;
    text-align: center;
  }

  .right-section {
    width: 100%;
    order: 2;
    margin-right: 0;
    align-items: center;
  }

  #title {
    position: static;
    text-align: center;
    margin-bottom: 20px;
  }

  h1 {
    font-size: 48px;
  }

  h2 {
    font-size: 28px;
  }

  .center-display {
    margin-bottom: 20px;
  }

  .pomodoro-timer {
    max-width: 100%;
    margin: 16px 0;
    flex-direction: row;
    gap: 20px;
    padding: 20px 16px;
  }

  .timer-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .timer-right {
    flex: none;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .timer-right button {
    width: 120px;
    padding: 8px 12px;
    font-size: 14px;
  }

  #vertical-line {
    width: px;
    height: 100%;
    border-color: rgba(133, 133, 133, 0.4);
  }

  .music-section {
    max-width: 100%;
  }

  .todo-list {
    max-width: 100%;
  }

  .track-controls {
    gap: 12px;
  }
}

