:root {
    --blue: #4285F4;
    --red: #DB4437;
    --yellow: #F4B400;
    --green: #0F9D58;
    --google-blue: #01875f;
    /* Play Store green-blue primary */
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --border-color: #dadce0;
    --bg-color: #ffffff;
    --card-shadow: 0 1px 2px 0 rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', 'Google Sans', Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-color);
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* CRITICAL STYLES MOVED TO TOP TO PREVENT TRUNCATION ISSUES */
/* Sticky Header */
.top-sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 56px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    border-bottom: 1px solid #e0e0e0;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-right {
    display: flex;
    align-items: center;
}

/* Bottom Navigation */
.bottom-sticky-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border-top: 1px solid #e0e0e0;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #5f6368;
    cursor: pointer;
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
}

.nav-item.active {
    color: #01875f;
}

.nav-item.active svg path {
    fill: #01875f;
}

/* END CRITICAL STYLES */

/* Loader Styles */
.container-loader {
    width: 200px;
    height: 200px;
    position: fixed;
    z-index: 9999;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.animation .dot {
    width: 15px;
    height: 15px;
    border-radius: 10px;
    margin: 5px;
    animation: g-loader 1s ease-in-out infinite;
}

.animation .dot:nth-child(1) {
    background: var(--blue);
    animation-delay: .1s;
}

.animation .dot:nth-child(2) {
    background: var(--red);
    animation-delay: .25s;
}

.animation .dot:nth-child(3) {
    background: var(--yellow);
    animation-delay: .4s;
}

.animation .dot:nth-child(4) {
    background: var(--green);
    animation-delay: .55s;
}

@keyframes g-loader {

    0%,
    100% {
        height: 15px;
    }

    50% {
        height: 40px;
    }
}

/* Main Content */
.product-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 16px 80px;
    /* Adjust for sticky header/footer */
}

/* Hero Section */
.hero-section {
    margin-bottom: 32px;
}

.app-info-container {
    display: flex;
    gap: 16px;
    margin-bottom: 3px;
}

