/* ==========================================================================
   RemindTogether AI - Native Mobile Phone Simulator & Glassmorphic Styling
   ========================================================================== */

:root {
  --bg-main: #060911;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #1e293b;
  --bg-surface-glass: rgba(15, 23, 42, 0.9);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: rgba(99, 102, 241, 0.15);
  
  --emerald: #10b981;
  --emerald-light: rgba(16, 185, 129, 0.15);
  --amber: #f59e0b;
  --amber-light: rgba(245, 158, 11, 0.15);
  --rose: #f43f5e;
  --rose-light: rgba(244, 63, 94, 0.15);
  --purple: #a855f7;
  --cyan: #06b6d4;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.35);

  --font-family: 'Plus Jakarta Sans', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Theme Color Schemes (Option 4) */
[data-app-theme="emerald"] {
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-light: rgba(16, 185, 129, 0.15);
  --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.35);
}

[data-app-theme="sunset"] {
  --accent: #f43f5e;
  --accent-hover: #e11d48;
  --accent-light: rgba(244, 63, 94, 0.15);
  --shadow-glow: 0 0 25px rgba(244, 63, 94, 0.35);
}

[data-app-theme="cyan"] {
  --accent: #06b6d4;
  --accent-hover: #0891b2;
  --accent-light: rgba(6, 182, 212, 0.15);
  --shadow-glow: 0 0 25px rgba(6, 182, 212, 0.35);
}

[data-app-theme="light"] {
  --bg-main: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-surface-glass: rgba(255, 255, 255, 0.95);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(99, 102, 241, 0.6);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #4f46e5;
}

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

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.4;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Animated Mobile Splash Screen (Option 4) */
.app-splash-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #060911 0%, #0f172a 100%);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.app-splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.splash-logo-glow {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #fff;
  box-shadow: 0 0 35px rgba(99, 102, 241, 0.6);
  animation: bounce-logo 1.5s infinite alternate ease-in-out;
}

@keyframes bounce-logo {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-8px) scale(1.05); }
}

.splash-content h2 {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.splash-content p {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.splash-loader {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin-loader 0.8s infinite linear;
  margin-top: 10px;
}

@keyframes spin-loader {
  to { transform: rotate(360deg); }
}

/* Offline Banner */
.offline-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--amber);
  color: #000;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  z-index: 50;
  flex-shrink: 0;
}

.offline-banner.hidden {
  display: none;
}

/* Full Screen Native Mobile App Canvas */
.mobile-app-canvas {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

@media (max-width: 540px) {
  .mobile-app-canvas {
    max-width: 100%;
    box-shadow: none;
  }
}

/* Mobile App Header */
.mobile-app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 30;
  flex-shrink: 0;
}

.mobile-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.mobile-icon-btn:hover {
  background: var(--bg-surface-elevated);
}

.mobile-header-center {
  text-align: center;
  max-width: 180px;
}

.header-group-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mobile-header-center h2 {
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-header-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 1px;
}

.badge-pill {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.badge-admin { background: var(--accent-light); color: var(--accent); }
.badge-member { background: var(--emerald-light); color: var(--emerald); }

.code-pill {
  font-family: monospace;
  font-size: 0.65rem;
  color: var(--accent);
  background: var(--bg-surface-elevated);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
}

.mobile-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mobile-avatar-btn {
  background: transparent;
  border: none;
  cursor: pointer;
}

.mobile-avatar-btn img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}

/* Mobile Feed Body */
.mobile-feed-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

/* Hero Alert Card */
.mobile-hero-alert-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.hero-alert-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.hero-alert-content {
  flex: 1;
  min-width: 0;
}

.hero-alert-label {
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
}

.hero-alert-content h3 {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--amber);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-alert-content p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.hero-share-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--accent);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
}

/* View Mode Toggle: List vs Calendar + Voice Assistant Pill */
.view-mode-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-shrink: 0;
}

.view-toggle-capsule {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 2px;
}

.view-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.view-toggle-btn.active {
  background: var(--accent);
  color: #fff;
}

.voice-assistant-fab-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, var(--emerald), #059669);
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
  transition: var(--transition);
}

.voice-assistant-fab-pill:hover {
  transform: scale(1.04);
}

/* Calendar Section */
.calendar-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.calendar-section.hidden { display: none; }

