@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);
}

html, body {
    max-width: 100vw;
    overflow-x: hidden !important;
    width: 100%;
    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;
    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;
    -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.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.85rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.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: inline-flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: -0.5px;
    animation: fadeIn 0.8s ease-out;
}

.navbar-logo-img {
    height: 40px;
    max-width: 180px;
    object-fit: contain;
    vertical-align: middle;
}

/* 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 {
    width: 100%;
    margin: 1.25rem 0 1.5rem;
    position: relative;
    z-index: 10;
    padding: 0;
    box-sizing: border-box;
    animation: scaleIn 0.8s 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;
    width: 100%;
    box-sizing: border-box;
}

.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: 16px;
    font-family: 'Inter', sans-serif;
    outline: none;
    width: 100%;
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* App Grid & Container */
.container {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}

.app-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-bottom: 4rem;
    width: 100%;
}

/* App Card */
.app-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 24px;
    padding: 1.25rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.02);
    width: 100%;
    box-sizing: border-box;
}

.app-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 35px rgba(79, 70, 229, 0.12), 0 4px 10px rgba(0, 0, 0, 0.03);
}

.app-card:active {
    transform: scale(0.985);
}

.app-logo-wrapper {
    width: 76px;
    height: 76px;
    flex-shrink: 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 800;
}

.app-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.app-name {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.3px;
}

.app-meta {
    font-size: 0.88rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 500;
}

.meta-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.star-icon {
    color: #fbbf24;
    font-size: 0.92rem;
}

.shield-icon {
    color: #10b981;
    font-size: 0.92rem;
}

.app-actions {
    flex-shrink: 0;
    margin-left: auto;
}

.btn-download {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 0.75rem 1.6rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.98rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.38);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.48);
}

/* 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;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

.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);
    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); }
}

/* Mobile Responsive Layout Optimizations */
@media (max-width: 768px) {
    .container {
        padding: 0 0.85rem;
    }
    .search-container {
        padding: 0;
        margin: 1rem 0 1.2rem;
    }
    .search-input-wrapper {
        padding: 0.55rem 1.2rem;
    }
    .search-input {
        font-size: 15px;
        padding: 0.6rem 0;
    }
    .app-card {
        padding: 1rem 1.15rem;
        gap: 0.95rem;
        border-radius: 20px;
    }
    .app-logo-wrapper {
        width: 66px;
        height: 66px;
        border-radius: 16px;
        font-size: 1.7rem;
    }
    .app-name {
        font-size: 1.12rem;
    }
    .app-meta {
        font-size: 0.82rem;
    }
    .btn-download {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
        gap: 0.45rem;
    }
}

@media (max-width: 400px) {
    .container {
        padding: 0 0.6rem;
    }
    .search-container {
        padding: 0;
        margin: 0.85rem 0 1rem;
    }
    .app-card {
        padding: 0.85rem 0.9rem;
        gap: 0.75rem;
        border-radius: 18px;
    }
    .app-logo-wrapper {
        width: 58px;
        height: 58px;
        border-radius: 14px;
        font-size: 1.5rem;
    }
    .app-name {
        font-size: 1rem;
    }
    .app-meta {
        font-size: 0.76rem;
    }
    .btn-download {
        padding: 0.55rem 1rem;
        font-size: 0.82rem;
    }
}

/* Responsive Banner & Hero Optimizations */
@media (min-width: 640px) {
    .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) {
    .hero h1 { font-size: 3.5rem; }
    .hero p { font-size: 1.2rem; }
    .hero { padding: 5rem 2rem 6rem; }
}
