@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: "Inter", sans-serif !important;
}

:root {
  --bg-primary: #000000;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #888888;
  --accent: #ffffff;
  --border: #333333;
  --shadow: rgba(0, 0, 0, 0.5);
  --success: #10b981;
  --danger: #ef4444;
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f3f4f6;
  --text-primary: #000000;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --accent: #000000;
  --border: #e5e7eb;
  --shadow: rgba(0, 0, 0, 0.1);
  --success: #059669;
  --danger: #dc2626;
}

[data-theme="ocean"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --accent: #0ea5e9;
  --border: #475569;
  --shadow: rgba(15, 23, 42, 0.5);
  --success: #06b6d4;
  --danger: #ef4444;
}

[data-theme="forest"] {
  --bg-primary: #0f1419;
  --bg-secondary: #1a2332;
  --bg-tertiary: #2d3748;
  --text-primary: #f7fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #718096;
  --accent: #48bb78;
  --border: #4a5568;
  --shadow: rgba(15, 20, 25, 0.5);
  --success: #38a169;
  --danger: #e53e3e;
}

[data-theme="sunset"] {
  --bg-primary: #1a1625;
  --bg-secondary: #2d1b3d;
  --bg-tertiary: #3d2a4f;
  --text-primary: #faf5ff;
  --text-secondary: #e9d5ff;
  --text-muted: #a78bfa;
  --accent: #f59e0b;
  --border: #553c9a;
  --shadow: rgba(26, 22, 37, 0.5);
  --success: #10b981;
  --danger: #f56565;
}

[data-theme="purple"] {
  --bg-primary: #1e1b4b;
  --bg-secondary: #312e81;
  --bg-tertiary: #3730a3;
  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #a855f7;
  --border: #4c1d95;
  --shadow: rgba(30, 27, 75, 0.5);
  --success: #22c55e;
  --danger: #ef4444;
}

[data-theme="rose"] {
  --bg-primary: #1f0f1a;
  --bg-secondary: #3a1f2e;
  --bg-tertiary: #5a2f42;
  --text-primary: #fce7f3;
  --text-secondary: #fbcfe8;
  --text-muted: #f472b6;
  --accent: #ec4899;
  --border: #be185d;
  --shadow: rgba(31, 15, 26, 0.5);
  --success: #10b981;
  --danger: #f43f5e;
}

[data-theme="blush"] {
  --bg-primary: #faf8f7;
  --bg-secondary: #f5f3f1;
  --bg-tertiary: #ede9e6;
  --text-primary: #3f2f28;
  --text-secondary: #6b5b52;
  --text-muted: #9a8680;
  --accent: #f8a8d8;
  --border: #e8d8d1;
  --shadow: rgba(63, 47, 40, 0.1);
  --success: #059669;
  --danger: #dc2626;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  gap: 1rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
}

.logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: slowPulse 1.5s infinite;
}

@keyframes slowPulse {
  0% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 var(--accent);
  }
  25% {
    opacity: 0.8;
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.2);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.1);
  }
  75% {
    opacity: 0.8;
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 var(--accent);
  }
}

.header-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  font-family: "Inter", sans-serif;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
  transform: scale(1.05);
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn.active {
  background: var(--accent);
  color: var(--bg-primary);
}

/* Improved main content layout for better responsiveness */
.main-content {
  flex: 1;
  display: grid;
  gap: 2rem;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  min-height: 0;
  align-items: start;
  justify-content: center;
  transition: grid-template-columns 0.3s ease;
  overflow-y: auto;
}

.main-content.with-todos {
  grid-template-columns: minmax(280px, 400px) 1fr;
}

.main-content.with-calendar {
  grid-template-columns: minmax(280px, 400px) 1fr;
}

.main-content.timer-only {
  grid-template-columns: 1fr;
  justify-items: center;
}

/* Calendar Section */
.calendar-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  height: fit-content;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  min-width: 280px;
}

