/* Customer Web Application & PWA Stylesheet */

.app-wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem 6rem;
}

/* App Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.4rem;
  margin-bottom: 1.5rem;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
}

.sync-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
}

.sync-status-badge.online {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.sync-status-badge.offline {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  background: rgba(18, 24, 38, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 0.35rem;
  margin-bottom: 2rem;
  gap: 0.3rem;
  overflow-x: auto;
}

.tab-btn {
  flex: 1;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: var(--transition-smooth);
}

.tab-btn:hover {
  color: #ffffff;
}

.tab-btn.active {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.35);
}

/* Tab Content Panes */
.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Entry Form Cards */
.entry-card {
  padding: 1.8rem;
  margin-bottom: 1.5rem;
}

.section-label {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Tag Selector System */
.tag-category-group {
  margin-bottom: 1.2rem;
}

.tag-category-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 0.6rem;
}

.tag-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-pill {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-spring);
  user-select: none;
}

.tag-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.tag-pill.selected {
  background: rgba(236, 72, 153, 0.2);
  border-color: var(--primary-pink);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.3);
}

/* Period Flow Options */
.flow-options-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
}

.flow-btn {
  padding: 0.8rem 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: var(--transition-spring);
  font-family: var(--font-main);
  font-size: 0.8rem;
}

.flow-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.flow-btn.selected {
  background: rgba(244, 63, 94, 0.25);
  border-color: #f43f5e;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.35);
}

/* Note inputs */
.note-input-title {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 1rem;
  font-family: var(--font-main);
  font-weight: 600;
  margin-bottom: 0.8rem;
  outline: none;
}

.note-input-body {
  width: 100%;
  min-height: 90px;
  padding: 0.8rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.95rem;
  font-family: var(--font-main);
  outline: none;
  resize: vertical;
}

/* History Timeline Entry Item */
.history-entry-item {
  padding: 1.2rem;
  background: rgba(18, 24, 38, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: var(--transition-smooth);
}

.history-entry-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}

.history-entry-mood {
  font-size: 2rem;
}

.history-entry-content {
  flex: 1;
}

.history-entry-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

/* AI Insights Dashboard */
.ai-metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ai-metric-card {
  padding: 1.2rem;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-md);
  text-align: center;
}

.ai-metric-val {
  font-size: 2rem;
  font-weight: 800;
  color: #c084fc;
}

/* Bottom Bar on Mobile */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(9, 13, 22, 0.92);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-around;
  padding: 0.6rem 0.5rem;
  z-index: 99;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: var(--font-main);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.mobile-nav-item.active {
  color: var(--primary-pink);
  font-weight: 700;
}

.mobile-nav-icon {
  font-size: 1.25rem;
}

@media (min-width: 769px) {
  .mobile-bottom-nav {
    display: none;
  }
}
