/* PWA App Styles - FEET Corporate Design System */
/* Brand: #009da3 | Shadows: soft | Radius: 12px | Backgrounds: rgba 8% */

:root {
  --brand: #009da3;
  --brand-light: #00A7B3;
  --brand-dark: #008a90;
  --brand-bg: rgba(0, 157, 163, 0.08);
  --brand-border: rgba(0, 157, 163, 0.2);
  --text-primary: #2c3e50;
  --text-secondary: #6c757d;
  --success: #10ca93;
  --danger: #f25767;
  --warning: #ff9f00;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* Prevent overscroll/bounce on iOS */
html, body {
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

/* Safe area insets for notched phones */
body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  color: var(--text-primary);
}

/* Cards - matching dashboard widget style */
.pwa-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: none;
  transition: all 0.2s ease;
}
.pwa-card:hover {
  box-shadow: var(--shadow-md);
}
.pwa-card-header {
  padding: 16px 20px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  border: none;
}

/* Stat cards - like dashboard stat widgets */
.stat-card {
  padding: 12px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.stat-card.brand {
  background: var(--brand-bg);
  border: 1px solid var(--brand-border);
}
.stat-card.success {
  background: rgba(16, 202, 147, 0.08);
  border: 1px solid rgba(16, 202, 147, 0.2);
}
.stat-card.danger {
  background: rgba(242, 87, 103, 0.08);
  border: 1px solid rgba(242, 87, 103, 0.2);
}
.stat-card.warning {
  background: rgba(255, 159, 0, 0.08);
  border: 1px solid rgba(255, 159, 0, 0.2);
}

/* Badges - matching dashboard badge style */
.pwa-badge {
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
}
.pwa-badge.brand {
  background: var(--brand-bg);
  border: 1px solid var(--brand-border);
  color: var(--brand-light);
}
.pwa-badge.success {
  background: rgba(16, 202, 147, 0.08);
  border: 1px solid rgba(16, 202, 147, 0.2);
  color: var(--success);
}
.pwa-badge.warning {
  background: rgba(255, 159, 0, 0.08);
  border: 1px solid rgba(255, 159, 0, 0.2);
  color: var(--warning);
}
.pwa-badge.neutral {
  background: rgba(108, 117, 125, 0.08);
  border: 1px solid rgba(108, 117, 125, 0.2);
  color: var(--text-secondary);
}

/* Buttons - matching dashboard outline style */
.pwa-btn {
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pwa-btn:active {
  transform: scale(0.98);
}
.pwa-btn-brand {
  background: var(--brand);
  color: #fff;
}
.pwa-btn-brand:hover {
  background: var(--brand-dark);
}
.pwa-btn-outline {
  background: transparent;
  border: 1px solid var(--brand-border);
  color: var(--brand);
}
.pwa-btn-outline:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* PIN keypad styles */
.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  transition: all 0.15s ease;
}
.pin-dot.filled {
  background-color: #fff;
  border-color: #fff;
}

.keypad-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.keypad-btn:active {
  background: rgba(255,255,255,0.25);
  transform: scale(0.95);
}
.keypad-btn-action {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
}

/* Sidebar navigation */
.sidebar-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 50;
  pointer-events: none;
  transition: background 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-overlay.open {
  background: rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  max-width: 85vw;
  height: 100%;
  height: 100dvh;
  background: #fff;
  z-index: 51;
  -webkit-transform: translateX(-100%);
  transform: translateX(-100%);
  -webkit-transition: transform 0.3s ease;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0);
  visibility: hidden;
}
.sidebar.open {
  -webkit-transform: translateX(0);
  transform: translateX(0);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  visibility: visible;
}
.sidebar-link {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  color: #4a5568;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-link:active {
  background: #f7fafc;
}
.sidebar-link.active {
  color: var(--brand);
  background: var(--brand-bg);
}
.sidebar-link-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

/* Progress bar animation */
.progress-bar {
  transition: width 0.5s ease-in-out;
}

/* Toast notifications */
.toast {
  animation: slideUp 0.3s ease-out;
  border-radius: 12px;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Slide animations for help carousel */
.slide-enter {
  animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Chart containers */
.chart-container {
  position: relative;
  width: 100%;
  height: 200px;
}

/* Spinner */
.spinner {
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 0.8s linear infinite;
}
.spinner-brand {
  border: 3px solid var(--brand-bg);
  border-top-color: var(--brand);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Offline banner */
.offline-banner {
  display: none;
}
body.is-offline .offline-banner {
  display: flex;
}

/* Entry list item */
.entry-item {
  border-left: 3px solid;
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  background: #fafbfc;
}
.entry-item:hover {
  background: rgba(0, 167, 179, 0.04);
}
.entry-item.working {
  border-left-color: var(--success);
}
.entry-item.finished {
  border-left-color: #cbd5e1;
}

/* Input fields - matching dashboard */
.pwa-input {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.2s ease;
  background: #fff;
  width: 100%;
}
.pwa-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-bg);
}
.pwa-input::placeholder {
  color: #a0aec0;
}

/* Textarea */
.pwa-textarea {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.2s ease;
  background: #fff;
  width: 100%;
  resize: none;
}
.pwa-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-bg);
}

