@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;
}

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;
}

.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: energeticPulse 0.8s infinite;
}

@keyframes energeticPulse {
  0% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 var(--accent);
  }
  25% {
    opacity: 0.8;
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.4);
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.1);
  }
  75% {
    opacity: 0.8;
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 var(--accent);
  }
}

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

.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;
}

.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);
}

.main-content {
  flex: 1;
  display: grid;
  gap: 3rem;
  padding: 2rem 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;
}

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

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

/* 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: 350px;
  max-width: 500px;
}

.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.75rem;
  margin-bottom: 1.5rem;
}

#todoInput {
  flex: 1;
  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;
}

.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;
}

.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;
  max-height: 400px;
}

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

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

.todo-item {
  cursor: move;
}

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.todo-item:hover {
  background: var(--bg-primary);
  transform: translateY(-1px);
}

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

.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: 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;
}

.todo-delete {
  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;
  flex-shrink: 0;
}

.todo-delete:hover {
  background: var(--danger);
  color: white;
}

.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;
}

.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;
}

.clear-completed-btn:disabled:hover {
  background: var(--bg-tertiary);
  border-color: var(--border);
  color: var(--text-secondary);
}

.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;
}

.session-label {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
}

.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);
}

.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;
}

.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: 300px;
  box-shadow: 0 8px 30px var(--shadow);
  z-index: 1000;
  backdrop-filter: blur(10px);
}

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

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

.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-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);
}

.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: 500px;
  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(2, 1fr);
  gap: 1rem;
}

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

.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;
}

.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);
}

.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 Tasks Toggle */
.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 input[type="checkbox"] {
  margin: 0;
}

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

/* Mobile Responsive */
@media (max-width: 1024px) {
  .main-content.with-todos {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .timer-section {
    order: 1;
  }

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

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

  .logo {
    font-size: 1.5rem;
  }

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

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

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

  .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: 1fr;
  }

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

  .todo-section {
    max-height: 40vh;
  }

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

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

@media (max-width: 480px) {
  .main-content {
    padding: 1rem;
  }

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

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

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

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

  .todo-section {
    padding: 1rem;
    max-height: 35vh;
  }

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

.hidden {
  display: none !important;
}
