/* ============================================================
   Focusbit Design System & Stylesheet
   Theme: Pure White & Elegant Soft Pastel Pink
   Typography: Inter & Pretendard
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Pretendard:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette */
  --bg-main: #FAFBFC;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FFFDFE;
  
  /* Soft Pastel Pink Accent Palette */
  --pink-50: #FFF5F7;
  --pink-100: #FFE5EC;
  --pink-200: #FFD6E0;
  --pink-300: #FFB8C6;
  --pink-400: #FF8DA1;
  --pink-500: #FF6B8B;
  --pink-active: rgba(255, 214, 224, 0.45);
  --pink-glow: rgba(255, 182, 193, 0.35);

  /* Neutrals */
  --text-primary: #2D3748;
  --text-secondary: #4A5568;
  --text-muted: #8A94A6;
  --text-completed: #A0AEC0;
  --border-light: #EDF2F7;
  --border-pink: #F8E2E7;
  --border-focus: #FF8DA1;
  --border-error: #E53E3E;

  /* Status Colors */
  --danger-red: #E53E3E;
  --danger-bg: #FFF5F5;
  --success-green: #38A169;

  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 8px 24px rgba(45, 55, 72, 0.06), 0 2px 6px rgba(0, 0, 0, 0.02);
  --shadow-pink-hover: 0 8px 22px rgba(255, 141, 161, 0.22);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.04);

  /* Radii & Transitions */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Pretendard', 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Background Subtle Gradient Overlay */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  height: 60vh;
  background: radial-gradient(circle at center, rgba(255, 229, 236, 0.45) 0%, rgba(255, 245, 247, 0.15) 55%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Container */
.app-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 28px 60px;
  position: relative;
  z-index: 1;
}

/* ============================================================
   1. Header Section
   ============================================================ */
.app-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
  text-align: center;
  position: relative;
}

.header-top-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: default;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(255, 107, 139, 0.35);
  transition: transform var(--transition-fast);
}

.logo-icon:hover {
  transform: rotate(5deg) scale(1.05);
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #1A202C 30%, var(--pink-500) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.system-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-pink);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success-green);
  box-shadow: 0 0 0 2px rgba(56, 161, 105, 0.2);
  transition: background-color var(--transition-fast);
}

.status-dot.offline {
  background-color: #ED8936;
  box-shadow: 0 0 0 2px rgba(237, 137, 54, 0.2);
}

/* Today's Date Box (Center Aligned) */
.today-date-container {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-pink);
  box-shadow: var(--shadow-sm);
  margin-top: 4px;
}

.today-calendar-icon {
  font-size: 18px;
}

.today-date-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.app-motto {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Mobile View Switcher Tabs (Hidden on Desktop) */
.mobile-view-tabs {
  display: none;
  width: 100%;
  margin-top: 20px;
  background: #EDF2F7;
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.mobile-tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mobile-tab-btn.active {
  background: var(--bg-surface);
  color: var(--pink-500);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   2. Main Dual Panel Grid (50% Left / 50% Right)
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.panel-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow var(--transition-normal);
}

.panel-card:hover {
  box-shadow: var(--shadow-md);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--border-light);
}

.panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.todo-panel .panel-title-icon {
  background: var(--pink-100);
  color: var(--pink-500);
}

.not-todo-panel .panel-title-icon {
  background: #FED7D7;
  color: #E53E3E;
}

.panel-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.panel-count-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--pink-50);
  color: var(--pink-500);
  border: 1px solid var(--border-pink);
}

/* ============================================================
   3. Input Form Components
   ============================================================ */
.input-form-container {
  margin-bottom: 24px;
  position: relative;
}

.input-box-wrapper {
  display: flex;
  gap: 8px;
  position: relative;
}

.task-input {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  font-size: 15px;
  font-family: inherit;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #FAFBFC;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  outline: none;
}

.task-input:hover {
  background: #FFFFFF;
  border-color: #CBD5E0;
}

.task-input:focus {
  background: #FFFFFF;
  border-color: var(--pink-400);
  box-shadow: 0 0 0 3px rgba(255, 141, 161, 0.25);
}

/* Error flash animation when empty */
.task-input.input-error {
  animation: errorShake 0.45s ease-in-out;
  border-color: var(--border-error) !important;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.25) !important;
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.error-tooltip {
  position: absolute;
  top: -34px;
  left: 12px;
  background: var(--danger-red);
  color: #FFF;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 10;
}

.error-tooltip::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 16px;
  border-width: 4px 4px 0;
  border-style: solid;
  border-color: var(--danger-red) transparent transparent;
}

.error-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

/* Submit Button */
.btn-submit {
  height: 48px;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
  color: #FFF;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 107, 139, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 107, 139, 0.42);
  filter: brightness(1.03);
}

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

