/* Modern APK Store Styling */
:root {
    --primary-color: #00C853;
    --primary-hover: #00A844;
    --bg-light: #F1F3F4;
    --card-bg-light: #FFFFFF;
    --text-light: #202124;
    --text-secondary-light: #5F6368;
    --border-light: #E0E0E0;
    
    --bg-dark: #121212;
    --card-bg-dark: #1E1E1E;
    --text-dark: #E8EAED;
    --text-secondary-dark: #9AA0A6;
    --border-dark: #303134;

    --transition: all 0.3s ease;
}

[data-theme='light'] {
    --bg: var(--bg-light);
    --card-bg: var(--card-bg-light);
    --text: var(--text-light);
    --text-secondary: var(--text-secondary-light);
    --border: var(--border-light);
}

[data-theme='dark'] {
    --bg: var(--bg-dark);
    --card-bg: var(--card-bg-dark);
    --text: var(--text-dark);
    --text-secondary: var(--text-secondary-dark);
    --border: var(--border-dark);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', 'Segoe UI', Tahoma, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    transition: var(--transition);
    line-height: 1.6;
}

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

/* Navbar */
.navbar {
    background-color: var(--card-bg);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: 1px solid var(--border);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

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

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

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    padding: 0.6rem 1rem;
    padding-right: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background-color: var(--bg);
    color: var(--text);
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0, 200, 83, 0.3);
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
}

/* Header & Logo */
.site-name-desktop {
    display: none;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

@media (min-width: 992px) {
    .site-name-desktop {
        display: inline-block;
    }
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* App Grid */
.app-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
}

/* Responsive Grid */
@media (min-width: 1024px) {
    .app-grid { grid-template-columns: repeat(4, 1fr); }
}

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

@media (max-width: 767px) {
    .app-grid { 
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
}

/* App Card */
.app-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0; /* Prevents flex children from overflowing */
    height: 100%;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.app-logo {
    width: 100px;
    height: 100px;
    border-radius: 22px;
    object-fit: cover;
    margin-bottom: 0.8rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    max-width: 100%;
}

.app-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.app-category {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.app-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 0.75rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

/* Banner Section */
.hero-banner {
    width: 100%;
    display: block;
    overflow: hidden;
    border-radius: 18px;
    margin-bottom: 0.2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.hero-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover; /* Cover is best for most dynamic banners, but user specifically asked for 'complete visible', so we'll use auto-scaling on <img>. */
}

@media (max-width: 768px) {
    .container {
        padding: 0.8rem 0.5rem;
    }
    .hero-banner {
        border-radius: 12px;
        margin-bottom: 0.2rem;
    }
}

.hero-banner h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Categories Sidebar/Row */
.category-pills {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding: 0.2rem 0;
    scrollbar-width: none;
}

.category-pill {
    padding: 0.5rem 1.2rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    white-space: nowrap;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Section Titles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.5rem 0 0.8rem;
}

.section-header h2 {
    font-size: 1.5rem;
    border-left: 5px solid var(--primary-color);
    padding-left: 10px;
}

.view-all {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Footer */
footer {
    background-color: var(--card-bg);
    padding: 0.5rem 5% 1rem;
    border-top: 1px solid var(--border);
    margin-top: 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.footer-logo {
    margin-bottom: 1.5rem;
}

.footer-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

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

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

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

.social-links {
    display: flex;
    gap: 1.5rem;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

.social-links a {
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    opacity: 0.9;
}

/* Mobile Sidebar Menu */
.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-only-download {
    display: none;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .hamburger {
        display: block;
    }
    .mobile-only-download {
        display: block;
        margin-bottom: 2rem;
    }
    .detail-right .card {
        display: none;
    }
}

/* Back to Top Button */
#back-to-top {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-size: 18px;
    border: none;
    outline: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.4);
}

#back-to-top:hover {
    background-color: var(--primary-hover);
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 200, 83, 0.5);
}

@media (max-width: 768px) {
    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        padding: 12px;
        font-size: 16px;
    }
}
