/* ============================================
   Google Play Store Clone — Style
   ============================================ */

/* ============================================
   Google Sans (Product Sans) @font-face
   ============================================ */
@font-face {
    font-family: "Google Sans";
    src: url("../fonts/ProductSans-Light.ttf") format("truetype");
    font-weight: 200;
}
@font-face {
    font-family: "Google Sans";
    src: url("../fonts/ProductSans-Thin.ttf") format("truetype");
    font-weight: 300;
}
@font-face {
    font-family: "Google Sans";
    src: url("../fonts/ProductSans-Regular.ttf") format("truetype");
    font-weight: 400;
}
@font-face {
    font-family: "Google Sans";
    src: url("../fonts/ProductSans-Medium.ttf") format("truetype");
    font-weight: 500;
}
@font-face {
    font-family: "Google Sans";
    src: url("../fonts/ProductSans-Bold.ttf") format("truetype");
    font-weight: 700;
}
@font-face {
    font-family: "Google Sans";
    src: url("../fonts/ProductSans-Black.ttf") format("truetype");
    font-weight: 900;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --green: #01875f;
  --green-light: #e6f4ed;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-link: #1a73e8;
  --border: #dadce0;
  --bg: #ffffff;
  --bg-gray: #f8f9fa;
  --star-color: #01875f;
  --header-height: 64px;
}

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Google Sans', sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--green);
  text-decoration: none;
}

/* ============================================
   Header
   ============================================ */
.gp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s;
}

.gp-header.scrolled {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-top {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 16px;
  height: 56px;
}

.gp-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.gp-logo svg {
  width: 24px;
  height: 24px;
}

.gp-logo span {
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 18px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.header-search {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-gray);
  border-radius: 24px;
  padding: 8px 16px;
  gap: 8px;
  max-width: 600px;
}

.header-search input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  font-family: 'Roboto', sans-serif;
}

.header-search svg {
  width: 20px;
  height: 20px;
  fill: var(--text-secondary);
  flex-shrink: 0;
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  padding: 0 16px;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.header-nav::-webkit-scrollbar { display: none; }

.header-nav a {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Google Sans', sans-serif;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.header-nav a.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

/* ============================================
   App Hero Section
   ============================================ */
.app-hero {
  padding: 24px 24px 16px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.app-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.app-info h1 {
  font-family: 'Google Sans', sans-serif;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.app-developer {
  font-size: 1rem;
  color: var(--green);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.app-developer svg {
  width: 14px;
  height: 14px;
  fill: var(--green);
}

.app-contains-ads {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: 'Roboto', sans-serif;
}

/* ============================================
   Stats Row
   ============================================ */
.stats-row {
  display: flex;
  padding: 16px 24px;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stat-item {
  flex: 1;
  text-align: center;
  min-width: 80px;
  position: relative;
}

.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}

.stat-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.stat-value svg {
  width: 12px;
  height: 12px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Editors Choice Badge */
.editors-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.editors-choice svg {
  width: 16px;
  height: 16px;
  fill: var(--green);
}

.editors-choice span {
  font-size: 11px;
  font-weight: 500;
  color: var(--green);
}

/* ============================================
   Install Button & Progress
   ============================================ */
.install-section {
  padding: 0 24px 16px;
}

#install-btn {
  width: 100%;
  height: 48px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Google Sans', sans-serif;
  letter-spacing: 0.25px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  position: relative;
  overflow: hidden;
}

#install-btn:hover {
  background: #017a56;
}

#install-btn:active {
  opacity: 0.9;
}

#install-btn.btn-downloading {
  background: #e8e8e8;
  color: var(--text-secondary);
  cursor: default;
}

#install-btn.btn-open {
  background: var(--bg);
  color: var(--green);
  border: 1px solid var(--green);
}

#download-progress {
  display: none;
  margin-top: 8px;
}

.progress-bar {
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  background: var(--green);
  width: 0;
  transition: width 0.1s linear;
  border-radius: 2px;
}

#progress-mb {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  text-align: center;
}

/* Action icons row */
.action-icons {
  display: flex;
  justify-content: flex-start;
  padding: 12px 24px 0;
  gap: 32px;
}

.action-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.action-icon svg {
  width: 24px;
  height: 24px;
  fill: var(--text-secondary);
}

