/* ===== CSS Variables / Design Tokens ===== */
:root {
    --background: #0a0a0a;
    --foreground: #fafafa;
    --card: #141414;
    --card-foreground: #fafafa;
    --primary: #10b981;
    --primary-foreground: #0a0a0a;
    --secondary: #1f1f1f;
    --secondary-foreground: #a1a1aa;
    --muted: #27272a;
    --muted-foreground: #71717a;
    --accent: #10b981;
    --accent-foreground: #0a0a0a;
    --border: #27272a;
    --ring: #10b981;
    --radius: 0.75rem;
    --gradient-start: #10b981;
    --gradient-end: #06b6d4;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

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

/* ===== Container ===== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== Background Animation ===== */
.bg-animation {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.bg-gradient {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(16, 185, 129, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(6, 182, 212, 0.1), transparent);
    animation: gradientPulse 8s ease-in-out infinite;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, black 40%, transparent 70%);
}

@keyframes gradientPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 0;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.header.scrolled {
    padding: 0.75rem 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--foreground);
}

.nav-link:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--foreground);
    transition: all 0.3s ease;
}

/* ===== Hero Section ===== */
.hero {
    padding: 10rem 0 6rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.gradient-text {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--muted-foreground);
    max-width: 600px;
    margin: 0 auto 2rem;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease 0.4s both;
}

.stat {
    text-align: center;
}

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

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

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-top: 0.25rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--primary-foreground);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--foreground);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--muted);
    border-color: var(--muted-foreground);
}

.btn-download {
    width: 100%;
    justify-content: center;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--primary-foreground);
    padding: 0.75rem 1.5rem;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* ===== Section Styles ===== */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--muted-foreground);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Features Section ===== */
.features {
    padding: 5rem 0;
}

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

.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.1);
}

.feature-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    margin-bottom: 1.25rem;
    color: var(--primary);
}

.feature-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-desc {
    font-size: 0.9rem;
    color: var(--muted-foreground);
    line-height: 1.6;
}

/* ===== Apps Section ===== */
.apps {
    padding: 5rem 0;
}

.search-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    align-items: center;
    justify-content: space-between;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    flex: 1;
    max-width: 400px;
    transition: border-color 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--primary);
}

.search-box svg {
    color: var(--muted-foreground);
    flex-shrink: 0;
}

.search-box input {
    border: none;
    background: transparent;
    color: var(--foreground);
    font-size: 0.95rem;
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: var(--muted-foreground);
}

.filter-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tag {
    padding: 0.5rem 1rem;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: all 0.3s ease;
}

.filter-tag:hover,
.filter-tag.active {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

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

/* ===== App Card ===== */
.app-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.4s ease;
    opacity: 1;
    transform: scale(1);
}

.app-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 20px 50px rgba(16, 185, 129, 0.15);
}

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

.app-thumbnail {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--secondary);
}

.app-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.app-card:hover .app-thumbnail img {
    transform: scale(1.05);
}

.app-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--primary-foreground);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.app-content {
    padding: 1.25rem;
}

.app-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-desc {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.app-tag {
    padding: 0.25rem 0.6rem;
    background: var(--secondary);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground);
}

.app-mod {
    padding: 0.25rem 0.6rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary);
}

/* ===== About Section ===== */
.about {
    padding: 5rem 0;
    background: linear-gradient(180deg, transparent, rgba(16, 185, 129, 0.02), transparent);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    color: var(--muted-foreground);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.about-text .section-title {
    text-align: left;
    margin-bottom: 1.5rem;
}

.about-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.about-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--foreground);
    font-weight: 500;
}

.about-feature svg {
    color: var(--primary);
    flex-shrink: 0;
}

.about-image {
    display: flex;
    justify-content: center;
}

.about-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem;
    text-align: center;
    max-width: 350px;
}

.about-card-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    color: var(--primary);
}

.about-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.about-card p {
    font-size: 0.9rem;
    color: var(--muted-foreground);
}

/* ===== Footer ===== */
.footer {
    padding: 4rem 0 2rem;
    background: var(--card);
    border-top: 1px solid var(--border);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand .logo {
    margin-bottom: 1rem;
}

.footer-desc {
    color: var(--muted-foreground);
    font-size: 0.9rem;
    max-width: 300px;
}

.footer-links h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--foreground);
}

.footer-links a {
    display: block;
    color: var(--muted-foreground);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
}

.copyright {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.credits {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.uploader {
    color: var(--primary);
    font-weight: 600;
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--primary-foreground);
    border-radius: 50%;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
    z-index: 90;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.6s ease both;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease both;
}

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Animation for Grid Items */
.apps-grid .app-card {
    opacity: 0;
    transform: translateY(30px);
}

.apps-grid .app-card.animate {
    animation: fadeInUp 0.5s ease forwards;
}

.apps-grid .app-card:nth-child(1) { animation-delay: 0.1s; }
.apps-grid .app-card:nth-child(2) { animation-delay: 0.15s; }
.apps-grid .app-card:nth-child(3) { animation-delay: 0.2s; }
.apps-grid .app-card:nth-child(4) { animation-delay: 0.25s; }
.apps-grid .app-card:nth-child(5) { animation-delay: 0.3s; }
.apps-grid .app-card:nth-child(6) { animation-delay: 0.35s; }
.apps-grid .app-card:nth-child(7) { animation-delay: 0.4s; }
.apps-grid .app-card:nth-child(8) { animation-delay: 0.45s; }
.apps-grid .app-card:nth-child(9) { animation-delay: 0.5s; }
.apps-grid .app-card:nth-child(10) { animation-delay: 0.55s; }
.apps-grid .app-card:nth-child(11) { animation-delay: 0.6s; }
.apps-grid .app-card:nth-child(12) { animation-delay: 0.65s; }

/* ===== Mobile Menu ===== */
.nav.mobile-open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--card);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    gap: 0;
}

.nav.mobile-open .nav-link {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.nav.mobile-open .nav-link:last-child {
    border-bottom: none;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-text .section-title {
        text-align: center;
    }
    
    .about-text {
        text-align: center;
    }
    
    .about-features {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .hero {
        padding: 8rem 0 4rem;
        min-height: auto;
    }
    
    .hero-stats {
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .search-filter {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: none;
    }
    
    .filter-tags {
        justify-content: center;
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .footer-desc {
        max-width: none;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .about-features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
}

/* ===== Loading State ===== */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ===== Selection Style ===== */
::selection {
    background: rgba(16, 185, 129, 0.3);
    color: var(--foreground);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted-foreground);
}