.app-icon {
    width: 96px;
    height: 96px;
    border-radius: 20%;
    background-size: cover;
    background-position: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.app-details h1 {
    font-size: 24px;
    font-weight: 500;
}

.verified-badge {
    margin-top: 2px;
}

.developer-name {
    color: #01875f;
    font-weight: 500;
    font-size: 16px;
}

.app-tags {
    margin-top: 8px;
    display: flex;
    gap: 12px;
}

.tag {
    font-size: 12px;
    color: var(--text-secondary);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0;
    margin-top: 3px;
    margin-bottom: 3px;
}

.install-btn {
    background-color: #01875f;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 48px;
    /* Better for mobile touch */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 5;
}

.install-btn:hover {
    background-color: #016b4a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.install-btn:active {
    transform: scale(0.98);
}

.secondary-actions {
    display: flex;
    gap: 24px;
    margin-bottom: 3px;
    padding: 0;
    justify-content: center;
    width: 100%;
}

.wishlist-btn,
.share-btn {
    background: none;
    border: none;
    color: #01875f;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.wishlist-btn svg,
.share-btn svg {
    width: 20px;
    height: 20px;
    fill: #01875f;
}

.wishlist-btn:hover,
.share-btn:hover {
    opacity: 0.7;
}

/* Stats Section */
.stats-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0 3px 0;
    /* border-top: 1px solid #e0e0e0; Removed border */
    margin-top: 0;
    margin-bottom: 0;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-value {
    font-weight: 500;
    font-size: 15px;
    color: #202124;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #5f6368;
}

.editors-choice-badge {
    margin: 0 auto;
    vertical-align: middle;
}

.editors-choice .stat-label {
    color: #5f6368;
    font-weight: 400;
}

.stat-item.divider {
    max-width: 1px;
    width: 1px;
    height: 32px;
    background: #e0e0e0;
    margin: auto 0;
    flex: none;
    opacity: 0.6;
}

/* Screenshots */
.screenshots-section {
    margin-bottom: 32px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.screenshots-carousel {
    display: flex;
    gap: 12px;
    padding-bottom: 12px;
}

.screenshot-img {
    height: 220px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Generic Section Styles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    cursor: pointer;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 500;
}

.arrow-icon {
    font-size: 20px;
    color: var(--text-secondary);
}

.about-section,
.whats-new-section,
.data-safety-section,
.reviews-section {
    margin-bottom: 32px;
}

.truncated-text {
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* What's New */
.whats-new-content {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Data Safety */
.data-safety-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.data-safety-box {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.safety-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.safety-icon {
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.7;
}

.share-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92c0-1.61-1.31-2.92-2.92-2.92z"/></svg>');
}

.cloud-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"/></svg>');
}

.lock-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9V6z"/></svg>');
}

.trash-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg>');
}

.safety-text {
    font-size: 14px;
    color: var(--text-primary);
}

.see-details {
    color: var(--google-blue);
    font-size: 14px;
    font-weight: 500;
    margin-top: 16px;
    cursor: pointer;
}

/* Rating and Reviews */
.reviews-header-info {
    margin-bottom: 24px;
}

.verified-text {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.info-icon {
    font-size: 14px;
}

.rating-summary-container {
    display: flex;
    gap: 32px;
    align-items: center;
}

.rating-big-number {
    text-align: center;
}

.big-score {
    font-size: 56px;
    font-weight: 500;
    line-height: 1;
}

.stars-outer {
    position: relative;
    display: inline-block;
    color: var(--google-blue);
    font-size: 14px;
    margin-top: 4px;
}

.stars-inner {
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
    overflow: hidden;
    width: 0;
}

.reviews-count-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.rating-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rating-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.bar-bg {
    flex: 1;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--google-blue);
    border-radius: 5px;
}

/* Reviews List */
.review-item {
    margin-bottom: 32px;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.review-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-size: cover;
}

.review-user {
    font-weight: 500;
    font-size: 14px;
}

.review-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.review-meta .stars {
    color: var(--google-blue);
}

.review-content {
    font-size: 14px;
    color: var(--text-secondary);
}

.developer-reply {
    margin-top: 12px;
    padding: 12px;
    background: #f1f3f4;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary);
}

/* Reviews Modal Specific */
.reviews-modal-overlay {
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.reviews-modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.reviews-modal-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
}

.header-app-info {
    display: flex;
    gap: 16px;
    align-items: center;
}

.modal-app-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background-size: cover;
}

.modal-app-text h2 {
    font-size: 18px;
    font-weight: 500;
}

.modal-app-text .subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.reviews-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-review-item {
    margin-bottom: 32px;
}

.review-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.likes {
    display: flex;
    align-items: center;
    gap: 6px;
}

.heart-icon {
    font-size: 16px;
}

.helpful-prompt {
    display: flex;
    align-items: center;
    gap: 12px;
}

.helpful-btn {
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: white;
    font-size: 12px;
    cursor: pointer;
}

.modal-developer-reply {
    margin-top: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 500;
}

.reply-date {
    color: var(--text-secondary);
    font-weight: 400;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: white;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-content {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 40px;
}

.modal-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    margin-right: 24px;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 500;
}

.modal-body {
    padding: 24px 16px;
}

.modal-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 32px;
    white-space: pre-wrap;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.info-value {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Developer Contact Section */
.developer-contact-section {
    margin-bottom: 24px;
}

.developer-contact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 16px 0;
}

.developer-contact-header h2 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
}

.expand-icon {
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.expand-icon.expanded {
    transform: rotate(180deg);
}

.developer-contact-details {
    padding-bottom: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    display: none;
    /* Hidden by default */
}

.developer-contact-details.visible {
    display: block;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
}

.contact-icon {
    flex-shrink: 0;
}

/* Refined Footer */
.main-footer {
    padding: 0 16px 80px;
    /* Added bottom padding for sticky nav */
    background: #ffffff;
    text-align: left;
    font-size: 14px;
    color: var(--text-secondary);
    border-top: none;
}

.footer-links-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 400;
}

.footer-row {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.footer-row .footer-link {
    font-size: 12px;
    color: var(--text-secondary);
}

.copyright-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 16px;
}

/* Responsive adjustements */
@media (min-width: 800px) {
    .install-btn {
        width: auto;
        min-width: 200px;
    }

    .action-buttons {
        flex-direction: row-reverse;
        justify-content: flex-end;
    }
}

/* Sticky Header */
.top-sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    border-bottom: 1px solid #e0e0e0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.google-play-text {
    font-family: 'Google Sans', sans-serif;
    font-size: 20px;
    color: #5f6368;
    font-weight: 400;
}

.header-right {
    display: flex;
    align-items: center;
}

/* Bottom Navigation */
.bottom-sticky-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border-top: 1px solid #e0e0e0;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #5f6368;
    cursor: pointer;
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
}

.nav-item.active {
    color: #01875f;
}

.nav-item.active svg path {
    fill: #01875f;
}