/* Absence cards - colored left border by status */
.absence-card {
  border-left: 3px solid;
  border-radius: 0 12px 12px 0;
  transition: all 0.2s ease;
}
.absence-card:active {
  transform: scale(0.98);
}
.absence-card-pending {
  border-left-color: var(--warning);
}
.absence-card-approved {
  border-left-color: var(--success);
}
.absence-card-denied {
  border-left-color: var(--danger);
}

/* Badge - danger variant */
.pwa-badge.danger {
  background: rgba(242, 87, 103, 0.08);
  border: 1px solid rgba(242, 87, 103, 0.2);
  color: var(--danger);
}

/* Filter pills */
.absence-filter-pill {
  background: rgba(108, 117, 125, 0.08);
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.absence-filter-pill.active {
  background: var(--brand-bg);
  color: var(--brand);
  border-color: var(--brand-border);
}

/* Modal slide-up animation */
.pwa-modal-slide {
  animation: modalSlideUp 0.3s ease-out;
}
@keyframes modalSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* History timeline */
.history-timeline {
  position: relative;
  padding-left: 20px;
}
.history-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #e2e8f0;
  border-radius: 1px;
}
.history-item {
  position: relative;
  padding-bottom: 12px;
}
.history-item:last-child {
  padding-bottom: 0;
}
.history-dot {
  position: absolute;
  left: -17px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--brand-border);
}
.history-content {
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 8px;
}

/* FullCalendar mobile overrides */
#fullcalendar .fc-header-toolbar {
  margin-bottom: 8px !important;
}
#fullcalendar .fc-toolbar-title {
  font-size: 14px !important;
  font-weight: 600 !important;
  text-transform: capitalize;
}
#fullcalendar .fc-button {
  background: var(--brand-bg) !important;
  border: 1px solid var(--brand-border) !important;
  color: var(--brand) !important;
  border-radius: 8px !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
}
#fullcalendar .fc-button:hover {
  background: var(--brand) !important;
  color: #fff !important;
}
#fullcalendar .fc-list-event-title {
  font-size: 13px !important;
}
#fullcalendar .fc-list-event-time {
  font-size: 11px !important;
}
#fullcalendar .fc-list-day-cushion {
  background: #f8fafc !important;
  padding: 6px 10px !important;
}
#fullcalendar .fc-list-day-text,
#fullcalendar .fc-list-day-side-text {
  font-size: 12px !important;
  font-weight: 600 !important;
}

/* No scrollbar utility */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Entry day cards - colored left border by type */
.entry-day-card {
  border-left: 3px solid #cbd5e1;
  border-radius: 0 12px 12px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.entry-day-card:active {
  transform: scale(0.98);
}
.entry-day-card-worked {
  border-left-color: var(--success);
}
.entry-day-card-holiday {
  border-left-color: #e74c3c;
}
.entry-day-card-absence {
  border-left-color: var(--brand);
}
.entry-day-card-rest {
  border-left-color: #cbd5e1;
}
.entry-day-card-future {
  border-left-color: #e2e8f0;
  cursor: default;
}
.entry-day-card-incomplete {
  border-left-color: var(--warning);
}

/* Difference colors */
.diff-positive { color: var(--success); }
.diff-negative { color: var(--danger); }

/* Document cards */
.doc-card {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.doc-card:active {
  transform: scale(0.98);
}

/* No underline on action links */
a.no-underline {
  text-decoration: none;
}

/* Brand-50 helper for Tailwind */
.bg-brand-50 { background: rgba(0, 157, 163, 0.05); }
.border-brand-200 { border-color: rgba(0, 157, 163, 0.2); }

/* PWA Install Banner */
.install-banner {
  position: fixed;
  bottom: 16px;
  left: 8px;
  right: 8px;
  z-index: 45;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  padding: 14px 16px;
  animation: installSlideUp 0.35s ease-out;
}
.install-banner.hidden {
  display: none;
}
@keyframes installSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.install-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--brand-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.install-banner-icon svg {
  width: 24px;
  height: 24px;
  color: var(--brand);
}
.install-banner-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}
.install-banner-btn:active {
  background: var(--brand-dark);
  transform: scale(0.97);
}
.install-banner-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.05);
  border: none;
  cursor: pointer;
  color: #999;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.install-banner-close:active {
  background: rgba(0,0,0,0.1);
}
.ios-share-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin: 0 2px;
}

/* Help center styles */
.help-section {
  overflow: hidden;
  transition: all 0.2s ease;
}
.help-section-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}
.help-section-content.expanded {
  max-height: 3000px;
  transition: max-height 0.5s ease-in;
}
.help-section-chevron {
  transition: transform 0.2s ease;
}
.help-section-chevron.rotated {
  transform: rotate(180deg);
}
.help-nav-item {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s ease;
}
.help-nav-item:active {
  transform: scale(0.95);
}
.help-search {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px 10px 40px;
  font-size: 14px;
  width: 100%;
  transition: all 0.2s ease;
}
.help-search:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-bg);
}
.help-color-chip {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 6px;
}
.help-item {
  transition: all 0.2s ease;
}
.help-goto-btn {
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.help-goto-btn:active {
  transform: scale(0.98);
  opacity: 0.8;
}
