/* ==========================================================================
   TaskFlow Pro - Mobile-First & Drawer Navigation Styles v3.1
   ========================================================================== */

/* Hamburger Button */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 38px;
  height: 38px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 7px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}
.hamburger-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-focus);
}
.hamburger-line {
  width: 100%;
  height: 2.5px;
  background-color: var(--text-primary);
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
}

/* Sidebar Drawer (Off-canvas Navigation) */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}
.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  max-width: 85vw;
  height: 100%;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateX(-100%);
  transition: transform var(--transition-slow);
  overflow-y: auto;
}
.sidebar-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.drawer-menu-list {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.drawer-section-title {
  padding: 0.6rem 0.75rem 0.25rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.drawer-menu-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.drawer-menu-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.drawer-menu-item.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Quick Log Presets Carousel */
.quick-log-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.quick-log-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}
.quick-log-scroll {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
}
.quick-preset-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}
.quick-preset-chip:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  background: var(--bg-tertiary);
  box-shadow: var(--shadow-md);
}

/* Category Badges for Loan Operations */
.badge-cat-hp2 {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}
[data-theme="dark"] .badge-cat-hp2 {
  background: rgba(79, 70, 229, 0.2);
  color: #a5b4fc;
  border-color: rgba(79, 70, 229, 0.4);
}

.badge-cat-tss1 {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
[data-theme="dark"] .badge-cat-tss1 {
  background: rgba(5, 150, 105, 0.2);
  color: #6ee7b7;
  border-color: rgba(5, 150, 105, 0.4);
}

.badge-cat-factoring {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
[data-theme="dark"] .badge-cat-factoring {
  background: rgba(2, 132, 199, 0.2);
  color: #7dd3fc;
  border-color: rgba(2, 132, 199, 0.4);
}

.badge-cat-welfare {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
[data-theme="dark"] .badge-cat-welfare {
  background: rgba(217, 119, 6, 0.2);
  color: #fcd34d;
  border-color: rgba(217, 119, 6, 0.4);
}

.badge-cat-other {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}
[data-theme="dark"] .badge-cat-other {
  background: rgba(124, 58, 237, 0.2);
  color: #c4b5fd;
  border-color: rgba(124, 58, 237, 0.4);
}

.badge-work-main {
  background: #ede9fe;
  color: #5b21b6;
  font-weight: 700;
  border: 1px solid #c4b5fd;
}
.badge-work-support {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* Mobile Bottom Navigation Bar */
.bottom-nav-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  padding: 6px 0.5rem;
  z-index: 900;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  justify-content: space-around;
  align-items: center;
}
[data-theme="dark"] .bottom-nav-bar {
  background: rgba(17, 24, 39, 0.95);
}

.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.bottom-nav-btn svg, .bottom-nav-btn span.nav-icon {
  font-size: 1.2rem;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bottom-nav-btn:hover {
  color: var(--text-primary);
}
.bottom-nav-btn.active {
  color: var(--primary);
}

/* Floating Action Button (FAB) for Mobile Add Task */
.mobile-fab-btn {
  display: none;
  position: fixed;
  bottom: 70px;
  right: 1.25rem;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 16px var(--primary-glow);
  z-index: 890;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.mobile-fab-btn:active {
  transform: scale(0.92);
}

/* Scratchpad Layout */
.scratchpad-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: calc(100vh - 220px);
}
.scratchpad-textarea {
  flex: 1;
  width: 100%;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  resize: none;
  box-shadow: var(--shadow-sm);
}
.scratchpad-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Dynamic Multi-Contract Row Builder */
.contract-entry-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Clickable Category Row for Interactive Drill-Down */
.clickable-category-row {
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.clickable-category-row:hover {
  background: var(--bg-tertiary) !important;
}

/* Drill-Down Task Row */
.drilldown-task-row {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.drilldown-task-row:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .nav-tabs {
    display: none;
  }
  .bottom-nav-bar {
    display: flex;
  }
  .mobile-fab-btn {
    display: flex;
  }
  .main-content {
    padding-bottom: 75px;
  }
}
