/* ViajeShare - Responsive + Temas */

:root {
  --brand: #0f766e;
  --brand-50: #f0fdfa;
  --brand-100: #ccfbf1;
  --brand-200: #99f6e4;
  --brand-600: #0d9488;
  --brand-700: #0f766e;
  --brand-800: #115e59;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --danger: #dc2626;
  --success: #16a34a;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: #334155;
  --brand-50: #134e4a;
  --brand-100: #115e59;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  transition: background 0.25s, color 0.25s;
}

.app-view { display: none; }
.app-view.active { display: block; }

.theme-card {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
}

.demo-tab, .app-tab {
  color: var(--muted);
  transition: all 0.2s;
}
.demo-tab:hover, .app-tab:hover { color: var(--brand); background: var(--brand-50); }
.demo-tab.active, .app-tab.active {
  color: var(--brand);
  border-bottom: 3px solid var(--brand);
  background: var(--brand-50);
}

.admin-tab-btn.active {
  background: var(--brand-100) !important;
  color: var(--brand-800) !important;
}

.stat-bar {
  height: 8px;
  border-radius: 9999px;
  background: var(--border);
  overflow: hidden;
}
.stat-bar > div {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #14b8a6, var(--brand));
  transition: width 0.6s ease;
}

#toast.show { animation: toastIn 0.3s ease forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

#admin-modal.show, #auth-modal.show, #profile-modal.show { display: flex !important; }

#btn-install.pulse {
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(13, 148, 136, 0); }
}

.report-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.report-table th, .report-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.report-table th { background: var(--brand-50); font-weight: 600; color: var(--muted); }

.color-swatch {
  width: 2rem; height: 2rem;
  border-radius: 9999px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active { border-color: var(--text); transform: scale(1.15); }

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.bottom-nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.65rem;
  color: var(--muted);
  padding: 0.35rem;
  background: none;
  border: none;
}
.bottom-nav button.active { color: var(--brand); font-weight: 600; }
.bottom-nav button span.icon { font-size: 1.25rem; }

@supports (padding: env(safe-area-inset-bottom)) {
  .pb-safe { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
}

.propina-box {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fbbf24;
  border-radius: 1rem;
  padding: 1rem;
}
[data-theme="dark"] .propina-box {
  background: linear-gradient(135deg, #422006, #78350f);
  border-color: #b45309;
}

.rate-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  background: var(--brand-100);
  color: var(--brand-800);
  font-weight: 600;
}

@media (max-width: 640px) {
  .demo-tab, .app-tab { font-size: 0.7rem; padding-left: 0.4rem; padding-right: 0.4rem; }
  .bottom-nav { display: flex; }
  .hide-mobile { display: none !important; }
  main, .app-content { padding-bottom: 4.5rem; }
  .nav-desktop { display: none !important; }
}

@media (min-width: 641px) {
  .bottom-nav { display: none !important; }
}

@media print {
  body * { visibility: hidden; }
  #demo-reporte, #demo-reporte *, #app-reporte, #app-reporte * { visibility: visible; }
  #demo-reporte, #app-reporte { position: absolute; left: 0; top: 0; width: 100%; }
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #475569; }