﻿/* ========================================
   DEMO APP — Phone Frame + App UI Kit
   ======================================== */

/* Phone Frame Container */
.phone-viewport {
  --phone-w: 375px;
  --phone-h: 812px;
  --phone-radius: 44px;
  --phone-bezel: 8px;
  --app-bg: var(--bg, #ffffff);
  --app-text: var(--text, #1a1a1a);
  --app-text-secondary: var(--text-secondary, #6b7280);
  --app-accent: var(--accent, #8b5cf6);
  --app-accent-light: var(--accent-light, rgba(139, 92, 246, 0.1));
  --app-card-bg: var(--card-bg, #ffffff);
  --app-border: var(--border, rgba(0, 0, 0, 0.06));
  --app-nav-bg: var(--nav-bg, #ffffff);

  position: relative;
  width: var(--phone-w);
  height: var(--phone-h);
  margin: 80px auto 40px;
  border-radius: var(--phone-radius);
  background: #0a0a0a;
  padding: var(--phone-bezel);
  box-shadow:
    0 0 0 2px #2a2a2a,
    0 40px 80px rgba(0, 0, 0, 0.5),
    0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Inner screen */
.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--phone-radius) - var(--phone-bezel));
  background: var(--app-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Dynamic Island / Notch */
.phone-screen::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 30px;
  background: #0a0a0a;
  border-radius: 20px;
  z-index: 50;
}

/* Status Bar */
.app-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--app-text);
  flex-shrink: 0;
  position: relative;
  z-index: 40;
}

.app-status-bar__time {
  font-weight: 700;
  font-size: 0.82rem;
}

.app-status-bar__icons {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
}

/* Signal bars */
.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 10px;
}

.signal-bars span {
  width: 3px;
  background: var(--app-text);
  border-radius: 1px;
}

.signal-bars span:nth-child(1) { height: 3px; }
.signal-bars span:nth-child(2) { height: 5px; }
.signal-bars span:nth-child(3) { height: 7px; }
.signal-bars span:nth-child(4) { height: 10px; }

/* Battery */
.battery-icon {
  width: 22px;
  height: 10px;
  border: 1.5px solid var(--app-text);
  border-radius: 2px;
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 1px;
}

.battery-icon::after {
  content: '';
  width: 2px;
  height: 5px;
  background: var(--app-text);
  position: absolute;
  right: -4px;
  border-radius: 0 1px 1px 0;
}

.battery-icon__fill {
  width: 75%;
  height: 100%;
  background: var(--app-text);
  border-radius: 1px;
}

/* App Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 12px;
  flex-shrink: 0;
}

.app-header__brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--app-text);
  letter-spacing: -0.02em;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--app-accent-light);
  color: var(--app-accent);
  font-size: 0.9rem;
  transition: transform 200ms var(--ease);
}

.app-header__icon:active {
  transform: scale(0.92);
}

/* App Content (scrollable) */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 20px;
  -webkit-overflow-scrolling: touch;
}

.app-content::-webkit-scrollbar {
  display: none;
}

/* Section titles inside app */
.app-section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--app-text);
  margin: 20px 0 12px;
}

.app-section-subtitle {
  font-size: 0.78rem;
  color: var(--app-text-secondary);
  margin-bottom: 12px;
}

/* App Cards */
.app-card {
  background: var(--app-card-bg);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 200ms var(--ease);
}

.app-card:active {
  transform: scale(0.98);
}

.app-card__image {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--app-accent-light), rgba(0,0,0,0.04));
}

.app-card__body {
  padding: 12px;
}

.app-card__title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--app-text);
  margin-bottom: 2px;
}

.app-card__subtitle {
  font-size: 0.72rem;
  color: var(--app-text-secondary);
}

.app-card__price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--app-accent);
  margin-top: 6px;
}

/* Horizontal scroll cards */
.app-scroll-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.app-scroll-row::-webkit-scrollbar {
  display: none;
}

.app-scroll-row .app-card {
  min-width: 200px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* Category pills */
.app-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
  -webkit-overflow-scrolling: touch;
}

.app-pills::-webkit-scrollbar {
  display: none;
}

.app-pill {
  flex-shrink: 0;
  height: 34px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--app-border);
  color: var(--app-text-secondary);
  background: transparent;
  transition: all 200ms var(--ease);
  white-space: nowrap;
}

.app-pill:active,
.app-pill.active {
  background: var(--app-accent);
  color: #ffffff;
  border-color: var(--app-accent);
}

/* App buttons */
.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all 200ms var(--ease);
}

