:root {
    --primary-color: #F686ED;
    --primary-light: #F9A8F4;
    --primary-dark: #E879F9;
    --primary-bg: rgba(246, 134, 237, 0.1);
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    
    --primary-bg: rgba(246, 134, 237, 0.15);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(var(--bg-primary), 0.8);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

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

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

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

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

.sun-icon {
    display: none;
}

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

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

.hero {
    padding: 120px 0 80px;
    text-align: center;
    background: linear-gradient(180deg, var(--primary-bg) 0%, transparent 100%);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

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

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 48px;
}

.apps-section {
    padding: 80px 0;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.app-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.app-screenshot {
    width: 100%;
    aspect-ratio: 6/4;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.app-banner {
    width: 100%;
    aspect-ratio: 6/4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-banner .banner-icon {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-banner .banner-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-banner.banner-fallback {
    background: var(--bg-tertiary);
    font-size: 48px;
}

.banner-emoji {
    font-size: 56px;
    line-height: 1;
}

.icon-emoji {
    font-size: 28px;
    line-height: 1;
}

.app-tag {
    flex-shrink: 0;
    padding: 3px 10px;
    background: var(--primary-bg);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

.platform-chip {
    padding: 3px 10px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
}

.filter-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 480px;
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.chip {
    padding: 7px 18px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.chip.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-links-row {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.footer-links-row a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

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

.app-content {
    padding: 20px;
}

.app-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.app-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 0;
}

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

.app-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

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

.app-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.app-version {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.app-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.meta-tag svg {
    width: 12px;
    height: 12px;
}

.app-actions {
    display: flex;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--primary-bg);
    color: var(--primary-color);
}

.features {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    transition: all var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    background: var(--primary-bg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
}

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer {
    padding: 60px 0 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 12px;
}

.footer-links h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-links a {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 6px 0;
    transition: color var(--transition-fast);
}

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

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

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

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
}

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

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--text-secondary);
    z-index: 10;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--primary-bg);
    color: var(--primary-color);
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
    max-height: 90vh;
}

.modal-screenshot {
    width: 100%;
    aspect-ratio: 6/4;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    background: var(--bg-tertiary);
}

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

.modal-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 0;
}

.modal-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-icon svg {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.modal-version {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.modal-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 24px;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.modal-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.modal-meta-item svg {
    width: 16px;
    height: 16px;
    color: var(--primary-color);
}

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

.platform-selector {
    margin-bottom: 24px;
}

.platform-selector label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.platform-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.platform-btn {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.platform-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.platform-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-bg);
    color: var(--primary-color);
}

.app-features {
    margin-bottom: 20px;
}

.features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feature-tag {
    padding: 6px 12px;
    background: var(--primary-bg);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .nav-links {
        gap: 16px;
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-stats {
        gap: 32px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
    }
    
    .app-card {
        margin: 0 8px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-body {
        padding: 24px;
    }
    
    .modal-screenshot {
        height: 200px;
    }
    
    .modal-header {
        flex-direction: column;
        text-align: center;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .hero {
        padding: 80px 0 40px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.25rem;
        margin-bottom: 32px;
    }
    
    .apps-section,
    .features {
        padding: 48px 0;
    }
    
    .feature-card {
        padding: 24px;
    }
    
    .footer {
        padding: 40px 0 16px;
    }
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --text-muted: #64748b;
        
        --border-color: #334155;
        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
        
        --primary-bg: rgba(246, 134, 237, 0.15);
    }
}
