@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* GLOBAL STYLES */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f8f9fa; /* Light background for a clean look */
    color: #202124;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px 32px;
}

/* HEADER */
.app-header {
    position: sticky;
    top: 0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    z-index: 100;
    flex-wrap: wrap;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    height: 36px;
    width: auto;
    border-radius: 8px;
    object-fit: contain;
}

.app-header h1 {
    font-weight: 700;
    font-size: 1.4rem;
    color: #1a73e8;
    margin: 0;
    white-space: nowrap;
}

/* Search Bar */
.search-container {
    flex-grow: 1;
    max-width: 400px;
    margin-left: 24px;
}

.search-container input[type="search"] {
    width: 100%;
    padding: 10px 18px;
    font-size: 1rem;
    border: 1px solid #ddd;
    background-color: #f1f3f4;
    border-radius: 24px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-container input[type="search"]:focus {
    background-color: #fff;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

/* Navigation bar with tabs */
.nav-bar {
    display: flex;
    background: #fff;
    justify-content: center;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 60px; /* Adjust based on header height */
    z-index: 90;
}

.nav-tab {
    background: transparent;
    border: none;
    outline: none;
    font-weight: 500;
    padding: 14px 28px;
    font-size: 1rem;
    color: #5f6368;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: border-color 0.3s, color 0.3s;
    user-select: none;
    white-space: nowrap;
}

.nav-tab:hover {
    color: #1a73e8;
}

.nav-tab.active {
    color: #1a73e8;
    border-bottom: 3px solid #1a73e8;
}

/* Main Content */
main {
    margin-top: 16px;
}

main h2 {
    font-size: 1.5rem;
    font-weight: 500;
    color: #202124;
    margin-bottom: 24px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

/* App List Cards */
.app-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); /* Responsive grid */
    gap: 20px;
    justify-content: start;
}

.app-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Better shadow */
    text-align: center;
    transition: transform 0.2s, box-shadow 0.3s;
    padding: 10px;
    cursor: pointer;
}

.app-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(26, 115, 232, 0.2);
}

.app-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
}

.app-icon {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin: 10px auto;
    display: block;
    border-radius: 20%; /* Android App Icon Shape */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.app-card h3 {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 8px 0 0;
    color: #202124;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    width: 100%;
    padding: 0 5px;
    box-sizing: border-box;
}

/* App Detail Page */
.app-detail-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 0 20px;
}

.app-detail-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 24px;
}

.app-icon-detail {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 20%;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(26, 115, 232, 0.4);
}

.app-detail-info h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #202124;
    margin: 0 0 8px 0;
}

.app-detail-info p {
    color: #5f6368;
    font-size: 1rem;
    margin: 0;
}

.screenshots {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 0 0 16px 0;
    margin-bottom: 32px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    background: #f1f3f4; /* Subtle background for scroll area */
    border-radius: 4px;
    padding: 20px;
}

.screenshots img {
    flex: 0 0 auto;
    width: 150px;
    height: 260px;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: pointer;
}

/* Download Button */
.download-btn {
    display: block;
    margin: 0 auto 30px auto;
    background-color: #1a73e8;
    color: white;
    font-weight: 600;
    padding: 16px 40px;
    border-radius: 30px;
    text-decoration: none;
    transition: background-color 0.3s, box-shadow 0.3s;
    font-size: 1.1rem;
    box-shadow: 0 8px 24px rgba(26, 115, 232, 0.4);
    max-width: 250px;
    text-align: center;
}

.download-btn:hover {
    background-color: #135ab6;
    box-shadow: 0 10px 30px rgba(19, 90, 182, 0.6);
}

.description {
    font-size: 1rem;
    color: #5f6368;
    margin-bottom: 24px;
    white-space: pre-line;
}

/* Responsive Adjustments (Mobile First) */
@media (max-width: 600px) {
    .app-header {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
    }
    .logo-container {
        align-self: flex-start;
        margin-bottom: 10px;
    }
    .app-header h1 {
        font-size: 1.2rem;
    }
    .search-container {
        max-width: 100%;
        margin-left: 0;
    }
    .nav-bar {
        top: 120px; /* Adjust sticky position for mobile header height */
        overflow-x: auto;
        justify-content: flex-start;
    }
    .nav-tab {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .app-list {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on small screens */
        gap: 15px;
        padding: 0 5px;
    }
    .app-card {
        padding: 5px;
        border-radius: 12px;
    }
    .app-icon {
        width: 60px;
        height: 60px;
        margin: 8px auto;
    }
    .app-detail-container {
        padding: 0 10px;
    }
    .screenshots img {
        width: 110px;
        height: 180px;
    }
    .download-btn {
        font-size: 1rem;
        padding: 12px 28px;
    }
}