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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 8px;
    background-color: white;
    min-height: 100vh;
}

.header {
    text-align: center;
    padding: 15px 8px;
    border: 2px solid #ddd;
    margin-bottom: 15px;
    background-color: #fff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.header h1 {
    font-size: 1.3rem;
    color: #333;
}

[data-ad-status="unfilled"] {
    display: none !important;
}

.search-container {
    display: flex;
    gap: 8px;
    margin: 15px 0;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.search-input:focus {
    border-color: #007bff;
}

.search-button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
}

.search-button:hover {
    background-color: #0056b3;
}

.rankings, .editors-choices {
    margin: 20px 0;
}

.rankings h2, .editors-choices h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: #333;
    font-weight: 600;
}

/* Tab Styles */
.tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 15px;
}

.tab-button {
    flex: 1;
    padding: 10px 15px;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background-color: #f8f9fa;
}

.tab-button:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

.tab-content {
    position: relative;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.app-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background-color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    border: 1px solid #eee;
}

.app-item:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.app-rank {
    font-size: 1rem;
    font-weight: bold;
    margin-right: 4px;
    color: #666;
    min-width: 20px;
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    margin-right: 10px;
    object-fit: cover;
}

.app-info {
    flex: 1;
}

.app-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    line-height: 1.2;
}

.app-developer {
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 2px;
}

.app-category {
    font-size: 0.65rem;
    color: #999;
}

.app-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    color: #666;
    margin-top: 2px;
}

.rating-star {
    color: #ffa500;
}

.app-grid-horizontal {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.editor-app {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    border: 1px solid #eee;
}

.editor-app:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.editor-app-icon {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.editor-app-info {
    padding: 8px;
}

.editor-app-title {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 3px;
    line-height: 1.2;
}

.editor-app-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    color: #666;
}

/* App Detail Page Styles */

.app-detail-container {
    border: 2px solid #ddd;
    padding: 15px;
    background-color: #fff;
    margin-bottom: 15px;
    border-radius: 12px;
}

.app-detail-top {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.app-detail-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: cover;
}

.app-detail-info {
    flex: 1;
}

.app-detail-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
}

.app-detail-developer {
    color: #007bff;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.app-detail-category {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.app-detail-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rating-number {
    font-size: 1rem;
    font-weight: 500;
}

.rating-stars {
    color: #ffa500;
    font-size: 0.9rem;
}

.rating-count {
    color: #666;
    font-size: 0.8rem;
}

.app-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
    text-align: center;
}

.stat-item {
    padding: 8px;
}

.stat-label {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
}

.install-button {
    width: 100%;
    padding: 12px;
    background-color: #00875a;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin: 15px 0;
}

.install-button:hover {
    background-color: #006644;
}

.app-description {
    margin: 15px 0;
}

.app-description p {
    line-height: 1.5;
    color: #555;
    font-size: 0.85rem;
}

.back-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.back-button:hover {
    background-color: #0056b3;
}

@media (max-width: 400px) {
    .container {
        max-width: 100%;
        padding: 5px;
    }

    .header {
        padding: 10px 5px;
        margin-bottom: 10px;
    }

    .header h1 {
        font-size: 1.1rem;
    }


    .search-container {
        margin: 10px 0;
        gap: 5px;
    }

    .search-input {
        padding: 8px 12px;
        font-size: 13px;
    }

    .search-button {
        padding: 8px 15px;
        font-size: 13px;
    }

    .rankings, .editors-choices {
        margin: 15px 0;
    }

    .rankings h2, .editors-choices h2 {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .app-grid {
        gap: 8px;
    }

    .app-item {
        padding: 6px;
    }

    .app-icon {
        width: 64px;
        height: 64px;
        margin-right: 8px;
    }

    .app-rank {
        margin-right: 4px;
        font-size: 0.9rem;
    }

    .app-title {
        font-size: 0.8rem;
    }

    .app-developer {
        font-size: 0.65rem;
    }

    .app-category {
        font-size: 0.6rem;
    }

    .app-rating {
        font-size: 0.65rem;
    }

    .app-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .app-grid-horizontal {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .editor-app-info {
        padding: 6px;
    }

    .editor-app-title {
        font-size: 0.75rem;
    }

    .editor-app-rating {
        font-size: 0.65rem;
    }

    .app-detail-header {
        padding: 8px;
        margin-bottom: 10px;
    }

    .app-detail-container {
        padding: 10px;
        margin-bottom: 10px;
    }

    .app-detail-top {
        gap: 10px;
        margin-bottom: 10px;
        padding-bottom: 10px;
    }

    .app-detail-icon {
        width: 60px;
        height: 60px;
    }

    .app-detail-title {
        font-size: 1rem;
    }

    .app-detail-stats {
        gap: 8px;
        margin: 10px 0;
    }

    .stat-item {
        padding: 6px;
    }

    .install-button {
        padding: 10px;
        margin: 10px 0;
        font-size: 0.9rem;
    }

    .app-description {
        margin: 10px 0;
    }
}

/* Footer Styles */
.footer {
    margin-top: 30px;
    padding: 20px 15px;
    background-color: #f8f9fa;
    border-top: 2px solid #eee;
}

.footer-section {
    margin-bottom: 20px;
}

.footer-section:last-child {
    margin-bottom: 0;
}

.footer-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-section p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 8px;
}

.footer-section p:last-child {
    margin-bottom: 0;
}

@media (max-width: 400px) {
    .footer {
        margin-top: 20px;
        padding: 15px 10px;
    }

    .footer-section {
        margin-bottom: 15px;
    }

    .footer-section h3 {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .footer-section p {
        font-size: 0.8rem;
    }
}