.action-icon span {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ============================================
   Screenshots Carousel
   ============================================ */
.screenshots-section {
  padding: 16px 0 16px 24px;
}

.screenshots-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-right: 24px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.screenshots-scroll::-webkit-scrollbar { display: none; }

.screenshot {
  width: 140px;
  height: 280px;
  border-radius: 12px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.screenshot:nth-child(1) {
  background: linear-gradient(135deg, #ff6b35, #f7c948, #ff6b35);
}

.screenshot:nth-child(2) {
  background: linear-gradient(135deg, #7b2ff7, #c471f5, #7b2ff7);
}

.screenshot:nth-child(3) {
  background: linear-gradient(135deg, #00c9ff, #92fe9d, #00c9ff);
}

.screenshot:nth-child(4) {
  background: linear-gradient(135deg, #fc466b, #3f5efb, #fc466b);
}

.screenshot:nth-child(5) {
  background: linear-gradient(135deg, #f83600, #f9d423, #f83600);
}

.screenshot-content {
  text-align: center;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  padding: 20px 12px;
}

.screenshot-content .slot-icon {
  font-size: 48px;
  margin-bottom: 8px;
  display: block;
}

.screenshot-content .slot-text {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.screenshot-content .slot-sub {
  font-size: 11px;
  opacity: 0.9;
  margin-top: 4px;
}

/* ============================================
   Section Headers
   ============================================ */
.section {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header h2 {
  font-family: 'Google Sans', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.section-header .arrow-link {
  display: flex;
  align-items: center;
  color: var(--green);
  font-size: 14px;
  font-weight: 500;
}

.section-header .arrow-link svg {
  width: 20px;
  height: 20px;
  fill: var(--green);
}

/* ============================================
   About Section
   ============================================ */
.about-text {
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-height: 100px;
  overflow: hidden;
  position: relative;
}

.about-text.expanded {
  max-height: none;
}

.about-text::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, white);
}

.about-text.expanded::after {
  display: none;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-primary);
}

/* ============================================
   Ratings & Reviews
   ============================================ */
.rating-overview {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 20px;
}

.rating-big {
  text-align: center;
}

.rating-big .number {
  font-family: 'Google Sans', sans-serif;
  font-size: 56px;
  font-weight: 400;
  line-height: 1;
  color: var(--text-primary);
}

.rating-big .stars {
  display: flex;
  gap: 2px;
  justify-content: center;
  margin-top: 4px;
}

.rating-big .count {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.rating-bars {
  flex: 1;
}

.rating-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.rating-bar-row span {
  font-size: 12px;
  color: var(--text-secondary);
  width: 8px;
  text-align: right;
}

.rating-bar {
  flex: 1;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.rating-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
}

/* Review cards */
.review {
  margin-bottom: 20px;
}

.review-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.review-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.review-name {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 400;
}

.review-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.review-stars {
  display: flex;
  gap: 1px;
}

.review-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.review-text {
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.5;
}

.review-helpful {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-helpful span {
  cursor: pointer;
}

/* ============================================
   Data Safety Section
   ============================================ */
.data-safety-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.data-safety-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.data-safety-item:last-child {
  margin-bottom: 0;
}

.data-safety-item svg {
  width: 24px;
  height: 24px;
  fill: var(--text-secondary);
  flex-shrink: 0;
  margin-top: 2px;
}

.data-safety-item .ds-title {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 400;
}

.data-safety-item .ds-desc {
  font-family: 'Roboto', sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================
   What's New
   ============================================ */
.whats-new-text {
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   Footer
   ============================================ */
.gp-footer {
  padding: 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-gray);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.footer-links a {
  font-size: 12px;
  color: var(--text-secondary);
}

.footer-meta {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   Star SVG helper
   ============================================ */
.star-svg {
  width: 12px;
  height: 12px;
}

.star-svg.small {
  width: 10px;
  height: 10px;
}

.star-svg.large {
  width: 16px;
  height: 16px;
}

/* ============================================
   Utilities
   ============================================ */
.hidden {
  display: none !important;
}

/* ============================================
   Responsive
   ============================================ */
@media (min-width: 600px) {
  .app-hero {
    max-width: 700px;
  }
  
  .screenshot {
    width: 160px;
    height: 320px;
  }
}

@media (min-width: 960px) {
  body {
    max-width: 960px;
    margin: 0 auto;
  }
}

/* Desktop title sizing */
@media (min-width: 1281px) {
  .app-info h1 {
    font-size: 56px;
  }
  .rating-big .number {
    font-size: 56px;
  }
}

@media (max-width: 1280px) {
  .app-info h1 {
    font-size: 36px;
  }
}

@media (max-width: 600px) {
  .app-info h1 {
    font-size: 24px;
  }
}

/* ============================================
   Fixed Bottom Bar (mobile only)
   ============================================ */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
  z-index: 9999;
}

.bottom-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.bottom-bar-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}

.bottom-bar-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-bar-btn {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Google Sans', sans-serif;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.bottom-bar-btn.btn-open {
  background: var(--bg);
  color: var(--green);
  border: 1px solid var(--green);
}

/* Add padding to footer so bottom bar doesn't overlap */
.gp-footer {
  padding-bottom: 80px;
}

@media (min-width: 901px) {
  .bottom-bar {
    display: none !important;
  }
  .gp-footer {
    padding-bottom: 24px;
  }
}

/* ============================================
   Standalone mode — hide everything
   ============================================ */
@media (display-mode: standalone) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #1a1a2e;
    color: white;
  }
  
  .gp-header, .app-hero, .stats-row, .install-section,
  .action-icons, .screenshots-section, .section, .gp-footer,
  .bottom-bar {
    display: none !important;
  }
}
