/* CSS Variables for theming */
:root {
    --bg-primary: #000000;
    --bg-secondary: #0d0d0d;
    --bg-card: #141414;
    --bg-screenshot: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-blue: #0071e3;
    --accent-blue-hover: #0077ed;
    --border-color: #2a2a2a;
    --button-bg: #0071e3;
    --button-text: #ffffff;
    --screenshot-frame: #2d2d2d;
}

[data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-screenshot: #f0f0f0;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --accent-blue: #0071e3;
    --accent-blue-hover: #0077ed;
    --border-color: #d2d2d7;
    --button-bg: #0071e3;
    --button-text: #ffffff;
    --screenshot-frame: #e0e0e0;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
}

/* Dotted canvas background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
    background-size: 16px 16px;
}

:root {
    --dot-color: rgba(255, 255, 255, 0.25);
}

[data-theme="light"] {
    --dot-color: rgba(0, 0, 0, 0.15);
}

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

/* Header */
.header {
    background-color: transparent;
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--border-color);
    z-index: 1;
}

.title {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.subtitle {
    font-size: 21px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.theme-toggle {
    position: absolute;
    top: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--bg-screenshot);
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
}

.sun-icon {
    display: none;
}

[data-theme="light"] .sun-icon {
    display: block;
}

[data-theme="light"] .moon-icon {
    display: none;
}

/* Main content */
.main {
    padding: 60px 0;
    background-color: transparent;
    position: relative;
    z-index: 1;
}

/* Search */
.search-container {
    margin-bottom: 40px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 14px 44px 14px 48px;
    font-size: 16px;
    font-family: inherit;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.clear-search {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.clear-search:hover {
    color: var(--text-primary);
    background-color: var(--bg-screenshot);
}

.clear-search.visible {
    display: flex;
}

.clear-search svg {
    width: 16px;
    height: 16px;
}

.search-results {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 12px;
    min-height: 20px;
}

.app-card.hidden {
    display: none;
}

.apps-list {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* App Card */
.app-card {
    background-color: var(--bg-card);
    border-radius: 20px;
    padding: 32px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.app-card:hover {
    border-color: var(--accent-blue);
}

.app-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

.app-icon {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 18px;
    overflow: hidden;
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

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

.app-name {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.app-description {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* App Store Button */
.appstore-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--button-bg);
    color: var(--button-text);
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.appstore-button:hover {
    background-color: var(--accent-blue-hover);
}

.appstore-button svg {
    width: 20px;
    height: 20px;
}

/* Screenshots */
.screenshots-container {
    position: relative;
    margin: 0 -32px -32px;
    padding: 0 32px 32px;
    overflow: hidden;
}

.screenshots-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 8px;
}

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

.screenshot {
    flex-shrink: 0;
    scroll-snap-align: start;
}

.screenshot-frame {
    width: 180px;
    height: 390px;
    background-color: var(--screenshot-frame);
    border-radius: 20px;
    padding: 6px;
}

.screenshot-img {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Footer */
.footer {
    background-color: transparent;
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

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

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 60px 0 40px;
    }

    .title {
        font-size: 32px;
    }

    .subtitle {
        font-size: 17px;
    }

    .theme-toggle {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }

    .main {
        padding: 40px 0;
    }

    .app-card {
        padding: 24px;
        border-radius: 16px;
    }

    .app-header {
        flex-wrap: wrap;
        gap: 16px;
    }

    .app-icon {
        width: 60px;
        height: 60px;
        border-radius: 14px;
    }

    .app-info {
        order: 3;
        width: 100%;
        flex: none;
    }

    .app-name {
        font-size: 20px;
    }

    .appstore-button {
        margin-left: auto;
    }

    .screenshots-container {
        margin: 0 -24px -24px;
        padding: 0 24px 24px;
    }

.screenshot-frame {
    width: 140px;
    height: 303px;
    border-radius: 18px;
}

.screenshot-img {
    border-radius: 14px;
}
}

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

    .app-card {
        padding: 20px;
    }

    .screenshots-container {
        margin: 0 -20px -20px;
        padding: 0 20px 20px;
    }

    .screenshot-frame {
        width: 120px;
        height: 260px;
        border-radius: 16px;
    }

    .screenshot-img {
        border-radius: 12px;
    }
}