.calendar-section.hidden {
  display: none;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.calendar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.calendar-nav-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.calendar-day:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

.calendar-day.today {
  border-color: var(--accent);
  font-weight: 600;
}

.calendar-day.active {
  background: var(--accent);
  color: var(--bg-primary);
}

.calendar-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

/* Todo Section */
.todo-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  height: fit-content;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  min-width: 280px;
}

.todo-section.hidden {
  display: none;
}

.todo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.todo-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Inter", sans-serif;
}

.todo-stats {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  font-family: "Inter", sans-serif;
}

.todo-input-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

#todoInput {
  flex: 1;
  min-width: 150px;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
}

#todoInput:focus {
  border-color: var(--accent);
  background: var(--bg-primary);
}

#todoInput::placeholder {
  color: var(--text-muted);
  font-family: "Inter", sans-serif;
}

.priority-select {
  padding: 0.75rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
}

.priority-select:focus {
  border-color: var(--accent);
}

.add-todo-btn {
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.add-todo-btn:hover {
  transform: scale(1.05);
}

.add-todo-btn:active {
  transform: scale(0.95);
}

.todo-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.todo-item-wrapper {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.todo-item-wrapper:hover {
  background: var(--bg-primary);
}

.todo-item-wrapper.selected {
  border-color: var(--accent);
  background: var(--bg-primary);
}

.todo-item.dragging {
  opacity: 0.5;
  transform: rotate(5deg);
}

.todo-item.drag-over {
  border-top: 2px solid var(--accent);
}

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  cursor: move;
}

.todo-item.completed {
  opacity: 0.6;
}

.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.todo-priority-indicator {
  width: 3px;
  height: 40px;
  border-radius: 2px;
  flex-shrink: 0;
}

.todo-priority-indicator.high {
  background: var(--danger);
}

.todo-priority-indicator.medium {
  background: var(--accent);
}

.todo-priority-indicator.low {
  background: var(--text-muted);
}

.todo-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.todo-checkbox.checked {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.todo-text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-primary);
  word-wrap: break-word;
  word-break: break-word;
  line-height: 1.5;
  font-family: "Inter", sans-serif;
  min-width: 0;
  cursor: pointer;
}

.todo-edit-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.5rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  font-family: "Inter", sans-serif;
  word-wrap: break-word;
  resize: none;
  min-height: 1.5em;
}