.calendar-head-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-head-nav h4 {
  font-size: 0.86rem;
  font-weight: 700;
}

.calendar-weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day-cell {
  aspect-ratio: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.calendar-day-cell:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

.calendar-day-cell.is-today {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 800;
}

.calendar-day-cell.is-selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.calendar-day-cell.other-month {
  opacity: 0.3;
}

.calendar-day-dots-row {
  display: flex;
  gap: 2px;
  margin-top: 1px;
  height: 4px;
}

.calendar-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--amber);
}

.calendar-date-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-elevated);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
}

/* Quick Group & Personal Chips Carousel */
.quick-group-chips-carousel {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 4px 2px;
  flex-shrink: 0;
  min-height: 36px;
  align-items: center;
  scrollbar-width: none;
}

.quick-group-chips-carousel::-webkit-scrollbar {
  display: none;
}

.group-chip-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  height: 28px;
}

.group-chip-btn:hover {
  background: var(--bg-surface-elevated);
}

.group-chip-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.group-chip-btn.chip-personal.active {
  background: linear-gradient(135deg, var(--purple), #6366f1);
  border-color: var(--purple);
}

.group-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Unified Controls Cluster */
.mobile-controls-cluster {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
  flex-shrink: 0;
}

.search-sort-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mobile-search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  height: 32px;
}

.mobile-search-bar i {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.mobile-search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.78rem;
  width: 100%;
}

.sort-select-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  height: 32px;
  flex-shrink: 0;
}

.sort-icon {
  font-size: 0.75rem;
  color: var(--accent);
}

.sort-dropdown {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  height: 100%;
}

.sort-dropdown option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* Filter Pills Carousel */
.mobile-filter-carousel {
  display: flex;
  gap: 4px;
  width: 100%;
}

.mobile-pill-tab {
  flex: 1;
  text-align: center;
  padding: 5px 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.mobile-pill-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}

