:root {
    --app-blue: #007aff;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --bg-color: #ffffff;
    --container-bg: #f5f5f7;
    --border-color: #e5e5ea;
}

html.dark-theme {
    --app-blue: #0a84ff;
    --text-primary: #f5f5f7;
    --text-secondary: #98989d;
    --bg-color: #000000;
    --container-bg: #1c1c1e;
    --border-color: #38383a;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    color: var(--text-primary);
    background-color: var(--bg-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Theme Toggle */
.theme-toggle-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.theme-toggle-btn {
    background: var(--container-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.theme-toggle-btn:hover {
    background: var(--border-color);
}

/* Header / App Info */
.app-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 30px;
}

.app-icon {
    width: 120px;
    height: 120px;
    border-radius: 28px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    object-fit: cover;
    display: block;
}

/* Theme based icon display */
html.dark-theme .light-icon {
    display: none !important;
}

html:not(.dark-theme) .dark-icon {
    display: none !important;
}

.app-details h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.app-details h2 {
    font-size: 18px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.download-btn {
    display: inline-block;
    background-color: var(--app-blue);
    color: white;
    font-weight: 600;
    font-size: 15px;
    padding: 8px 20px;
    border-radius: 20px;
    transition: background-color 0.2s;
}

.download-btn:hover {
    background-color: #005bb5;
    text-decoration: none;
}

/* Screenshots Gallery */
.screenshots-container {
    margin-bottom: 40px;
}

.screenshots-container h3 {
    font-size: 24px;
    margin-bottom: 20px;
}

.screenshot-gallery {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.screenshot-gallery img {
    height: 500px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    scroll-snap-align: center;
    /* Prevent default image drag to allow smooth gallery scrolling */
    -webkit-user-drag: none;
    user-select: none;
}

/* Custom scrollbar for gallery */
.screenshot-gallery::-webkit-scrollbar {
    height: 8px;
}
.screenshot-gallery::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}
.screenshot-gallery::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}
.screenshot-gallery::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}
.screenshot-gallery {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* Description Section */
.description-section {
    margin-bottom: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.description-section h3 {
    font-size: 24px;
    margin-bottom: 20px;
}

.description-content {
    font-size: 16px;
    color: var(--text-primary);
}

.description-content p {
    margin-bottom: 16px;
}

.description-content ul {
    margin-bottom: 16px;
    padding-left: 20px;
}

.description-content li {
    margin-bottom: 8px;
}

.description-content strong {
    font-weight: 600;
}

/* Reviews */
.reviews-section {
    margin-bottom: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.reviews-section h3 {
    font-size: 24px;
    margin-bottom: 20px;
}

.review-card {
    background-color: var(--container-bg);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 16px;
    transition: background-color 0.3s ease;
}

.review-text {
    font-style: italic;
    margin-bottom: 8px;
}

.review-author {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.footer-links a {
    color: var(--text-secondary);
    margin-left: 16px;
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* Pages Specific Styles */
.page-content {
    background-color: var(--container-bg);
    padding: 40px;
    border-radius: 24px;
    margin-top: 40px;
    transition: background-color 0.3s ease;
}

.page-content h1 {
    font-size: 32px;
    margin-bottom: 24px;
}

.page-content h2 {
    font-size: 20px;
    margin-top: 32px;
    margin-bottom: 16px;
}

.page-content p {
    margin-bottom: 16px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 24px;
    font-weight: 600;
}

.back-link::before {
    content: "←";
    margin-right: 8px;
}

@media (max-width: 600px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .app-icon {
        width: 100px;
        height: 100px;
    }
    .screenshot-gallery img {
        height: 400px;
    }
}