/* MyToDo - Things3風スタイル */

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg-dark: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-hover: #1e2a4a;
  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --border: #374151;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* サイドバー */
.sidebar {
  width: 280px;
  background: var(--bg-card);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  padding: 20px 0;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s;
  gap: 12px;
}

.sidebar-item:hover {
  background: var(--bg-card-hover);
}

.sidebar-item.active {
  background: var(--primary);
}

.sidebar-item .badge {
  margin-left: auto;
  background: rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  min-width: 24px;
  text-align: center;
}

.sidebar-item.active .badge {
  background: rgba(255,255,255,0.3);
}

/* メインコンテンツ */
.main-content {
  margin-left: 280px;
  padding: 20px;
  min-height: 100vh;
}

/* タスクカード */
.task-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.task-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border);
}

.task-card.completed {
  opacity: 0.6;
}

.task-card.overdue {
  border-left: 3px solid var(--danger);
}

.task-card.today {
  border-left: 3px solid var(--warning);
}

/* チェックボックス */
.checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.checkbox:hover {
  border-color: var(--primary);
}

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

.checkbox.important {
  border-color: var(--warning);
}

/* 添付インジケーター */
.attachment-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

/* モーダル */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-body {
  padding: 20px;
}

/* フォーム要素 */
.input {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.input:focus {
  border-color: var(--primary);
}

.btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-size: 14px;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
}

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

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

/* FAB（フローティングボタン） */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  cursor: pointer;
  transition: all 0.2s;
  z-index: 50;
}

.fab:hover {
  transform: scale(1.1);
  background: var(--primary-hover);
}

/* 添付ファイルプレビュー */
.attachment-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.attachment-item {
  background: var(--bg-dark);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  max-width: 200px;
}

.attachment-item img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

/* クイック添付バー */
.quick-attach-bar {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-dark);
  border-radius: 8px;
  margin-top: 12px;
}

.quick-attach-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.quick-attach-btn:hover {
  background: var(--bg-card-hover);
}

/* レスポンシブ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .mobile-header {
    display: flex !important;
  }
}

@media (min-width: 769px) {
  .mobile-header {
    display: none !important;
  }
  
  .sidebar-overlay {
    display: none !important;
  }
}

/* 期限バッジ */
.due-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
}

.due-badge.overdue {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.due-badge.today {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.due-badge.upcoming {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

/* リマインダーアイコン */
.reminder-icon {
  color: var(--warning);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* スライドアクション（モバイル用） */
.swipe-actions {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  opacity: 0;
  transition: opacity 0.2s;
}

.task-card:hover .swipe-actions {
  opacity: 1;
}

/* 空状態 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

/* トースト通知 */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 2000;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* セレクトボックス */
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}