/* Tasks Flow */
.mobile-tasks-flow {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Task Card */
.task-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.task-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.task-card.priority-urgent::before { background: var(--rose); }
.task-card.priority-high::before { background: var(--amber); }
.task-card.priority-low::before { background: var(--cyan); }
.task-card.is-completed { opacity: 0.55; }
.task-card.is-completed::before { background: var(--emerald); }

.task-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.task-head-left {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.task-group-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-group-badge.badge-personal {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  box-shadow: 0 1px 6px rgba(168, 85, 247, 0.4);
}

.task-category-pill {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
}

.task-repeat-badge {
  font-size: 0.62rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.task-assignee-pill {
  font-size: 0.62rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.task-location-pill {
  font-size: 0.62rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  cursor: pointer;
}

.task-location-pill:hover {
  text-decoration: underline;
}

.task-priority-badge {
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
}

.badge-urgent { background: var(--rose-light); color: var(--rose); }
.badge-high { background: var(--amber-light); color: var(--amber); }
.badge-normal { background: var(--accent-light); color: var(--accent); }
.badge-low { background: rgba(6, 182, 212, 0.15); color: var(--cyan); }

.task-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
}

.is-completed .task-card-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-card-notes {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.task-attached-thumb {
  position: relative;
  width: 100%;
  max-height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-color);
}

.task-attached-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.task-attached-thumb span {
  position: absolute;
  bottom: 4px;
  right: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 4px;
}

/* Subtasks on Task Card */
.task-subtasks-wrapper {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.subtask-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.subtask-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 2px;
}

.subtask-progress-fill {
  height: 100%;
  background: var(--emerald);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.subtask-item-card {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}

.subtask-item-card.subtask-done {
  text-decoration: line-through;
  color: var(--text-muted);
}

.subtask-checkbox {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  accent-color: var(--emerald);
  cursor: pointer;
}

.task-reminder-countdown {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 600;
}

.task-reminder-countdown.due-soon { background: var(--amber-light); color: var(--amber); }
.task-reminder-countdown.due-past { background: var(--rose-light); color: var(--rose); }

.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid var(--border-color);
}

.task-author-info {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.task-actions-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-btn-action {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  position: relative;
}

.task-comments-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--accent);
  color: #fff;
  font-size: 0.5rem;
  font-weight: 800;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-btn-check {
  background: var(--emerald-light);
  color: var(--emerald);
}

/* Floating Action Button */
.mobile-fab-button {
  position: absolute;
  bottom: 64px;
  right: 16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: #fff;
  border: none;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
  cursor: pointer;
  z-index: 40;
  transition: var(--transition);
}

.mobile-fab-button:hover {
  transform: scale(1.08);
}

/* Native Android Bottom Navigation Bar */
.mobile-bottom-nav {
  height: 52px;
  background: var(--bg-surface-glass);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 40;
  flex-shrink: 0;
  position: relative;
}

.bottom-nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.bottom-nav-item i {
  font-size: 1.05rem;
}

.bottom-nav-item span {
  font-size: 0.62rem;
  font-weight: 600;
}

.bottom-nav-item.active {
  color: var(--accent);
}

.nav-alert-badge {
  position: absolute;
  top: 4px;
  right: 14px;
  background: var(--rose);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-alert-badge.hidden { display: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
}

.btn-block { width: 100%; }
.btn-sm { padding: 4px 8px; font-size: 0.75rem; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #4f46e5); color: #fff; }
.btn-secondary { background: var(--bg-surface-elevated); border-color: var(--border-color); color: var(--text-primary); }
.btn-outline { background: transparent; border-color: var(--border-color); color: var(--text-secondary); }
.btn-warning { background: var(--amber-light); color: var(--amber); }
.btn-success { background: var(--emerald); color: #fff; }
.btn-danger-outline { background: transparent; border-color: rgba(244, 63, 94, 0.3); color: var(--rose); }
.btn-google { background: #fff; color: #111; font-weight: 600; }

/* Theme Palette Grid (Option 4) */
.theme-palette-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.theme-pill-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.theme-pill-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.theme-pill-btn.active {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--accent-light);
}

.theme-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* Firebase Actions (Option 3) */
.firebase-quick-helper {
  background: var(--bg-surface);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.firebase-actions-row {
  display: flex;
  gap: 6px;
}

/* Voice Input Controls */
.label-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-voice-input {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--emerald);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.btn-voice-input.listening {
  background: var(--rose);
  color: #fff;
  border-color: var(--rose);
  animation: pulse-recording 1s infinite alternate;
}

@keyframes pulse-recording {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(1.08); opacity: 0.8; }
}

/* Attachment Preview Box */
.attachment-preview-box {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin-top: 4px;
}

.attachment-preview-box.hidden { display: none; }

.attachment-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-img {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.6rem;
}

/* Subtasks builder in Add Modal */
.subtask-input-builder {
  display: flex;
  gap: 6px;
}

.subtask-input-builder input {
  flex: 1;
}

.subtasks-badge-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  max-height: 100px;
  overflow-y: auto;
}

.subtask-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.subtask-chip i {
  color: var(--rose);
  cursor: pointer;
}

/* Task Comments Discussion Drawer */
.comments-task-summary {
  background: var(--bg-surface-elevated);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.comments-task-summary h4 {
  font-size: 0.85rem;
  font-weight: 700;
}

.comments-task-summary p {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.comments-flow-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 0;
}

.comment-bubble-row {
  display: flex;
  gap: 8px;
  font-size: 0.76rem;
}

.comment-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
}

.comment-bubble {
  flex: 1;
  background: var(--bg-surface-elevated);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.comment-author-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}

.comment-time {
  font-size: 0.6rem;
  color: var(--text-muted);
  float: right;
}

.comment-input-bar {
  display: flex;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-color);
}

.comment-input-bar input {
  flex: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.78rem;
  outline: none;
}

/* Image Viewer Modal */
.modal-card-image {
  max-width: 90%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  margin: auto;
}

.image-viewer-body img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
}

/* Audio & Volume Settings */
.custom-audio-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.custom-audio-box label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.file-input-field {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.volume-slider-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.volume-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 600;
}

.styled-range-slider {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.apk-guide-actions {
  display: flex;
  gap: 6px;
}

/* History & PDF Export Styles */
.history-export-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.history-list-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-tasks-flow {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.history-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.history-task-item h5 {
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: line-through;
  color: var(--text-secondary);
}

.history-task-item p {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Groups & Exploration Styling */
.join-nav-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-surface-elevated);
  padding: 4px;
  border-radius: var(--radius-md);
}

.join-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.join-tab-btn.active {
  background: var(--accent);
  color: #fff;
}

.join-tab-panel.hidden { display: none; }

.group-explore-search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  margin-top: 6px;
}

.group-explore-search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.8rem;
  width: 100%;
}

.explore-groups-list-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 230px;
  overflow-y: auto;
  margin-top: 4px;
}

.explore-group-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  gap: 8px;
}