.todo-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.todo-action-btn {
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.todo-action-btn:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.todo-action-btn.save:hover {
  background: var(--success);
  color: white;
}

.todo-action-btn.cancel:hover {
  background: var(--danger);
  color: white;
}

/* Subtask Styles */
.subtask-list {
  padding: 0 0.75rem 0.75rem 3.2rem; /* Aligns with todo text */
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.subtask-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.subtask-item.completed .subtask-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.subtask-checkbox {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.subtask-checkbox.checked {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.subtask-text {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.subtask-delete-btn {
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.subtask-delete-btn:hover {
  color: var(--danger);
  background: var(--bg-primary);
}

.subtask-input-container {
  display: flex;
  gap: 0.5rem;
  padding: 0 0.75rem 0.75rem 3.2rem;
}

.subtask-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  color: var(--text-primary);
  font-size: 0.8rem;
  outline: none;
}
.subtask-input:focus {
  border-color: var(--accent);
}

.add-subtask-btn {
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}


.todo-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.clear-completed-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
}

.clear-completed-btn:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.clear-completed-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.875rem;
  line-height: 1.6;
  font-family: "Inter", sans-serif;
}

/* Timer Section */
.timer-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
}

.session-label {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  /* Added to prevent text overflow */
  max-width: 90%;
  word-break: break-word;
}

.timer-container {
  position: relative;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring {
  width: 320px;
  height: 320px;
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 3;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.timer-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.timer-time {
  font-size: 4rem;
  font-weight: 900;
  font-family: "Inter", monospace;
  letter-spacing: -0.05em;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.timer-status {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  font-family: "Inter", sans-serif;
}

.play-btn {
  width: 70px;
  height: 70px;
  border: none;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px var(--shadow);
  flex-shrink: 0;
}

.play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px var(--shadow);
}

.play-btn:active {
  transform: scale(0.95);
}

.control-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.ctrl-btn {
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Inter", sans-serif;
}

.ctrl-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
  transform: scale(1.05);
}

.sound-indicator {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 50px;
  height: 50px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px var(--shadow);
  z-index: 1000;
}

.sound-indicator:hover {
  background: var(--accent);
  color: var(--bg-primary);
  transform: scale(1.1);
}

.sound-indicator.muted {
  opacity: 0.6;
  color: var(--text-muted);
}

/* White Noise Controls */
.white-noise-controls {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  width: 320px;
  box-shadow: 0 8px 30px var(--shadow);
  z-index: 1000;
  backdrop-filter: blur(10px);
  max-height: 80vh;
  overflow-y: auto;
}

.noise-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.noise-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
}

.noise-tabs {
  display: flex;
  gap: 0.5rem;
}

.noise-tab {
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
}

.noise-tab.active {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

.close-noise-btn {
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.close-noise-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.noise-content {
  margin-bottom: 1rem;
}

.noise-content.hidden {
  display: none;
}

.noise-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.noise-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  font-family: "Inter", sans-serif;
}

.noise-btn:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.noise-btn.active {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

.noise-btn span {
  font-size: 0.75rem;
  font-weight: 500;
  font-family: "Inter", sans-serif;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.volume-control i {
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

#noiseVolume {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

#noiseVolume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: all 0.2s ease;
}

#noiseVolume::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Theme Selector (New Styles) */
.theme-selector {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 30px var(--shadow);
  z-index: 2000;
  backdrop-filter: blur(10px);
}

.theme-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.theme-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
}

.close-theme-btn {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.close-theme-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 columns */
  gap: 1rem;
}

.theme-option {
  display: flex;
  flex-direction: column; /* Text above dots */
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  font-family: "Inter", sans-serif;
}

.theme-option:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
  transform: scale(1.02);
  border-color: var(--accent);
}

.theme-option.active {
  border-color: var(--accent);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.theme-option span {
  font-size: 0.875rem;
  font-weight: 500;
  font-family: "Inter", sans-serif;
}

.theme-dots {
  display: flex;
  gap: 0.5rem;
}

.theme-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
}


/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

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

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
}

.close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 16px;
  text-align: center;
  border: 1px solid var(--border);
  animation: slideInUp 0.5s ease;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  font-family: "Inter", sans-serif;
}

.stats-chart {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.setting-group {
  margin-bottom: 2rem;
}

.setting-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
}

.slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
  transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 15px var(--shadow);
}

.apply-btn {
  width: 100%;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
  font-family: "Inter", sans-serif;
}

.apply-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px var(--shadow);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.modal-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
}

.modal-btn.cancel {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.modal-btn.danger {
  background: var(--danger);
  color: white;
}

.about-content {
  text-align: center;
  line-height: 1.8;
}

.about-content h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-family: "Inter", sans-serif;
}

.about-content p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-family: "Inter", sans-serif;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
}

.contact-link:hover {
  background: var(--accent);
  color: var(--bg-primary);
  transform: translateY(-2px);
}

.motivational-message {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1.5rem;
  color: var(--text-secondary);
}

.motivational-message p {
  font-family: "Inter", sans-serif;
}

.completed-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.completed-toggle:hover {
  background: var(--bg-primary);
}

.completed-toggle label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin: 0;
  font-family: "Inter", sans-serif;
}

/* Floating timer widget for desktop and mobile */
.floating-widget {
  position: fixed;
  bottom: 100px;
  right: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  width: 200px;
  box-shadow: 0 8px 30px var(--shadow);
  z-index: 999;
  display: none;
  flex-direction: column;
  gap: 1rem;
  backdrop-filter: blur(10px);
  touch-action: none;
}

.floating-widget.active {
  display: flex;
}

.floating-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--text-primary);
}

