@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #ec4899;
    --accent: #8b5cf6;
    --bg-color: #f8fafc;
    --bg-secondary: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

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

body {
    background-color: var(--bg-color);
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(236, 72, 153, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
    /* Optimizing rendering for mobile */
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

p {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.6rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.5px;
    animation: fadeIn 1s ease-out;
}

/* Hero Section */
.hero {
    padding: 3rem 1rem 4rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #0f172a, #334155);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: slideUp 0.8s ease-out;
}

.hero p {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
    animation: slideUp 1s ease-out;
    padding: 0 0.5rem;
}

/* Search Bar */
.search-container {
    max-width: 600px;
    margin: -2rem auto 2rem;
    position: relative;
    z-index: 10;
    padding: 0 1rem;
    animation: scaleIn 1s ease-out;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.5rem 1.2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    transform: translateY(-2px);
}

.search-icon {
    color: var(--primary);
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.8rem 0;
    color: var(--text-main);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    /* Prevent zoom on mobile iOS */
    font-size: 16px;
}

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

/* App Grid */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}


.app-grid {
    display: grid;
    /* Mobile-first: single column or compact two column */
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-bottom: 4rem;
}

/* App Card */
.app-card {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.app-card:active {
    transform: scale(0.98);
}

.app-logo-wrapper {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, #f1f5f9, #ffffff);
}

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

.app-logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.app-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.app-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: var(--text-main);
}

.app-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.star-icon {
    color: #fbbf24;
}

.shield-icon {
    color: #10b981;
}

.app-actions {
    flex-shrink: 0;
}

.btn-download {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.6rem 1.2rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-disabled {
    background: #f1f5f9;
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    grid-column: 1 / -1;
    display: none;
    animation: fadeIn 0.5s ease;
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px dashed #cbd5e1;
}

.empty-state.active {
    display: block;
}

.empty-state i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
    display: block;
}

.empty-state h3 {
    font-size: 1.3rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    padding: 2.5rem 1.5rem;
    text-align: center;
    margin-top: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.footer-disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 1.5rem auto 0;
    opacity: 0.8;
    line-height: 1.5;
}

/* Cookie Banner for Compliance */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--glass-border);
    padding: 1.2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 1050;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Ensure it works well on mobile */
    padding-bottom: max(1.2rem, env(safe-area-inset-bottom));
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.cookie-icon {
    font-size: 1.8rem;
    color: var(--primary);
}

.cookie-content p {
    font-size: 0.85rem;
    margin: 0;
    color: var(--text-main);
}

.cookie-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.cookie-actions {
    display: flex;
    gap: 0.8rem;
    width: 100%;
}

.btn-cookie {
    border: none;
    padding: 0.8rem;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    flex: 1;
}

.btn-cookie-outline {
    background: #f1f5f9;
    color: var(--text-main);
}

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Tablet & Desktop Enhancements */
@media (min-width: 640px) {
    .app-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cookie-banner {
        flex-direction: row;
        bottom: 20px;
        left: 20px;
        right: 20px;
        border-radius: 16px;
        border: 1px solid var(--glass-border);
    }

    .cookie-content {
        flex-direction: row;
        text-align: left;
    }

    .cookie-actions {
        width: auto;
    }
}

@media (min-width: 1024px) {
    .app-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .hero p {
        font-size: 1.2rem;
    }

    .hero {
        padding: 5rem 2rem 6rem;
    }
}