/* Global Resets */
:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --android-blue-btn: #8ab4f8;
    /* Dark mode Play Store blueish action color */

    /* iOS Colors */
    --ios-bg: #000000;
    --ios-text: #ffffff;
    --ios-gray: #8e8e93;
    --ios-divider: #38383a;
    --ios-blue: #0a84ff;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Body Classes for Platform Specifics */
body.platform-android {
    font-family: 'Roboto', sans-serif;
    background-color: #000000;
    color: #e8eaed;
}

body.platform-ios {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #000000;
    color: #ffffff;
}

/* Base Styles */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Helper to hide views */
.view-container {
    display: none;
    padding-bottom: 40px;
}

/* =========================================
   ANDROID STYLES (Google Play Clone - Dark)
   ========================================= */

.a-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 16px;
    position: sticky;
    top: 0;
    background: #000000;
    z-index: 100;
}

.a-back-btn {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 20px;
    font-weight: 500;
    color: #e8eaed;
    cursor: pointer;
}

.a-back-icon-svg {
    fill: #e8eaed;
    width: 24px;
    height: 24px;
}

.a-lang-trigger {
    font-size: 14px;
    font-weight: 500;
    color: #9aa0a6;
    cursor: pointer;
    text-transform: uppercase;
}

/* Header Info - REFACTORED for Dark Mode Screenshot Layout */
.a-header-section {
    padding: 0 24px;
}

.a-title {
    font-size: 24px;
    font-weight: 500;
    line-height: 32px;
    color: #e8eaed;
    margin-bottom: 20px;
    display: block;
}

/* Container for Icon + Stats layout */
.a-info-grid {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.a-app-icon {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

/* Stats next to icon */
.a-stats-container {
    flex: 1;
    display: flex;
    justify-content: space-between;
    padding-top: 4px;
    gap: 10px;
}

.a-stat-col {
    display: flex;
    flex-direction: column;
    position: relative;
    /* Separator line logic: right border except last? */
}

.a-stat-col:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    height: 24px;
    width: 1px;
    background-color: #3c4043;
}

.a-stat-val {
    font-weight: 500;
    font-size: 14px;
    color: #e8eaed;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.a-star {
    font-size: 10px;
}

/* Smaller star */

.a-stat-label {
    font-size: 12px;
    color: #9aa0a6;
    /* Dark mode secondary text */
}

.a-install-btn {
    background-color: var(--android-blue-btn);
    color: #202124;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    border-radius: 20px;
    padding: 10px 0;
    margin: 0 24px 24px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: calc(100% - 48px);
    border: none;
    cursor: pointer;
}

.btn-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Carousel Android */
.a-carousel-scroll {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 0 20px;
    scrollbar-width: none;
    margin-bottom: 24px;
    scroll-snap-type: x mandatory;
}

.a-carousel-scroll::-webkit-scrollbar {
    display: none;
}

.carousel-item {
    flex: 0 0 auto;
    width: 130px;
    height: 231px;
    /* 9:16 approx */
    border-radius: 8px;
    overflow: hidden;
    scroll-snap-align: start;
    background: #202124;
    /* Dark placeholder */
    position: relative;
    cursor: pointer;
}

.carousel-item img,
.carousel-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Sections */
.a-section {
    padding: 0 24px 24px;
}

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

.a-section-header h2 {
    font-size: 18px;
    font-weight: 500;
    color: #e8eaed;
}

.a-arrow-link {
    font-size: 20px;
    color: #9aa0a6;
}

.a-description-text {
    font-size: 14px;
    line-height: 20px;
    color: #9aa0a6;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ratings Android */
.a-ratings-chart {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.a-big-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.a-rating-num {
    font-size: 48px;
    font-weight: 400;
    color: #e8eaed;
    line-height: 1;
}

.a-stars-row {
    color: var(--android-blue-btn);
    /* Blue stars */
    font-size: 12px;
    margin: 4px 0;
    letter-spacing: -2px;
}

.a-total-ratings {
    font-size: 12px;
    color: #9aa0a6;
}

.a-chart-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px 0;
}

.a-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.a-bar-label {
    font-size: 12px;
    color: #9aa0a6;
    width: 10px;
}

.a-bar-track {
    flex: 1;
    height: 10px;
    background-color: #3c4043;
    border-radius: 5px;
    overflow: hidden;
}

.a-bar-fill {
    background-color: var(--android-blue-btn);
    height: 100%;
    border-radius: 5px;
}

/* Reviews List Android */
.a-review-item {
    margin-bottom: 24px;
}

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

.a-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ccc;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 16px;
    margin-right: 12px;
}

.a-user-name {
    font-size: 14px;
    font-weight: 500;
    color: #e8eaed;
}

.a-review-stars {
    color: var(--android-blue-btn);
    font-size: 12px;
    margin-bottom: 6px;
    letter-spacing: -2px;
}

.a-review-date {
    font-size: 12px;
    color: #9aa0a6;
    margin-left: 8px;
}

.a-review-body {
    font-size: 14px;
    line-height: 20px;
    color: #9aa0a6;
    margin-bottom: 12px;
}

.a-review-useful {
    font-size: 12px;
    color: #9aa0a6;
}

.a-ver-mais-btn {
    display: block;
    color: var(--android-blue-btn);
    font-weight: 500;
    font-size: 14px;
    margin-top: 10px;
}

/* Recommended Apps (Android) */
.a-rec-scroll {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    scrollbar-width: none;
    padding-bottom: 10px;
}

.a-rec-item {
    display: flex;
    flex-direction: column;
    width: 100px;
    flex: 0 0 auto;
    text-align: left;
}

.a-rec-icon {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    border: 1px solid #3c4043;
    margin-bottom: 8px;
}

.a-rec-name {
    font-size: 12px;
    color: #e8eaed;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.a-rec-rating {
    font-size: 12px;
    color: #9aa0a6;
}

.a-footer {
    padding: 24px;
    border-top: 1px solid #3c4043;
}

.a-dev-address {
    font-size: 12px;
    color: #9aa0a6;
}


/* =========================================
   iOS STYLES (App Store Clone - Dark)
   ========================================= */

.i-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    height: 44px;
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.85);
    /* Dark Blur */
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 0.5px solid #38383a;
}