.app-btn:active {
  transform: scale(0.96);
}

.app-btn--primary {
  background: var(--app-accent);
  color: #ffffff;
  width: 100%;
}

.app-btn--outline {
  border: 1.5px solid var(--app-border);
  color: var(--app-text);
  background: transparent;
}

/* App list items */
.app-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--app-border);
}

.app-list-item__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--app-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.app-list-item__text {
  flex: 1;
  min-width: 0;
}

.app-list-item__title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--app-text);
}

.app-list-item__desc {
  font-size: 0.72rem;
  color: var(--app-text-secondary);
  margin-top: 1px;
}

.app-list-item__action {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--app-accent);
  flex-shrink: 0;
}

/* Search bar */
.app-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  background: var(--app-accent-light);
  margin-bottom: 16px;
}

.app-search__icon {
  font-size: 0.88rem;
  color: var(--app-text-secondary);
  flex-shrink: 0;
}

.app-search__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  color: var(--app-text);
}

.app-search__input::placeholder {
  color: var(--app-text-secondary);
}

/* Hero banner inside app */
.app-hero-banner {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--app-accent), color-mix(in srgb, var(--app-accent) 60%, #000));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.app-hero-banner__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
}

.app-hero-banner__subtitle {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

/* Grid layouts */
.app-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.app-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* Quick action tiles */
.app-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: var(--radius-md);
  background: var(--app-card-bg);
  border: 1px solid var(--app-border);
  text-align: center;
  transition: all 200ms var(--ease);
}

.app-quick-action:active {
  transform: scale(0.95);
  background: var(--app-accent-light);
}

.app-quick-action__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--app-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.app-quick-action__label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--app-text);
}

/* Bottom Navigation */
.app-bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 60px;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 8px);
  background: var(--app-nav-bg);
  border-top: 1px solid var(--app-border);
  flex-shrink: 0;
}

.app-bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 200ms var(--ease);
}

.app-bottom-nav__item:active {
  transform: scale(0.9);
}

.app-bottom-nav__icon {
  font-size: 1.15rem;
  color: var(--app-text-secondary);
  transition: color 200ms var(--ease);
}

.app-bottom-nav__label {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--app-text-secondary);
  transition: color 200ms var(--ease);
}

.app-bottom-nav__item.active .app-bottom-nav__icon,
.app-bottom-nav__item.active .app-bottom-nav__label {
  color: var(--app-accent);
}

/* Notification badge */
.app-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  background: #ef4444;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* App Tabs */
.app-tabs {
  display: flex;
  border-bottom: 1px solid var(--app-border);
  margin: 0 -20px;
  padding: 0 20px;
}

.app-tab {
  flex: 1;
  padding: 10px 0;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--app-text-secondary);
  text-align: center;
  position: relative;
  transition: color 200ms var(--ease);
  cursor: pointer;
}

.app-tab.active {
  color: var(--app-accent);
}

.app-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--app-accent);
  border-radius: 2px;
}

/* Quantity stepper */
.app-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.app-stepper__btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--app-accent);
  background: transparent;
  transition: background 150ms;
}

.app-stepper__btn:active {
  background: var(--app-accent-light);
}

.app-stepper__count {
  width: 28px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--app-text);
}

/* Star rating */
.app-stars {
  display: flex;
  gap: 2px;
  font-size: 0.72rem;
  color: #facc15;
}

/* Image with overlay gradient */
.app-img-overlay {
  position: relative;
}

.app-img-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent 50%);
}

/* Dark mode overrides for Bold Dark (app-2) */
.app-dark {
  --bg: #0f0f0f;
  --text: #f0f0f0;
  --text-secondary: #888;
  --card-bg: #1a1a1a;
  --border: rgba(255, 255, 255, 0.08);
  --nav-bg: #0f0f0f;
}

.app-dark .app-status-bar {
  color: #f0f0f0;
}

.app-dark .signal-bars span {
  background: #f0f0f0;
}

.app-dark .battery-icon {
  border-color: #f0f0f0;
}

.app-dark .battery-icon::after {
  background: #f0f0f0;
}

.app-dark .battery-icon__fill {
  background: #f0f0f0;
}

/* Warm mode overrides for Soft Warm (app-3) */
.app-warm {
  --bg: #faf5ef;
  --text: #2c2418;
  --text-secondary: #8a7b6b;
  --card-bg: #ffffff;
  --border: rgba(44, 36, 24, 0.08);
  --nav-bg: #faf5ef;
}

/* Spacer for bottom nav */
.app-spacer {
  height: 80px;
  flex-shrink: 0;
}

