/* ============================================
   TrExOra — App Preview Styles
   ============================================ */

/* ---------- Page Layout ---------- */
.preview-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(0, 71, 255, 0.08), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(0, 71, 255, 0.06), transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(0, 71, 255, 0.1), transparent 50%);
  background-size: 200% 200%;
  animation: bgMeshFloat 15s ease infinite alternate;
}

@keyframes bgMeshFloat {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 100%; }
  100% { background-position: 50% 0%; }
}

.preview-page canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

/* Back Button */
.preview-back {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 9999px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  backdrop-filter: blur(12px);
}
.preview-back:hover {
  background: rgba(0, 71, 255,0.15);
  color: var(--accent);
  border-color: var(--accent);
  transform: translateX(-3px);
}

/* Preview Mode Badge */
.preview-mode-badge {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 71, 255,0.12);
  border: 1px solid rgba(0, 71, 255,0.3);
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.preview-mode-badge .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-glow 2s infinite;
}

/* ---------- Phone Mockup ---------- */
.phone-frame {
  position: relative;
  z-index: 10;
  width: 375px;
  height: 812px;
  background: var(--bg-primary);
  border-radius: 54px;
  border: 8px solid #ffffff;
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.05),
    0 0 0 2px rgba(200, 205, 215, 0.5),
    0 30px 60px rgba(0, 71, 255, 0.15),
    0 0 100px rgba(0, 71, 255, 0.1);
  overflow: hidden;
  animation: phoneSlideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.phone-frame::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 44px;
  box-shadow: inset 0 0 20px rgba(0, 71, 255, 0.08);
  pointer-events: none;
  z-index: 90;
}

@keyframes phoneSlideUp {
  from { opacity: 0; transform: translateY(60px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Notch */
.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 32px;
  background: var(--bg-primary);
  border-radius: 0 0 20px 20px;
  z-index: 50;
}

/* Status Bar */
.phone-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-primary);
  position: relative;
  z-index: 40;
  height: 44px;
}
.phone-status-bar .status-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Screen Area */
.phone-screen {
  position: relative;
  height: calc(100% - 44px - 72px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.phone-screen::-webkit-scrollbar { display: none; }

/* Module Pages Container */
.module-pages {
  position: relative;
  width: 100%;
  height: 100%;
}

.module-page {
  position: absolute;
  inset: 0;
  padding: 16px;
  opacity: 0;
  transform: translateX(30px);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  scrollbar-width: none;
}
.module-page::-webkit-scrollbar { display: none; }

.module-page.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}
.module-page.exit-left {
  opacity: 0;
  transform: translateX(-30px);
}

/* ---------- Bottom Navigation ---------- */
.phone-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: rgba(255, 248, 231, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(24, 27, 39, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  z-index: 30;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  background: none;
  position: relative;
}

.nav-tab svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 1.8;
  transition: all 0.25s ease;
}

.nav-tab span {
  font-size: 0.58rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.25s ease;
}

.nav-tab.active svg {
  stroke: var(--accent);
  filter: drop-shadow(0 0 6px rgba(0, 71, 255, 0.4));
}
.nav-tab.active span {
  color: var(--accent);
  font-weight: 600;
}
.nav-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 4px 4px;
}

/* ---------- Common Module Styles ---------- */
.mod-header {
  margin-bottom: 16px;
}
.mod-header h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.mod-header p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.mod-card {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}
.mod-card:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 71, 255, 0.2);
}

.mod-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.mod-chip:hover, .mod-chip.active {
  background: rgba(0, 71, 255,0.15);
  border-color: rgba(0, 71, 255, 0.3);
  color: var(--accent);
}

/* Staggered animations */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

.fade-in-card {
  animation: fadeInCard 0.5s ease both;
}
@keyframes fadeInCard {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- HOME MODULE ---------- */
.home-greeting {
  padding: 20px 16px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(0, 71, 255,0.12), rgba(0, 71, 255,0.06));
  border: 1px solid rgba(0, 71, 255,0.15);
  margin-bottom: 16px;
  text-align: center;
}
.home-greeting .location-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.home-greeting .location-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.home-greeting .greeting-text {
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: 8px;
  font-weight: 500;
}

