body {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0;
    background-color: #f5f5f5;
}

/* --- HEADER --- */
header {
    background-color: #fff;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

#logo {
    height: 28px;
    width: auto;
}

.search-container {
    display: flex;
    align-items: center;
    background-color: #f1f3f4;
    border-radius: 22px;
    padding: 6px 12px;
    width: 100%;
    max-width: 500px;
    margin-left: 16px;
}

#search-bar {
    flex: 1;
    border: none;
    background: none;
    font-size: 15px;
    outline: none;
}

#search-button {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    color: #5f6368;
}

/* --- APP GRID --- */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    padding: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.app-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.app-card h3 {
    font-size: 15px;
    font-weight: 500;
    margin: 0 0 8px;
    text-align: center;
    white-space: normal; /* Allow text to wrap */
    word-break: break-word; /* Break long words if necessary */
    overflow: visible; /* Ensure text is not clipped */
    width: 100%;
    line-height: 1.4; /* Improve readability */
}

.app-card p {
    font-size: 13px;
    color: #5f6368;
    margin: 0;
    overflow: visible; /* Ensure text is not clipped */
}

/* --- PAGINATION --- */
#pagination-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
    text-align: center;
}

.pagination {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.pagination-button {
    background: #1a73e8;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.pagination-button:hover:not(:disabled) {
    background: #1557b0;
}

.pagination-button:disabled {
    background: #e8eaed;
    color: #80868b;
    cursor: not-allowed;
}

.pagination span {
    font-size: 14px;
    color: #3c4043;
}

/* --- APP DETAILS --- */
.app-details {
    max-width: 600px;
    margin: 16px auto;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.app-details.visible {
    display: block;
}

.app-details-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
}

.app-details h2 {
    font-size: 22px;
    font-weight: 500;
    margin: 0;
    text-align: center;
}

.app-details p {
    font-size: 14px;
    color: #3c4043;
    margin: 8px 0;
    line-height: 1.5;
}

.app-details .app-description {
    font-size: 14px;
    color: #3c4043;
    margin: 8px 0;
    line-height: 1.5;
}

.app-details .app-description p {
    margin: 4px 0;
}

.app-details .app-description ul {
    margin: 8px 0;
    padding-left: 20px;
}

.app-details .app-description li {
    margin: 4px 0;
    line-height: 1.5;
}

.app-details .install-button {
    background: #00c853;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin: 12px 0;
    width: 100%;
    max-width: 200px;
}

.app-details .install-button:hover {
    background: #00a846;
}

.back-button {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #1a73e8;
    font-weight: 500;
    margin-bottom: 12px;
}

/* --- STATUS MESSAGE --- */
.status-message {
    text-align: center;
    padding: 12px;
    font-size: 14px;
    color: #202124;
    margin: 8px auto;
    max-width: 1200px;
}

.status-message.loading {
    color: #1a73e8;
}

.status-message.success {
    color: #00c853;
}

.status-message.error {
    color: #d93025;
}

.hidden {
    display: none;
}

/* --- CATEGORIES --- */
.categories-footer {
    background: #fff;
    padding: 20px 16px;
    margin: 16px auto;
    max-width: 1200px;
    border-radius: 12px; /* Rounded corners */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* Softer shadow */
    position: sticky;
    bottom: 16px;
    z-index: 10;
}

.categories-footer h4 {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 12px;
    color: #202124;
    padding-left: 8px;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    background: #f1f3f4;
    color: #1a73e8;
    padding: 8px 16px; /* Increased padding for better touch targets */
    border-radius: 20px; /* More rounded chips */
    font-size: 13px;
    font-weight: 500;
    margin: 4px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.category-chip:hover {
    background: #e8eaed;
    transform: translateY(-1px); /* Subtle lift on hover */
}

.category-chip.active {
    background: #1a73e8;
    color: #fff;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 600px) {
    .app-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
        padding: 8px;
    }

    .app-card {
        padding: 12px;
    }

    .app-card h3 {
        font-size: 14px;
        line-height: 1.3;
    }

    .app-card p {
        font-size: 12px;
    }

    .search-container {
        margin-left: 8px;
        padding: 4px 8px;
    }

    #search-bar {
        font-size: 14px;
    }

    .app-details h2 {
        font-size: 20px;
    }

    .app-details p {
        font-size: 13px;
    }

    .app-details .app-description {
        font-size: 13px;
    }

    .pagination-button {
        padding: 6px 12px;
        font-size: 13px;
    }

    .categories-footer {
        padding: 16px 8px;
        margin: 8px auto;
        border-radius: 8px;
    }

    .category-chip {
        padding: 6px 12px;
        font-size: 12px;
    }
}