.i-back-btn {
    display: flex;
    align-items: center;
    color: var(--ios-blue);
    cursor: pointer;
    gap: 4px;
}

.i-back-text {
    font-size: 17px;
    font-weight: 400;
}

.i-lang-trigger {
    font-size: 17px;
    color: var(--ios-blue);
    cursor: pointer;
}

/* iOS Header */
.i-header {
    padding: 0 20px;
    margin-top: 10px;
}

.i-header-top {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.i-app-icon {
    width: 118px;
    height: 118px;
    border-radius: 26px;
    border: 1px solid #38383a;
}

.i-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.i-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 4px;
    color: #ffffff;
}

.i-subtitle {
    font-size: 15px;
    color: #8e8e93;
    margin-bottom: auto;
}

.i-actions-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

.i-get-btn {
    background-color: var(--ios-blue);
    color: white;
    font-size: 16px;
    font-weight: 700;
    padding: 6px 20px;
    border-radius: 20px;
    border: none;
    text-align: center;
    min-width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.i-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--ios-blue);
}

/* iOS Stats Scroll */
.i-stats-scroll {
    overflow-x: auto;
    padding: 0 20px;
    margin-bottom: 20px;
    scrollbar-width: none;
    border-bottom: 0.5px solid #38383a;
}

.i-stats-scroll::-webkit-scrollbar {
    display: none;
}

.i-stats-container {
    display: flex;
    align-items: center;
    padding-bottom: 12px;
    min-width: max-content;
}

.i-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.i-stat-divider {
    width: 1px;
    height: 30px;
    background-color: #38383a;
    margin: 0 10px;
    transform: none;
}

