/* OPPO App Market — v41 */
:root {
  --primary: #1ba784;
  --primary-dark: #158a6e;
  --accent: #2cc79e;
  --surface: #f5f5f5;
  --surface-card: #ffffff;
  --text: #333333;
  --text-muted: #757575;
  --border: #e0e0e0;
  --star: #f5a623;
  --radius-btn: 24px;
  --radius-card: 12px;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--surface);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

img {
  display: block;
  max-width: 100%;
}

/* Shell */
.app-shell {
  width: min(100%, 480px);
  background: var(--surface-card);
  min-height: 100vh;
}

/* ── Header banner ── */
.header-banner {
  background: linear-gradient(135deg, #1ba784 0%, #2cc79e 100%);
  border-radius: 0 0 24px 24px;
  padding: 20px 16px 28px;
  color: #fff;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.store-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.header-icon-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background 0.2s;
}

.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* ── App info ── */
.app-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 16px 12px;
}

.app-icon-wrap {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.app-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-details {
  flex: 1;
  min-width: 0;
}

.app-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-category {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  margin: 2px 0 6px;
}

.app-rating-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.star-icon {
  color: var(--star);
  font-size: 0.9rem;
}

.rating-value {
  font-weight: 600;
  color: var(--text);
}

/* ── Install button ── */
.install-section {
  padding: 4px 16px 16px;
}

.install-btn {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  letter-spacing: 0.5px;
  min-height: 52px;
  transition: opacity 0.15s, transform 0.1s;
}

.install-btn:hover {
  opacity: 0.92;
}

.install-btn:active {
  animation: bounce 0.2s ease;
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.95); }
}

@media (prefers-reduced-motion: reduce) {
  .install-btn:active {
    animation: none;
  }
}

/* ── Stats row ── */
.stats-row {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 12px 16px 16px;
  background: var(--surface);
  margin: 0 16px;
  border-radius: var(--radius-card);
}

.stat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-cell strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.stat-cell span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

/* ── Safety check ── */
.safety-section {
  padding: 16px 16px 0;
}

.safety-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #e8f8f3;
  border: 1px solid #b2dfdb;
  border-radius: var(--radius-card);
  padding: 14px 16px;
}

.safety-icon {
  flex-shrink: 0;
}

.safety-text {
  flex: 1;
}

.safety-text strong {
  display: block;
  font-size: 0.9rem;
  color: var(--primary-dark);
}

.safety-text p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.safety-check {
  flex-shrink: 0;
}

/* Spinning shield animation */
@keyframes spin-once {
  from { transform: rotate(-15deg); }
  to { transform: rotate(0deg); }
}

.shield-spin {
  animation: spin-once 0.6s ease-out forwards;
}

@keyframes check-pop {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.check-animate {
  animation: check-pop 0.5s ease-out 0.3s both;
}

@media (prefers-reduced-motion: reduce) {
  .shield-spin,
  .check-animate {
    animation: none;
  }
}

/* ── Section title ── */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

/* ── Screenshots ── */
.screenshots-section {
  padding: 20px 16px 0;
}

.screenshots-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.screenshots-track::-webkit-scrollbar {
  display: none;
}

.screenshot-card {
  flex-shrink: 0;
  width: 130px;
  height: 230px;
  border-radius: 10px;
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--surface);
  margin: 0;
}

.screenshot-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Description ── */
.description-section {
  padding: 20px 16px 0;
}

.description-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 10px;
}

.updated-row {
  display: flex;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.updated-label {
  font-weight: 600;
}

/* ── Reviews ── */
.reviews-section {
  padding: 20px 16px 0;
}

.rating-overview {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.rating-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 72px;
}

.score-big {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stars-row {
  color: var(--star);
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.review-total {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.rating-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.bar-row span {
  width: 10px;
  text-align: right;
}

.bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
}

.review-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 14px;
  margin-top: 4px;
}

.review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.reviewer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.reviewer-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.reviewer-info strong {
  font-size: 0.88rem;
}

.review-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.review-stars {
  color: var(--star);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.review-body {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
}

.review-helpful {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ── Permissions ── */
.permissions-section {
  padding: 20px 16px 0;
}

.permissions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.permission-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.permission-item:last-child {
  border-bottom: none;
}

.perm-icon {
  flex-shrink: 0;
  color: var(--primary);
  margin-top: 1px;
}

.perm-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.perm-text strong {
  font-size: 0.88rem;
}

.perm-text span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Footer ── */
.app-footer {
  margin-top: 24px;
  padding: 20px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.footer-links a {
  font-size: 0.78rem;
  color: var(--primary);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-copy {
  font-size: 0.72rem;
  color: var(--text-muted);
}
