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

:root {
    --red: #EF4444;
    --red-dark: #DC2626;
    --text: #1D1D1F;
    --text-secondary: #6E6E73;
    --bg: #FFFFFF;
    --border: #E5E5EA;
    --surface: #F5F5F7;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== App Header ===== */
.app-header {
    padding: 48px 0 32px;
}

.app-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-icon img {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    display: block;
}

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

.app-details h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.tagline {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.developer {
    font-size: 13px;
    color: var(--red);
    margin-top: 4px;
    font-weight: 500;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: var(--red);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border-radius: 100px;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}

.download-btn:hover {
    background: var(--red-dark);
}

/* ===== Info Bar ===== */
.info-bar {
    padding: 0 0 32px;
}

.info-items {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.info-item {
    flex: 1;
    text-align: center;
}

.info-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-secondary);
}

.info-sub {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.info-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
    flex-shrink: 0;
}

/* ===== Screenshots ===== */
.screenshots {
    padding: 0 0 36px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

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

.screenshots-track {
    display: flex;
    gap: 12px;
    padding: 0 max(24px, calc((100vw - 680px) / 2 + 24px));
}

.screenshots-track img {
    width: 200px;
    height: auto;
    border-radius: 16px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ===== Sections ===== */
h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.section-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 28px;
}

/* ===== Features ===== */
.features {
    padding: 20px 0 40px;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.feature:last-child {
    border-bottom: none;
}

.feature-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FEF2F2;
    color: var(--red);
    border-radius: 10px;
    flex-shrink: 0;
}

.feature h3 {
    font-size: 15px;
    font-weight: 600;
}

.feature p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ===== Purchases ===== */
.purchases {
    padding: 20px 0 40px;
}

.purchase-list {
    display: flex;
    flex-direction: column;
}

.purchase-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.purchase-item:last-child {
    border-bottom: none;
}

.purchase-name {
    display: block;
    font-size: 15px;
    font-weight: 500;
}

.purchase-type {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.purchase-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--red);
}

/* ===== Compatibility ===== */
.compatibility {
    padding: 20px 0 40px;
}

.compat-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.compat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--surface);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.compat-item svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.compat-note {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== Language Picker ===== */
.lang-section {
    padding: 20px 0 12px;
}

.lang-picker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.lang-picker select {
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--red);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

/* ===== RTL Support ===== */
html[dir="rtl"] .app-info {
    flex-direction: row-reverse;
}

html[dir="rtl"] .feature {
    flex-direction: row-reverse;
    text-align: right;
}

html[dir="rtl"] .purchase-item {
    flex-direction: row-reverse;
}

html[dir="rtl"] .compat-item {
    flex-direction: row-reverse;
}

html[dir="rtl"] .lang-picker {
    flex-direction: row-reverse;
}

/* ===== Footer ===== */
.footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
}

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

.footer-links a {
    font-size: 13px;
    color: var(--red);
    font-weight: 500;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 0.7;
}

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

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .app-info {
        flex-wrap: wrap;
    }

    .app-icon img {
        width: 64px;
        height: 64px;
    }

    .app-details h1 {
        font-size: 20px;
    }

    .download-btn {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }

    .info-value {
        font-size: 15px;
    }

    .info-sub {
        font-size: 10px;
    }

    .compat-list {
        flex-direction: column;
    }

    .screenshots-track {
        padding: 0 16px;
    }

    .screenshots-track img {
        width: 170px;
        border-radius: 12px;
    }
}