.i-stat-top {
    font-size: 22px;
    font-weight: 700;
    color: #8e8e93;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.i-stat-item:first-child .i-stat-top {
    color: #8e8e93;
}

.i-stat-stars {
    font-size: 12px;
    color: #8e8e93;
    letter-spacing: -2px;
    display: block;
}

/* Grey stars usually in stats bar unless rated */
.i-stat-top.i-age {
    font-weight: 700;
    font-size: 20px;
    color: #8e8e93;
}

.i-stat-bot {
    font-size: 12px;
    color: #8e8e93;
    font-weight: 400;
}

/* iOS Section */
.i-section {
    padding: 20px;
    border-bottom: 0.5px solid #38383a;
}

.i-section:last-of-type {
    border-bottom: none;
}

.i-section-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
}

/* iOS Carousel */
.i-carousel-scroll {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    margin-bottom: 12px;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
}

.i-carousel-scroll .carousel-item {
    width: 220px;
    height: 476px;
    border-radius: 20px;
}

.i-device-type {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #8e8e93;
    font-weight: 500;
    margin-top: 8px;
}

/* Ratings iOS */
.i-header-ratings {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
}

.i-see-all {
    font-size: 17px;
    color: var(--ios-blue);
}

.i-ratings-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: center;
}

.i-big-score {
    font-size: 60px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -2px;
}

.i-score-box {
    display: flex;
    flex-direction: column;
}

.i-stars-overall {
    font-size: 16px;
    color: #ffffff;
    letter-spacing: -1px;
    margin-bottom: 4px;
}

/* White stars */
.i-count-overall {
    font-size: 15px;
    color: #8e8e93;
}

.i-reviews-scroll {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
}

.i-review-card {
    background-color: #1c1c1e;
    padding: 16px;
    border-radius: 12px;
    width: 300px;
    flex: 0 0 auto;
    scroll-snap-align: center;
}

.i-card-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.i-card-title {
    font-weight: 700;
    font-size: 15px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.i-card-date {
    font-size: 15px;
    color: #8e8e93;
}

.i-card-stars {
    color: #fe8e15;
    font-size: 12px;
    margin-bottom: 8px;
}

/* Orange stars ioS */
.i-card-body {
    font-size: 15px;
    line-height: 1.4;
    color: #ffffff;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.i-card-user {
    font-size: 13px;
    color: #8e8e93;
    margin-bottom: 12px;
}

.i-dev-response {
    background: #2c2c2e;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
}

.i-resp-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}

.i-resp-date {
    font-size: 13px;
    color: #8e8e93;
    margin-bottom: 6px;
}



/* =========================================
   FULLSCREEN MODAL STYLES
   ========================================= */
.modal-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    /* Solid black for full immersion */
    z-index: 10000;
    /* Above everything */
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#modal-content-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-media {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Ensures aspect ratio is preserved and fits within screen */
    /* If screen is wider/taller, this leaves empty space (black borders) as requested */
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background-color: #000000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    z-index: 10001;
    /* Above video */
    border: 1px solid #333;
    /* Adding a subtle border for better visibility against dark backgrounds */
    user-select: none;
}



.i-resp-body {
    font-size: 13px;
    color: #ffffff;
    line-height: 1.4;
}

/* Recommended Grid iOS */
.i-rec-grid {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(3, auto);
    grid-auto-columns: calc(100% - 40px);
    gap: 12px;
    padding: 0 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    grid-template-columns: none;
}

.i-rec-item {
    display: flex;
    align-items: center;
    gap: 12px;
    scroll-snap-align: start;
    padding: 0;
}

.i-rec-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    flex-shrink: 0;
    border: 1px solid #38383a;
}

.i-rec-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.i-rec-name {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
}

.i-rec-cat {
    font-size: 13px;
    color: #8e8e93;
}

.i-rec-btn {
    background: #2c2c2e;
    color: var(--ios-blue);
    font-weight: 700;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 16px;
    text-transform: uppercase;
    font-size: 12px;
}

.i-footer-spacer {
    height: 30px;
}