* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Sans', sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
}

#app {
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  min-height: 100vh;
  gap: 0;
}

.hidden {
  display: none !important;
}

/* ========== Ad Areas ========== */
.ad-area {
  background: #16162a;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #2a2a40;
}

.ad-placeholder {
  color: #444;
  font-size: 14px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* ========== Main Content ========== */
.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ========== Timer Section ========== */
.timer-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #1a1a2e;
  border: 3px solid #4ade80;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 800;
  color: #4ade80;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.logo-accent {
  color: #4ade80;
}

.timer-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin-bottom: 32px;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: #2a2a40;
  stroke-width: 10;
}

.timer-progress {
  fill: none;
  stroke: #4ade80;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 565.48;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s linear, stroke 0.3s ease;
}

.timer-progress.break {
  stroke: #60a5fa;
}

.timer-progress.long-break {
  stroke: #a78bfa;
}

.timer-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.timer-time {
  display: block;
  font-size: 4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
  line-height: 1;
}

.timer-mode {
  display: block;
  font-size: 1rem;
  color: #4ade80;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.timer-mode.break {
  color: #60a5fa;
}

.timer-mode.long-break {
  color: #a78bfa;
}

/* Timer Controls */
.timer-controls {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.btn {
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn-start {
  background: #4ade80;
  color: #000;
}

.btn-pause {
  background: #f59e0b;
  color: #000;
}

.btn-reset {
  background: #374151;
  color: #fff;
}

.timer-stats {
  color: #888;
  font-size: 14px;
}

.pomo-today {
  color: #f97316;
}

.btn-pip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 8px 16px;
  background: #374151;
  border: 1px solid #4a4a60;
  color: #aaa;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-pip:hover {
  background: #4a4a60;
  color: #fff;
  border-color: #4ade80;
}

.btn-pip svg {
  flex-shrink: 0;
}

/* ========== Tasks Section ========== */
.tasks-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 24px 24px 0;
}

/* Current Task Card */
.current-task-card {
  background: #22223a;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid #3a3a50;
}

.section-title {
  font-size: 14px;
  color: #888;
  font-weight: 600;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.current-task-content {
  min-height: 80px;
  margin-bottom: 20px;
}

.task-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  word-wrap: break-word;
}

.task-note {
  font-size: 0.95rem;
  color: #aaa;
  margin-bottom: 8px;
}

.task-pomo-badge {
  display: inline-block;
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13px;
}

.current-task-actions {
  display: flex;
  gap: 12px;
}

.btn-done {
  background: #4ade80;
  color: #000;
  flex: 1;
}

.btn-skip {
  background: #374151;
  color: #fff;
}

.btn-edit-small {
  background: transparent;
  border: 1px solid #3a3a50;
  color: #888;
  padding: 14px 20px;
}

.btn-edit-small:hover {
  border-color: #4ade80;
  color: #4ade80;
}

/* Task List Card */
.task-list-card {
  background: #22223a;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid #3a3a50;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

.task-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.task-list-header .section-title {
  margin-bottom: 0;
}

.task-count {
  background: #3a3a50;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  margin-left: 8px;
}

.btn-add {
  background: #4ade80;
  color: #000;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s;
}

.btn-add:hover {
  transform: scale(1.05);
}

.task-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
}

.task-list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 8px;
  background: #2a2a40;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  gap: 12px;
}

.task-list-item:hover {
  background: #3a3a50;
  transform: translateX(4px);
}

.task-list-item.current {
  background: linear-gradient(135deg, #2d4a3e 0%, #1a3a2e 100%);
  border: 2px solid #4ade80;
}

.task-list-item-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555;
  flex-shrink: 0;
}

.task-list-item.current .task-list-item-indicator {
  background: #4ade80;
}

.task-list-item-title {
  flex: 1;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-list-item-pomo {
  font-size: 12px;
  color: #f97316;
  flex-shrink: 0;
}

.task-list-item-delete {
  background: transparent;
  border: none;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
}

.task-list-item:hover .task-list-item-delete {
  opacity: 1;
}

.task-list-item-delete:hover {
  color: #f87171;
}

.task-list-empty {
  text-align: center;
  color: #666;
  padding: 40px 20px;
  font-size: 14px;
}

.task-list-item.dragging {
  opacity: 0.5;
}

/* ========== Overlay ========== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.overlay-content {
  background: #22223a;
  border-radius: 16px;
  padding: 32px;
  width: 90%;
  max-width: 450px;
  border: 1px solid #3a3a50;
}

.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.overlay-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.overlay-header .overlay-title {
  margin-bottom: 0;
}

.input {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  background: #1a1a2e;
  border: 2px solid #3a3a50;
  border-radius: 10px;
  color: #fff;
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.input:focus {
  border-color: #4ade80;
}

.input::placeholder {
  color: #666;
}

.input-note {
  font-size: 0.95rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #aaa;
  margin-bottom: 24px;
  cursor: pointer;
  font-size: 14px;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.overlay-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-cancel {
  background: #374151;
  color: #fff;
}

.btn-save {
  background: #4ade80;
  color: #000;
}

.btn-close {
  background: transparent;
  border: none;
  color: #888;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.btn-close:hover {
  color: #fff;
}

/* Log */
.log-content {
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.log-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.log-item {
  padding: 14px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #3a3a50;
  gap: 12px;
}

.log-item-title {
  flex: 1;
  font-size: 15px;
}

.log-item-pomo {
  color: #f97316;
  font-size: 13px;
}

.log-item-time {
  color: #666;
  font-size: 13px;
}

/* ========== Floating Button ========== */
.completed-btn {
  position: fixed;
  bottom: 24px;
  right: 140px;
  background: #22223a;
  border: 1px solid #3a3a50;
  color: #888;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  z-index: 50;
}

.completed-btn:hover {
  background: #3a3a50;
  color: #fff;
}

/* ========== Positive Message ========== */
.positive-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.8rem;
  font-weight: 700;
  color: #4ade80;
  animation: popIn 0.5s ease;
  pointer-events: none;
  z-index: 200;
}

@keyframes popIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  #app {
    grid-template-columns: 1fr;
  }

  .ad-area {
    display: none;
  }

  .main-content {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .timer-section {
    padding: 20px 0;
  }

  .tasks-section {
    padding: 0;
  }

  .timer-container {
    width: 220px;
    height: 220px;
  }

  .timer-time {
    font-size: 3rem;
  }

  .app-logo {
    margin-bottom: 16px;
  }

  .logo-icon {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .logo-text {
    font-size: 1.2rem;
  }

  .completed-btn {
    right: 24px;
  }
}

@media (max-width: 600px) {
  .timer-controls {
    flex-direction: column;
    width: 100%;
  }

  .timer-controls .btn {
    width: 100%;
  }

  .current-task-actions {
    flex-wrap: wrap;
  }

  .btn-done {
    flex: 1 1 100%;
  }
}
