/* タスクマネージャースタイル（モノトーン調） */
.task-manager {
  width: 95vw;
  height: 95vh;
  padding: 15px;
  max-width: 1400px;
  margin: 0 auto;
  background-color: #f8f8f8; /* 明るい灰色 */
  border-radius: 15px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.task-manager header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 15px;
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  gap: 10px;
}

.dashboard-button {
  padding: 10px 15px;
  background-color: #4a90e2;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  color: white;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.3s;
}

.dashboard-button:hover {
  background-color: #357abd;
}

.dashboard-button-link {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.dashboard-button-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.task-manager h1 {
  font-size: 32px;
  font-weight: bold;
  color: #333; /* 濃い灰色 */
  text-align: center;
  margin: 0;
  flex-grow: 1;
}

.task-container {
  display: flex;
  gap: 15px;
  flex-grow: 1;
  min-height: 0;
}

.task-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 2px solid #e0e0e0;
  min-height: 0;
  overflow: hidden;
}

.task-section h2 {
  font-size: 16px;
  font-weight: bold;
  color: #444;
  text-align: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #ddd;
  flex-shrink: 0;
}

#plan-section {
  border-top: 4px solid #666; /* 計画は濃い灰色 */
}

#progress-section {
  border-top: 4px solid #888; /* 実行は中間の灰色 */
}

#completed-section {
  border-top: 4px solid #aaa; /* 完了は薄い灰色 */
}

.task-list {
  flex-grow: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 8px 0;
}

.task-item {
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  word-wrap: break-word;
}

.task-item:hover {
  background-color: #e8e8e8;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.task-item.dragging {
  opacity: 0.5;
  transform: rotate(3deg);
  z-index: 1000;
}

.task-list.drag-over {
  background-color: #e8f4fd;
  border: 2px dashed #4a90e2;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.task-item .drag-handle {
  position: absolute;
  top: 5px;
  right: 5px;
  color: #999;
  font-size: 14px;
  cursor: grab;
  user-select: none;
}

.task-item .drag-handle:active {
  cursor: grabbing;
}

/* モバイル用移動ボタン */
.mobile-move-buttons {
  display: none;
  margin-top: 10px;
  gap: 8px;
  flex-wrap: wrap;
}

.move-btn {
  background-color: #4a90e2;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  white-space: nowrap;
}

.move-btn:hover {
  background-color: #357abd;
  transform: translateY(-1px);
}

.move-btn:active {
  transform: translateY(0);
}

.move-to-progress {
  background-color: #28a745;
}

.move-to-progress:hover {
  background-color: #218838;
}

.move-to-completed {
  background-color: #6c757d;
}

.move-to-completed:hover {
  background-color: #545b62;
}

.move-to-plan {
  background-color: #fd7e14;
}

.move-to-plan:hover {
  background-color: #e8690b;
}

.task-title {
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
  font-size: 14px;
}

.task-description {
  color: #666;
  font-size: 12px;
  line-height: 1.4;
}

.add-task-area {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}

.add-task-area input {
  flex-grow: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  min-width: 120px;
}

.add-task-area select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  min-width: 60px;
}

.add-task-area button {
  padding: 8px 16px;
  background-color: #666;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.3s;
  white-space: nowrap;
}

.add-task-area button:hover {
  background-color: #555;
}

/* モーダルスタイル */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: #f9f9f9;
  padding: 30px;
  border-radius: 10px;
  width: 500px;
  max-width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
  margin-bottom: 20px;
  color: #333;
  text-align: center;
}

.modal-content label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #444;
}

.modal-content input,
.modal-content textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  margin-bottom: 15px;
  font-size: 14px;
  box-sizing: border-box;
}

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

.modal-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

#save-task-btn {
  background-color: #666;
  color: white;
}

#save-task-btn:hover {
  background-color: #555;
}

#delete-task-btn {
  background-color: #999;
  color: white;
}

#delete-task-btn:hover {
  background-color: #777;
}

#cancel-edit-btn {
  background-color: #bbb;
  color: white;
}

#cancel-edit-btn:hover {
  background-color: #999;
}

/* 戻るボタンスタイル */
.back-button {
  padding: 10px 15px;
  background-color: #666;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  color: white;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.3s;
}

.back-button:hover {
  background-color: #555;
}

.back-button-link {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.back-button-link:hover {
  background-color: #444;
}

/* 完了タスクのスタイル */
#completed-tasks .task-item {
  background-color: #e8e8e8;
  color: #777;
}

#completed-tasks .task-title {
  text-decoration: line-through;
  color: #888;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .task-container {
    flex-direction: column;
    height: auto;
  }
  
  .task-section {
    min-height: 300px;
  }
  
  .task-manager {
    width: 98vw;
    height: auto;
    min-height: 90vh;
  }
}

/* ポモドーロタイマーのスタイル（横長レイアウト） */
.pomodoro-timer {
  display: flex;
  align-items: center;
  gap: 15px;
  background-color: #f9f9f9;
  padding: 10px 15px;
  border-radius: 8px;
  border: 2px solid #ddd;
  flex-shrink: 0;
}

.timer-display {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  min-width: 60px;
}

.timer-controls {
  display: flex;
  gap: 6px;
}

.timer-btn {
  padding: 6px 12px;
  background-color: #666;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  transition: background-color 0.3s;
  white-space: nowrap;
}

.timer-btn:hover {
  background-color: #555;
}

.timer-btn:disabled {
  background-color: #999;
  cursor: not-allowed;
}

.timer-mode {
  font-size: 11px;
  color: #666;
  font-weight: bold;
  min-width: 50px;
}

/* 優先度と期限の表示 */
.task-priority-select, .task-due-date {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 12px;
  min-width: 80px;
}

.priority-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: bold;
  margin-right: 8px;
}

.priority-high {
  background-color: #ff6b6b;
  color: white;
}

.priority-medium {
  background-color: #ffd93d;
  color: #333;
}

.priority-low {
  background-color: #6bcf7f;
  color: white;
}

.due-date-info {
  font-size: 10px;
  color: #666;
  margin-top: 4px;
}

.due-date-overdue {
  color: #ff6b6b;
  font-weight: bold;
}

.due-date-today {
  color: #ff9500;
  font-weight: bold;
}

.due-date-upcoming {
  color: #4a90e2;
}

/* 進捗率スライダー */
.progress-slider {
  width: 100%;
  margin: 10px 0;
}

.task-progress {
  margin-top: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: #4a90e2;
  transition: width 0.3s ease;
  border-radius: 4px;
}

.progress-text {
  font-size: 10px;
  color: #666;
  margin-top: 2px;
}

/* モバイル時にのみ移動ボタンを表示、デスクトップではドラッグハンドルを表示 */
@media (max-width: 768px) {
  .mobile-move-buttons {
    display: flex;
  }
  
  .drag-handle {
    display: none;
  }
  
  .move-btn {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 36px;
  }
}

@media (min-width: 769px) {
  .mobile-move-buttons {
    display: none;
  }
  
  .drag-handle {
    display: block;
  }
}