.home-weather {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
}
.home-weather .temp {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}
.home-weather .condition {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.home-weather .weather-icon {
  font-size: 2rem;
}

/* Module Grid */
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.module-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.module-tile:hover {
  background: rgba(0, 71, 255,0.1);
  border-color: rgba(0, 71, 255, 0.2);
  transform: translateY(-2px);
}
.module-tile .tile-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.module-tile .tile-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.tile-translate .tile-icon { background: rgba(0, 71, 255,0.15); }
.tile-navigate .tile-icon { background: rgba(16,185,129,0.15); }
.tile-safety .tile-icon { background: rgba(239,68,68,0.15); }
.tile-explore .tile-icon { background: rgba(245,158,11,0.15); }
.tile-budget .tile-icon { background: rgba(139,92,246,0.15); }
.tile-community .tile-icon { background: rgba(0, 71, 255,0.15); }

/* ---------- TRANSLATE MODULE ---------- */
.translate-panel {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}
.translate-panel label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.translate-panel .lang-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.translate-panel .text-content {
  font-size: 1.1rem;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 40px;
}
.translate-swap {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}
.translate-swap button {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(0, 71, 255,0.15);
  border: 1px solid rgba(0, 71, 255,0.3);
  color: var(--accent);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.translate-swap button:hover {
  background: rgba(0, 71, 255,0.3);
  transform: rotate(180deg);
}

.phrase-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

/* ---------- NAVIGATE MODULE ---------- */
.map-container {
  width: 100%;
  height: 200px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #1a1a2e;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.map-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7) saturate(1.2);
}
.map-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  padding: 10px 14px;
  background: rgba(255, 248, 231, 0.9);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.map-overlay .location-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}
.map-overlay .location-coords {
  font-size: 0.6rem;
  color: var(--text-muted);
}

.poi-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.poi-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  transition: all 0.2s ease;
}
.poi-item:hover {
  background: rgba(0, 0, 0, 0.04);
}
.poi-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.poi-info { flex: 1; }
.poi-info .poi-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}
.poi-info .poi-dist {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ---------- SAFETY MODULE ---------- */
.safety-score-ring {
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.safety-score-ring svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}
.safety-score-ring .score-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: #10B981;
}
.safety-score-ring .score-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: block;
  text-align: center;
}

.sos-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #EF4444, #DC2626);
  border: none;
  border-radius: 16px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 16px;
  animation: sosPulse 2s infinite;
  box-shadow: 0 0 30px rgba(239,68,68,0.3);
}
@keyframes sosPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(239,68,68,0.3); }
  50% { box-shadow: 0 0 40px rgba(239,68,68,0.5); }
}

.emergency-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  margin-bottom: 8px;
}
.emergency-item .em-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.emergency-item .em-number {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

/* ---------- EXPLORE MODULE ---------- */
.explore-categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.explore-categories::-webkit-scrollbar { display: none; }

.explore-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 14px;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}
.explore-card:hover {
  background: rgba(0, 0, 0, 0.04);
}
.explore-card .explore-emoji {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(245,158,11,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.explore-card .explore-info { flex: 1; }
.explore-card .explore-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}
.explore-card .explore-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.explore-card .explore-rating {
  font-size: 0.7rem;
  color: #F59E0B;
  margin-top: 4px;
}

/* ---------- BUDGET MODULE ---------- */
.budget-summary {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(0, 71, 255,0.06));
  border: 1px solid rgba(139,92,246,0.15);
  border-radius: 20px;
  margin-bottom: 16px;
}
.budget-summary .budget-total {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
}
.budget-summary .budget-remaining {
  font-size: 0.75rem;
  color: #10B981;
  margin-top: 4px;
}

.budget-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  margin-top: 12px;
  overflow: hidden;
}
.budget-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #10B981, #F59E0B);
  transition: width 1.5s ease;
}

.donut-chart {
  width: 160px;
  height: 160px;
  margin: 0 auto 16px;
}

.expense-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  margin-bottom: 6px;
}
.expense-item .exp-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.expense-item .exp-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.expense-item .exp-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
}
.expense-item .exp-cat {
  font-size: 0.6rem;
  color: var(--text-muted);
}
.expense-item .exp-amount {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ---------- COMMUNITY MODULE ---------- */
.community-post {
  padding: 14px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 14px;
  margin-bottom: 10px;
}
.community-post .post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.community-post .post-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0, 71, 255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.community-post .post-author {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}
.community-post .post-time {
  font-size: 0.6rem;
  color: var(--text-muted);
}
.community-post .post-body {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.community-post .post-tag {
  display: inline-flex;
  padding: 3px 8px;
  background: rgba(0, 71, 255,0.1);
  border-radius: 6px;
  font-size: 0.6rem;
  color: var(--accent);
  margin-top: 8px;
  font-weight: 500;
}

/* ---------- CTA Banner ---------- */
.preview-cta-banner {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(0, 71, 255,0.15), rgba(0, 71, 255,0.08));
  border: 1px solid rgba(0, 71, 255,0.2);
  border-radius: 16px;
  text-align: center;
}
.preview-cta-banner p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.preview-cta-banner a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 20px;
  background: var(--accent-gradient);
  border-radius: 9999px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}
.preview-cta-banner a:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 71, 255,0.3);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .preview-page {
    padding: 0;
    justify-content: flex-start;
  }
  .phone-frame {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    animation: none;
  }
  .preview-back {
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.7rem;
  }
  .preview-mode-badge {
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.6rem;
    padding: 0.4rem 0.75rem;
  }
}

