:root {
    --primary: #6C3CE1;
    --primary-light: #8B5CF6;
    --secondary: #06B6D4;
    --accent: #F59E0B;
    --bg-dark: #0A0A0F;
    --bg-card: #12121A;
    --bg-glass: rgba(255,255,255,0.04);
    --border: rgba(255,255,255,0.08);
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --ipa-color: #007AFF;
    --apk-color: #3DDC84;
    --gradient-hero: linear-gradient(135deg, #6C3CE1 0%, #06B6D4 100%);
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-km: 'Kantumruy Pro', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); }
.km { font-family: var(--font-km) !important; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* Navbar */
.navbar {
    position: fixed; width: 100%; top: 0; z-index: 1000;
    padding: 1rem 2rem; display: flex; justify-content: space-between;
    align-items: center; transition: all 0.3s ease;
}
.navbar.scrolled {
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    background: rgba(10, 10, 15, 0.8); border-bottom: 1px solid var(--border);
}
.navbar-brand { font-size: 1.5rem; font-weight: 700; background: var(--gradient-hero); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.navbar-nav { display: flex; gap: 2rem; align-items: center; }
.nav-link { font-weight: 500; position: relative; padding-bottom: 5px; }
.nav-link::after { content: ''; position: absolute; width: 0; height: 2px; bottom: 0; left: 0; background: var(--secondary); transition: width 0.3s; }
.nav-link:hover::after { width: 100%; }
.lang-toggle { cursor: pointer; background: var(--bg-glass); border: 1px solid var(--border); padding: 0.5rem 1rem; border-radius: 20px; color: var(--text-primary); }

/* Hero Section */
.hero {
    min-height: 80vh; display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center; position: relative; padding: 6rem 1rem 3rem;
    overflow: hidden;
}
.hero-title { font-size: 3.5rem; margin-bottom: 1rem; position: relative; z-index: 2; }
.hero-subtitle { font-size: 1.25rem; color: var(--text-secondary); margin-bottom: 2rem; z-index: 2; position: relative; }

/* Search Bar */
.search-container {
    position: relative; width: 100%; max-width: 600px; margin: 0 auto; z-index: 10;
}
.search-input {
    width: 100%; padding: 1rem 2rem; border-radius: 30px; border: 1px solid var(--border);
    background: var(--bg-glass); color: white; font-size: 1.1rem; outline: none; transition: width 0.4s ease;
    backdrop-filter: blur(10px);
}
.search-input:focus { border-color: var(--primary-light); background: rgba(255,255,255,0.08); }
.search-results {
    position: absolute; top: 100%; left: 0; width: 100%; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 12px; margin-top: 0.5rem;
    display: none; flex-direction: column; overflow: hidden; max-height: 300px; overflow-y: auto;
    backdrop-filter: blur(15px);
}
.search-item { padding: 1rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 1rem; }
.search-item:hover { background: var(--bg-glass); }

/* Stats */
.hero-stats { display: flex; gap: 2rem; margin-top: 3rem; z-index: 2; position: relative; }
.stat-box { background: var(--bg-glass); padding: 1.5rem 2rem; border-radius: 12px; border: 1px solid var(--border); }
.stat-num { font-size: 2rem; font-weight: 700; color: var(--secondary); }

/* App Grid */
.section-title { font-size: 2rem; margin-bottom: 2rem; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 2rem; }
.section { padding: 4rem 0; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.app-card {
    background: var(--bg-card); border-radius: 16px; border: 1px solid var(--border);
    padding: 1.5rem; display: flex; flex-direction: column; color: white;
    transition: transform 0.3s, box-shadow 0.3s;
    opacity: 0; transform: translateY(40px); /* For animation */
}
.app-card.visible { opacity: 1; transform: translateY(0); }
.app-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.5); border-color: var(--primary-light); }
.app-icon { width: 80px; height: 80px; border-radius: 16px; object-fit: cover; margin-bottom: 1rem; }
.app-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-meta { display: flex; gap: 0.5rem; color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 1rem; flex-wrap: wrap; }
.badge { padding: 0.25rem 0.5rem; border-radius: 6px; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; }
.badge-ipa { color: var(--ipa-color); background: rgba(0, 122, 255, 0.1); border: 1px solid var(--ipa-color); }
.badge-apk { color: var(--apk-color); background: rgba(61, 220, 132, 0.1); border: 1px solid var(--apk-color); }

.btn {
    display: inline-flex; justify-content: center; align-items: center; gap: 0.5rem;
    padding: 0.8rem 1.5rem; border-radius: 8px; font-weight: 600; cursor: pointer;
    border: none; transition: all 0.3s; position: relative; overflow: hidden; text-align: center;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); transform: scale(1.04); }
.btn-block { width: 100%; }

/* Categories */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.cat-card {
    background: var(--bg-card); padding: 1.5rem; border-radius: 12px; border: 1px solid var(--border);
    text-align: center; transition: all 0.3s; display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.cat-card:hover { transform: translateY(-5px); border-color: var(--secondary); background: var(--bg-glass); }
.cat-icon { font-size: 2.5rem; }

/* Responsive */
@media (max-width: 768px) {
    .navbar-nav { display: none; }
    .hero-title { font-size: 2.5rem; }
    .hero-stats { flex-direction: column; gap: 1rem; }
}

/* Detail Page */
.detail-header { display: flex; gap: 2rem; background: var(--bg-card); border-radius: 16px; padding: 2rem; border: 1px solid var(--border); margin-top: 6rem; align-items: center; }
@media (max-width: 768px) { .detail-header { flex-direction: column; text-align: center; } }
.detail-icon { width: 120px; height: 120px; border-radius: 24px; }
.detail-info { flex: 1; }
.detail-download { width: 300px; }
@media (max-width: 768px) { .detail-download { width: 100%; } }

.app-screenshot { width: 100%; border-radius: 12px; height: 300px; object-fit: cover; }
.screenshot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; }
.tabs { display: flex; gap: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab { padding: 0.5rem 1rem; cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { border-color: var(--primary); color: var(--primary); }

.spinner { border: 3px solid rgba(255,255,255,0.3); border-top: 3px solid white; border-radius: 50%; width: 20px; height: 20px; animation: spin 1s linear infinite; display: none; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
