/* Core Design System for Google Play Clone */
:root {
    --play-green: #01875f;
    --play-green-dark: #00704e;
    --play-green-light: #e6f3ef;
    --bg-white: #ffffff;
    --bg-gray: #f8f9fa;
    --text-dark: #202124;
    --text-muted: #5f6368;
    --text-light: #80868b;
    --border-color: #dadce0;
    --shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --border-radius-lg: 12px;
    --border-radius-md: 8px;
    --font-family: 'Google Sans', 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-white);
    color: var(--text-dark);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Header Styles */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.back-btn:hover {
    background-color: var(--bg-gray);
}

.play-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.play-logo svg {
    height: 24px;
}

.play-logo span {
    font-size: 20px;
    color: var(--text-muted);
    font-weight: 500;
    font-family: 'Product Sans', var(--font-family);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: var(--bg-gray);
}

/* Main Container Layout */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 24px 80px 24px;
}

/* Hero Section */
.app-hero {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.app-icon-wrapper {
    flex-shrink: 0;
}

.app-icon {
    width: 96px;
    height: 96px;
    border-radius: 20%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    object-fit: cover;
}

.app-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.app-title {
    font-size: 28px;
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.2;
}

.app-developer {
    font-size: 16px;
    font-weight: 500;
    color: var(--play-green);
    margin-top: 4px;
    text-decoration: none;
}

.app-developer:hover {
    text-decoration: underline;
}

.app-ads-tag {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Metadata Row */
.app-meta-row {
    display: flex;
    justify-content: space-around;
    padding: 16px 0;
    margin-bottom: 24px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.meta-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border-color);
}

.meta-item:last-child {
    border-right: none;
}

.meta-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.age-badge {
    border: 1.5px solid var(--text-dark);
    padding: 0px 4px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    display: inline-block;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.btn-install {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--play-green);
    color: var(--bg-white);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-install:hover {
    background-color: var(--play-green-dark);
}

.btn-install:active {
    transform: scale(0.98);
}

.btn-wishlist {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--play-green);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
    width: 100%;
}

.btn-wishlist:hover {
    background-color: var(--play-green-light);
}

/* Screenshots Carousel */
.screenshots-container {
    margin: 0 -24px 32px -24px;
    overflow: hidden;
}

.screenshots-scroll {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 4px 24px 16px 24px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    scroll-snap-type: x mandatory;
}

.screenshots-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.screenshot-item {
    flex: 0 0 auto;
    width: 200px;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    scroll-snap-align: start;
    transition: transform 0.2s;
}

.screenshot-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.screenshot-item:hover {
    transform: scale(1.02);
}

/* Content Sections */
.section {
    margin-bottom: 32px;
}

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

.section-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-dark);
}

.section-arrow {
    color: var(--text-muted);
    font-size: 18px;
}

.section-body {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Category Tags */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.tag-pill {
    font-size: 12px;
    color: var(--text-muted);
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.tag-pill:hover {
    background-color: var(--bg-gray);
}

/* Data Safety Section */
.safety-box {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    margin-top: 12px;
}

.safety-item {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

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

.safety-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.safety-info h4 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.safety-info p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Ratings & Reviews Section */
.ratings-container {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-bottom: 24px;
}

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

.rating-score {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.rating-stars {
    color: var(--play-green);
    margin-top: 8px;
    font-size: 14px;
}

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

.rating-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rating-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.bar-num {
    width: 8px;
    text-align: center;
}

.bar-track {
    flex: 1;
    height: 8px;
    background-color: #e8eaed;
    border-radius: 4px;
    overflow: hidden;
}

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

/* Review Item */
.review-item {
    margin-bottom: 24px;
}

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

.reviewer-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

.review-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 2px;
}

.review-stars {
    color: var(--play-green);
    font-size: 10px;
}

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

.review-content {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Direct Download Section */
.footer-download {
    background-color: var(--bg-gray);
    border-top: 1px solid var(--border-color);
    padding: 32px 24px;
    text-align: center;
    margin: 40px -24px -80px -24px;
}

.footer-download h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.footer-download p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.btn-direct-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--play-green);
    color: var(--bg-white);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.btn-direct-download:hover {
    background-color: var(--play-green-dark);
}

/* Modal Overlay & Slide-Up Drawer */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-end; /* Drawer at bottom on mobile */
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-drawer {
    background-color: var(--bg-white);
    width: 100%;
    max-width: 600px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 24px;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.1, 0.76, 0.55, 0.94);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-drawer {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.modal-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title svg {
    color: var(--play-green);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: var(--bg-gray);
}

/* Steps List styling */
.steps-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.step-card {
    display: flex;
    gap: 16px;
    background-color: var(--bg-gray);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e8eaed;
}

.step-num {
    background-color: var(--play-green);
    color: var(--bg-white);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(1, 135, 95, 0.4);
}

.step-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.step-info h4 {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
}

.step-info p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.step-info img {
    margin-top: 10px;
    max-width: 100%;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-modal-dl {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--play-green);
    color: var(--bg-white);
    text-decoration: none;
    font-weight: 500;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    transition: background-color 0.2s;
}

.btn-modal-dl:hover {
    background-color: var(--play-green-dark);
}

.dl-trouble-link {
    text-align: center;
    font-size: 13px;
    color: var(--play-green);
    text-decoration: none;
    font-weight: 500;
}

.dl-trouble-link:hover {
    text-decoration: underline;
}

/* Tablet / Desktop Overrides */
@media (min-width: 600px) {
    header {
        padding: 16px 40px;
    }
    
    main {
        padding: 40px 40px 100px 40px;
    }

    .app-hero {
        gap: 32px;
    }

    .app-icon {
        width: 128px;
        height: 128px;
    }

    .app-title {
        font-size: 36px;
    }

    .action-buttons {
        flex-direction: row;
        gap: 16px;
    }

    .btn-install {
        width: auto;
        padding: 12px 48px;
    }

    .btn-wishlist {
        width: auto;
        padding: 12px 24px;
    }
    
    .screenshot-item {
        width: 220px;
        height: 385px;
    }
    
    /* Make modal a centered card on desktop */
    .modal-overlay {
        align-items: center;
    }
    
    .modal-drawer {
        border-radius: 16px;
        transform: scale(0.9) translateY(40px);
        opacity: 0;
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    }
    
    .modal-overlay.active .modal-drawer {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}
