/* ============================================
   Olika App-Like — Mobile Native UI Utilities
   Skill: mobile-app-like-web
   ============================================ */

/* === Safe Area para notches iPhones === */
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* === Animation Delay Utilities === */
.animation-delay-150 { animation-delay: 0.15s; }
.animation-delay-300 { animation-delay: 0.3s; }
.pt-safe {
  padding-top: env(safe-area-inset-top, 0px);
}
.pl-safe {
  padding-left: env(safe-area-inset-left, 0px);
}
.pr-safe {
  padding-right: env(safe-area-inset-right, 0px);
}

/* === Touch Feedback refinado === */
.touch-app:active {
  transform: scale(0.97);
  opacity: 0.85;
  transition: transform 0.1s ease, opacity 0.1s ease;
}
.touch-app-light:active {
  opacity: 0.7;
  transition: opacity 0.1s ease;
}

/* === Bottom Tab Glassmorphism === */
.tab-bar-glass {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-top: 1px solid rgba(226, 106, 44, 0.08);
}
.dark .tab-bar-glass {
  background: rgba(30, 41, 59, 0.85);
  border-top-color: rgba(71, 85, 105, 0.3);
}

/* === Sheet Modal (Bottom Sheet) === */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.sheet-content {
  width: 100%;
  max-width: 28rem;
  background: var(--card, #fff);
  border-radius: 1.25rem 1.25rem 0 0;
  padding: 1.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12);
  max-height: 85vh;
  overflow-y: auto;
  animation: sheet-slide-up 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.dark .sheet-content {
  background: #1e293b;
}
@media (min-width: 640px) {
  .sheet-overlay {
    padding: 1rem;
    align-items: center;
  }
  .sheet-content {
    border-radius: 1.25rem;
    padding: 1.5rem;
  }
}
.sheet-handle {
  width: 2.5rem;
  height: 4px;
  border-radius: 9999px;
  background: #d1d5db;
  margin: 0 auto 1rem;
}
.dark .sheet-handle {
  background: #4b5563;
}
@keyframes sheet-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* === Card Nativo (Material-style) === */
.card-nativo {
  background: var(--card, #fff);
  border: 1px solid var(--border, #ece9e4);
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  padding: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
@media (min-width: 768px) {
  .card-nativo {
    padding: 1.25rem;
  }
}
.card-nativo:active {
  transform: scale(0.98);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.dark .card-nativo {
  background: #1e293b;
  border-color: #334155;
}

/* === List Item Nativo === */
.list-item-nativo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  min-height: 56px;
  background: var(--card, #fff);
  border-bottom: 1px solid var(--border, #ece9e4);
  cursor: pointer;
  transition: background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.list-item-nativo:active {
  background: rgba(0, 0, 0, 0.03);
}
.dark .list-item-nativo {
  background: #1e293b;
  border-bottom-color: #334155;
}
.dark .list-item-nativo:active {
  background: rgba(255, 255, 255, 0.03);
}

/* === Status Bar Fictícia === */
.status-bar {
  height: env(safe-area-inset-top, 0px);
  min-height: 20px;
  background: var(--card, #fff);
}
.dark .status-bar {
  background: #0f172a;
}

/* === Header App-Like === */
.header-app {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border, #ece9e4);
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
}
.dark .header-app {
  background: rgba(15, 23, 42, 0.88);
  border-bottom-color: #334155;
}

/* === Status Dot (indicador online/offline) === */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot--online { background: #22c55e; }
.status-dot--offline { background: #9ca3af; }
.status-dot--warning { background: #f59e0b; }

/* === Scroll App-Like (nativo) === */
.scroll-app {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

/* === Badge Contador (iOS-style) === */
.badge-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9999px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--card, #fff);
}

/* === Transição de página === */
.page-enter {
  transform: translateX(100%);
}
.page-enter-active {
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.page-exit {
  transform: translateX(0);
}
.page-exit-active {
  transform: translateX(-30%);
  opacity: 0.5;
  transition: transform 0.25s, opacity 0.25s;
}

/* === Skeleton refinado === */
.skeleton-app {
  background: linear-gradient(90deg,
    var(--border, #ece9e4) 25%,
    rgba(255,255,255,0.4) 50%,
    var(--border, #ece9e4) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: 0.75rem;
}
.dark .skeleton-app {
  background: linear-gradient(90deg,
    #334155 25%,
    rgba(255,255,255,0.06) 50%,
    #334155 75%
  );
  background-size: 200% 100%;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Empty State App-Like === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}
.empty-state__icon {
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  background: rgba(226, 106, 44, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--brand, #E26A2C);
  margin-bottom: 0.75rem;
}
.empty-state__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--foreground, #2A2620);
  margin-bottom: 0.25rem;
}
.empty-state__desc {
  font-size: 0.8125rem;
  color: #7B736A;
  max-width: 18rem;
}

/* === Filtro Tag Scrollável (iOS-style) === */
.filter-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-tag {
  min-height: 36px;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border, #ece9e4);
  background: var(--card, #fff);
  color: #7B736A;
  transition: all 0.15s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.filter-tag:active { transform: scale(0.95); }
.filter-tag--active {
  background: var(--brand, #E26A2C);
  color: #fff;
  border-color: var(--brand, #E26A2C);
}
.dark .filter-tag {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}
.dark .filter-tag--active {
  background: var(--brand, #E26A2C);
  color: #fff;
  border-color: var(--brand, #E26A2C);
}

/* === Avatar soft background (substitui color-mix inline) === */
.avatar-soft {
  background: color-mix(in srgb, var(--brand, #E26A2C) 10%, transparent);
  color: var(--brand, #E26A2C);
}
.dark .avatar-soft {
  background: color-mix(in srgb, var(--brand, #E26A2C) 18%, transparent);
  color: var(--brand, #E26A2C);
}

/* === Badge do sistema com cor dinâmica === */
.badge-status {
  padding: 0.125rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* === FAB (Floating Action Button) estilo Android === */
.olika-fab {
  position: fixed;
  bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  right: 1rem;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--brand, #E26A2C);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(226, 106, 44, 0.35);
  z-index: 50;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-size: 1.25rem;
}
.olika-fab:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(226, 106, 44, 0.25);
}
@media (min-width: 768px) {
  .olika-fab {
    bottom: 1.5rem;
    right: 1.5rem;
  }
}

/* === Header voltar + título centralizado (Android-style) === */
.header-voltar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0 0.5rem;
}
.header-voltar__btn {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: var(--foreground, #2A2620);
  transition: background 0.12s ease;
}
.header-voltar__btn:active {
  background: rgba(0,0,0,0.06);
}
.dark .header-voltar__btn:active {
  background: rgba(255,255,255,0.06);
}
.header-voltar__titulo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground, #2A2620);
  flex: 1;
}

/* === Seção agrupada (Android Settings-style) === */
.section-group {
  margin-bottom: 0.75rem;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--card, #fff);
  border: 1px solid var(--border, #ece9e4);
}
.dark .section-group {
  background: #1e293b;
  border-color: #334155;
}
.section-group__header {
  padding: 0.875rem 1rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground, #7B736A);
}
.section-group__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  min-height: 56px;
  border-top: 1px solid var(--border, #ece9e4);
  cursor: pointer;
  transition: background 0.12s ease;
}
.section-group__row:active {
  background: rgba(0,0,0,0.03);
}
.dark .section-group__row {
  border-top-color: #334155;
}
.dark .section-group__row:active {
  background: rgba(255,255,255,0.03);
}

/* === Input App-Like === */
.input-app {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1.5px solid var(--border, #ece9e4);
  background: var(--card, #fff);
  font-size: 16px;
  color: var(--foreground, #2A2620);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-app:focus {
  border-color: var(--brand, #E26A2C);
  box-shadow: 0 0 0 3px rgba(226, 106, 44, 0.12);
}
.input-app::placeholder {
  color: #9ca3af;
}
.dark .input-app {
  background: #1e293b;
  border-color: #475569;
  color: #f1f5f9;
}
.dark .input-app:focus {
  border-color: var(--brand, #E26A2C);
  box-shadow: 0 0 0 3px rgba(226, 106, 44, 0.2);
}

/* === Select App-Like (custom dropdown estilo CodingNepal) === */
.select-app {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1.5px solid var(--border, #ece9e4);
  background: var(--card, #fff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 0.75rem center;
  font-size: 16px;
  color: var(--foreground, #2A2620);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.select-app:focus {
  border-color: var(--brand, #E26A2C);
  box-shadow: 0 0 0 3px rgba(226, 106, 44, 0.12);
}
.select-app:hover {
  border-color: #d1d5db;
}
.dark .select-app {
  background-color: #1e293b;
  border-color: #475569;
  color: #f1f5f9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
.dark .select-app:focus {
  border-color: var(--brand, #E26A2C);
  box-shadow: 0 0 0 3px rgba(226, 106, 44, 0.2);
}

/* === Custom Combobox (CodingNepal-style) === */
.combo-wrapper {
  position: relative;
  width: 100%;
}
.combo-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1.5px solid var(--border, #ece9e4);
  background: var(--card, #fff);
  font-size: 16px;
  color: var(--foreground, #2A2620);
  cursor: pointer;
  text-align: left;
  gap: 0.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.combo-trigger:hover {
  border-color: #d1d5db;
}
.combo-trigger:focus-visible {
  border-color: var(--brand, #E26A2C);
  box-shadow: 0 0 0 3px rgba(226, 106, 44, 0.12);
  outline: none;
}
.dark .combo-trigger {
  background: #1e293b;
  border-color: #475569;
  color: #f1f5f9;
}
.combo-trigger i {
  transition: transform 0.3s ease;
  font-size: 12px;
  color: #9ca3af;
}
.combo-trigger i.rotate-180 {
  transform: rotate(-180deg);
}
.combo-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--card, #fff);
  border: 1px solid var(--border, #ece9e4);
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  padding: 0.5rem;
  max-height: 240px;
  overflow-y: auto;
}
.combo-dropdown--open {
  display: block;
}
.dark .combo-dropdown {
  background: #1e293b;
  border-color: #475569;
}
.combo-search {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border, #ece9e4);
  background: transparent;
  font-size: 14px;
  color: var(--foreground, #2A2620);
  outline: none;
  margin-bottom: 0.25rem;
}
.combo-search:focus {
  border-color: var(--brand, #E26A2C);
}
.dark .combo-search {
  border-color: #475569;
  color: #f1f5f9;
}
.combo-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--foreground, #2A2620);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  border: none;
  transition: background 0.12s ease;
}
.combo-item:hover {
  background: #f3f4f6;
}
.combo-item--active {
  background: rgba(226, 106, 44, 0.08);
  color: var(--brand, #E26A2C);
  font-weight: 600;
}
.dark .combo-item:hover {
  background: #334155;
}
.dark .combo-item--active {
  background: rgba(226, 106, 44, 0.15);
}
.combo-empty {
  padding: 1rem;
  text-align: center;
  font-size: 13px;
  color: #9ca3af;
}