.explore-group-info {
  flex: 1;
  min-width: 0;
}

.explore-group-info h4 {
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.explore-group-info p {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-actions-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pending-requests-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 8px;
  margin-bottom: 6px;
}

.pending-requests-box.hidden { display: none; }

.pending-requests-list-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  max-height: 120px;
  overflow-y: auto;
}

.pending-request-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
}

.pending-request-actions {
  display: flex;
  gap: 4px;
}

/* Groups Bottom Sheet Elements */
.sheet-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.sheet-user-card img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.drawer-user-info {
  flex: 1;
  min-width: 0;
}

.drawer-user-info h4 {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-switch-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.sheet-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.groups-sheet-list-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sheet-groups-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}

/* Group Item */
.group-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  cursor: pointer;
  border: 1px solid var(--border-color);
}

.group-nav-item.active {
  background: var(--accent-light);
  border-color: var(--border-focus);
}

.group-nav-icon {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
}

.group-nav-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.group-nav-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-nav-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Helper text */
.helper-text {
  font-size: 0.68rem;
  color: var(--accent);
  margin-top: 2px;
  display: block;
}

/* ================= MODALS ================= */
.modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.modal-backdrop.hidden { display: none; }

.modal-card.modal-bottom-sheet {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 88%;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: slide-up 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
}

@keyframes slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

.modal-head h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.form-group label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.req { color: var(--rose); }

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 6px 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  outline: none;
}

.color-picker-grid {
  display: flex;
  gap: 6px;
}

.color-chip input { display: none; }
.color-chip span {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
}
.color-chip input:checked + span {
  transform: scale(1.15);
  border-color: #fff;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

/* Settings Sections */
.settings-sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-group {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-group h4 {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.setting-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.setting-item-row p {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.settings-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* Alarm Ringing Popup */
.modal-card-alarm {
  border-radius: var(--radius-lg);
  margin: auto 12px;
  text-align: center;
  padding: 20px 14px;
  background: linear-gradient(180deg, #1e1b4b, var(--bg-surface));
  border: 2px solid var(--accent);
  width: 90%;
}

.alarm-visual-wave {
  position: relative;
  width: 60px;
  height: 60px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alarm-center-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--amber));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
}

.alarm-group-badge {
  font-size: 0.68rem;
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.alarm-content-center h2 {
  font-size: 1rem;
  font-weight: 800;
  margin-top: 4px;
}

.alarm-notes {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.alarm-time-display {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--amber);
  margin: 6px 0 12px;
}

.alarm-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Toast */
.toast-container {
  position: absolute;
  bottom: 60px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
}
.toast.success { border-color: var(--emerald); color: var(--emerald); }
.toast.info { border-color: var(--accent); color: var(--accent); }
.toast.warning { border-color: var(--amber); color: var(--amber); }

/* Members list */
.group-share-box {
  background: var(--bg-surface-elevated);
  padding: 8px;
  border-radius: var(--radius-sm);
}

.group-share-box label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 2px;
}

.copy-input-row { display: flex; gap: 6px; }
.copy-input-row input { flex: 1; background: var(--bg-main); border: 1px solid var(--border-color); padding: 5px 8px; border-radius: var(--radius-sm); font-family: monospace; color: var(--accent); font-weight: 700; font-size: 0.85rem; }
.members-list-grid { display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow-y: auto; }
.member-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; background: var(--bg-surface-elevated); border-radius: var(--radius-sm); font-size: 0.78rem; }
.member-left { display: flex; align-items: center; gap: 6px; }
.member-avatar { width: 24px; height: 24px; border-radius: 50%; }

/* Empty state */
.empty-state { text-align: center; padding: 24px 10px; }
.empty-illustration { font-size: 2.2rem; color: var(--accent); margin-bottom: 6px; }
.empty-state h3 { font-size: 0.92rem; font-weight: 700; }
.empty-state p { font-size: 0.74rem; color: var(--text-muted); }