.floating-close-btn {
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.floating-close-btn:hover {
  color: var(--text-primary);
}

.floating-timer-display {
  font-size: 2rem;
  font-weight: 900;
  font-family: "Inter", monospace;
  text-align: center;
  color: var(--accent);
}

.floating-controls {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.floating-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex: 1;
}

.floating-btn:hover {
  transform: scale(1.1);
}

.floating-resize-handle {
  width: 20px;
  height: 20px;
  position: absolute;
  bottom: 0;
  right: 0;
  cursor: nwse-resize;
  background: var(--border);
  border-radius: 0 0 16px 0;
}

.hidden {
  display: none !important;
}

/* Improved responsive design for split-screen and all screen sizes */
@media (max-width: 1440px) {
  .main-content.with-todos,
  .main-content.with-calendar {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .todo-section,
  .calendar-section {
    order: 2;
    max-height: 50vh;
    min-width: auto;
    max-width: none;
  }

  .timer-section {
    order: 1;
  }
}

@media (max-width: 1024px) {
  .main-content.with-todos,
  .main-content.with-calendar {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .todo-section,
  .calendar-section {
    order: 2;
    max-height: 50vh;
    min-width: auto;
    max-width: none;
  }

  .timer-section {
    order: 1;
  }

  .white-noise-controls {
    width: 300px;
  }

  .theme-selector {
    width: 350px;
  }

  .progress-ring {
    width: 280px;
    height: 280px;
  }

  .timer-time {
    font-size: 3rem;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .logo {
    font-size: 1.5rem;
  }

  .header-controls {
    gap: 0.25rem;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
  }

  .main-content {
    padding: 1rem;
    gap: 1rem;
  }

  .timer-time {
    font-size: 2.5rem;
  }

  .progress-ring {
    width: 240px;
    height: 240px;
  }

  .play-btn {
    width: 60px;
    height: 60px;
    font-size: 20px;
  }

  .control-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 200px;
    gap: 0.75rem;
  }

  .ctrl-btn {
    justify-content: center;
  }

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

  .sound-indicator {
    bottom: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
  }

  .todo-section,
  .calendar-section {
    max-height: 40vh;
    padding: 1rem;
    min-width: auto;
  }

  .white-noise-controls {
    width: 280px;
    bottom: 1rem;
    left: 1rem;
  }

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

  .theme-selector {
    width: 320px;
  }

  .theme-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
  }

  .modal {
    padding: 1.5rem;
    margin: 0.5rem;
  }

  .floating-widget {
    width: 180px;
    bottom: 80px;
    right: 10px;
  }
}

@media (max-width: 640px) {
  .main-content {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .timer-time {
    font-size: 2.2rem;
  }

  .progress-ring {
    width: 220px;
    height: 220px;
  }

  .modal {
    padding: 1.25rem;
    margin: 0.5rem;
  }

  .session-label {
    margin-bottom: 1.5rem;
    font-size: 1rem;
  }

  .todo-section,
  .calendar-section {
    padding: 0.75rem;
    max-height: 35vh;
  }

  .white-noise-controls {
    width: calc(100vw - 2rem);
    left: 1rem;
    right: 1rem;
  }

  .theme-selector {
    width: calc(100vw - 2rem);
    left: 1rem;
    right: 1rem;
  }

  .floating-widget {
    width: 160px;
    font-size: 0.9rem;
    bottom: 70px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .logo {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 0.75rem;
  }

  .main-content {
    padding: 0.75rem;
  }

  .timer-time {
    font-size: 2rem;
  }

  .progress-ring {
    width: 200px;
    height: 200px;
  }

  .play-btn {
    width: 55px;
    height: 55px;
    font-size: 18px;
  }

  .modal {
    padding: 1.25rem;
    margin: 0.5rem;
  }

  .session-label {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
  }

  .todo-section,
  .calendar-section {
    padding: 0.75rem;
    max-height: 35vh;
  }

  .white-noise-controls {
    width: calc(100vw - 2rem);
    left: 1rem;
    right: 1rem;
  }

  .theme-selector {
    width: calc(100vw - 2rem);
    left: 1rem;
    right: 1rem;
  }

  .floating-widget {
    width: 150px;
    font-size: 0.85rem;
    bottom: 60px;
    right: 5px;
  }

  .floating-timer-display {
    font-size: 1.5rem;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .logo {
    font-size: 1.25rem;
  }
}