/* Attribute Selectors (Radio Chips for To Do) */
.type-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 0 4px;
}

.radio-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.radio-label input[type="radio"] {
  appearance: none;
  width: 17px;
  height: 17px;
  border: 2px solid #CBD5E0;
  border-radius: 50%;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.radio-label input[type="radio"]:checked {
  border-color: var(--pink-500);
  background-color: var(--pink-500);
  box-shadow: inset 0 0 0 3px #FFF;
}

.char-counter {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.char-counter.limit {
  color: var(--danger-red);
  font-weight: 700;
}

/* ============================================================
   4. List Sections & Grouping
   ============================================================ */
.list-scroll-area {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 240px;
}

.list-group-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  padding: 0 4px;
}

.group-badge {
  font-size: 11px;
  background: #EDF2F7;
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================================
   5. Item Card Component & Micro-interactions
   ============================================================ */
.task-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  gap: 14px;
  position: relative;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
  cursor: pointer;
  user-select: none;
}

/* Hover Effect */
.task-item:hover {
  transform: translateY(-2px);
  background-color: var(--bg-card-hover);
  box-shadow: var(--shadow-pink-hover);
  border-color: var(--border-pink);
}

/* Active / Focus Selection Feedback (Soft Pink background + left accent line) */
.task-item.selected,
.task-item:active {
  background-color: var(--pink-active) !important;
  border-color: var(--pink-300) !important;
}

.task-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background-color: transparent;
  transition: background-color var(--transition-fast);
}

.task-item.selected::before,
.task-item:focus-within::before {
  background-color: var(--pink-500);
}

/* Custom Checkbox */
.custom-checkbox {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 7px;
  border: 2px solid #CBD5E0;
  background: #FFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.custom-checkbox svg {
  width: 13px;
  height: 13px;
  stroke: #FFF;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

/* Completed Checkbox Animation */
.task-item.completed .custom-checkbox {
  background-color: var(--pink-400);
  border-color: var(--pink-400);
  transform: scale(1.05);
  animation: checkBounce 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.task-item.completed .custom-checkbox svg {
  opacity: 1;
  transform: scale(1);
}

@keyframes checkBounce {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1.05); }
}

/* Not To Do Icon (Fixed prohibition icon) */
.not-todo-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  user-select: none;
}

/* Text Content */
.task-title {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
  transition: all 0.3s ease;
  line-height: 1.45;
}

.not-todo-item .task-title {
  font-weight: 600;
  color: #1A202C; /* High contrast charcoal */
}

/* Completed Text Transition (0.3s strikethrough & fade) */
.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--text-completed);
  opacity: 0.65;
}

/* Inline Edit Input */
.inline-edit-input {
  flex: 1;
  font-size: 15px;
  font-family: inherit;
  font-weight: 500;
  padding: 4px 8px;
  border: 1.5px solid var(--pink-400);
  border-radius: var(--radius-sm);
  background: #FFF;
  color: var(--text-primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 141, 161, 0.2);
}

/* Item Action Buttons (Delete) */
.btn-delete-item {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  opacity: 0.7;
  transition: all var(--transition-fast);
}

.task-item:hover .btn-delete-item {
  opacity: 1;
}

.btn-delete-item:hover {
  background: var(--danger-bg);
  color: var(--danger-red);
  transform: scale(1.1);
}

/* ============================================================
   6. Empty State Component
   ============================================================ */
.empty-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 20px;
  text-align: center;
  border: 1.5px dashed var(--border-pink);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.6);
  margin-top: 6px;
}

.empty-state-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--pink-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.empty-state-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  max-width: 260px;
  line-height: 1.5;
}

/* ============================================================
   7. Toast Notification Feedback
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: rgba(45, 55, 72, 0.94);
  backdrop-filter: blur(10px);
  color: #FFF;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

.toast.toast-pink {
  background: linear-gradient(135deg, var(--pink-500), #E53E3E);
}

@keyframes toastIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================================
   8. Responsive Layout (768px Media Query)
   ============================================================ */
@media (max-width: 768px) {
  .app-container {
    padding: 16px 14px 40px;
  }

  .header-top-bar {
    flex-direction: row;
    gap: 8px;
  }

  .today-date-text {
    font-size: 15px;
  }

  .today-date-container {
    padding: 8px 16px;
  }

  /* Show Tab switcher on mobile */
  .mobile-view-tabs {
    display: flex;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* When tabs are active, show one or both */
  .dashboard-grid.tab-todo-active .not-todo-panel {
    display: none;
  }

  .dashboard-grid.tab-not-todo-active .todo-panel {
    display: none;
  }

  .panel-card {
    padding: 18px 16px;
  }

  .task-input {
    height: 44px;
    font-size: 14px;
  }

  .btn-submit {
    height: 44px;
    padding: 0 16px;
  }
}
