/* Custom CSS additions for park_theme */

/* Similar apps grid - always 4 per row on larger screens */
.similar-apps-grid {

    /* Search form styling */
    .search-form-container {
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
    }

    .hero-search {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        border-right: none;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .hero-search-btn {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
        min-width: 42px;
    }

    @media (max-width: 767px) {
        .hero-gradient {
            padding-top: 10px;
            padding-bottom: 10px;
        }

        .hero-search {
            height: 38px;
            font-size: 0.9rem;
        }

        .hero-search-btn {
            min-width: 42px;
            padding: 6px 10px;
        }

        .input-group-sm {
            max-width: calc(100% - 10px);
            margin: 0 auto;
        }
    }

    columns: repeat(2, 1fr);
}

@media (min-width: 576px) {
    .similar-apps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .similar-apps-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .similar-apps-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .similar-apps-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* App store buttons styling */
.app-store-btn,
.play-store-btn {
    white-space: nowrap !important;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-store-btn {
    background-color: #000000;
    color: #ffffff;
    border: 1px solid #000000;
}

.app-store-btn:hover {
    background-color: #333333;
    color: #ffffff;
}

.play-store-btn {
    background-color: #01875f;
    color: #ffffff;
    border: 1px solid #01875f;
}

.play-store-btn:hover {
    background-color: #016d4e;
    color: #ffffff;
}

.app-store-btn i,
.play-store-btn i {
    margin-right: 8px;
    font-size: 1.1em;
}

/* Load more button styling */
.load-more-btn {
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
    transition: all 0.3s ease;
    font-weight: 600;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 115, 232, 0.4);
}

/* No results styling */
.no-results {
    padding: 2rem;
    background-color: white;
    border-radius: var(--park-radius);
}

.no-results-icon {
    height: 100px;
    width: 100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--park-primary-light);
    border-radius: 50%;
    color: var(--park-primary);
}

.suggestion-tag {
    border-radius: 20px;
    padding: 6px 16px;
    transition: all 0.3s ease;
}

.suggestion-tag:hover {
    background-color: var(--park-primary);
    color: white;
    transform: scale(1.05);
}

.store-info {
    white-space: nowrap !important;
}

.app-stars-container {
    white-space: nowrap !important;
}

/* Search form styling */
.search-form-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.hero-search {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.hero-search-btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    min-width: 100px;
}

/* Sidebar styling */
.sidebar {
    position: sticky;
    top: 20px;
    z-index: 10;
}

.sidebar-apps .sidebar-app-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sidebar-apps .sidebar-app-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.sidebar-apps-more {
    max-height: 400px;
    overflow-y: auto;
    scroll-behavior: smooth;
    transition: all 0.5s ease;
}

#showMoreSidebarBtn {
    transition: all 0.3s ease;
    font-size: 0.85rem;
    padding: 4px 15px;
}

#showMoreSidebarBtn:hover {
    transform: translateY(-2px);
}

.show-less-text,
.show-more-text {
    display: inline-flex;
    align-items: center;
}

.show-less-text i,
.show-more-text i {
    margin-left: 5px;
}

/* App grid layout improvements */
.app-grid {
    display: grid;
    grid-gap: 16px;
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 767px) {

    /* App card optimization for mobile */
    .app-card {
        padding: 6px !important;
        border-radius: 10px !important;
        margin-bottom: 0 !important;
    }

    .app-card .app-card-img {
        width: 45px !important;
        height: 45px !important;
        margin-bottom: 5px;
        border-radius: 8px !important;
    }

    .app-card .app-card-title {
        font-size: 0.8rem !important;
        margin-bottom: 2px !important;
        line-height: 1.2 !important;
        max-height: 2.4em !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
    }

    .app-card .app-card-developer,
    .app-card .app-card-category {
        font-size: 0.65rem !important;
        margin-bottom: 1px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

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

    .app-card .app-stars i {
        font-size: 0.65rem !important;
    }

    .mobile-app-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.app-grid-4 {
    grid-template-columns: repeat(2, 1fr);
}

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

@media (min-width: 992px) {
    .app-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Improve responsive layout */
@media (max-width: 767px) {
    .col-lg-9 {
        margin-bottom: 2rem;
    }

    .sidebar {
        position: static;
    }

    /* Mobile search results specific */
    .mobile-search-title {
        font-size: 1.2rem;
        padding: 0 5px;
    }

    .mobile-container {
        width: 100%;
        max-width: 100%;
        padding-left: 5px;
        padding-right: 5px;
    }

    .mobile-content-col {
        padding-left: 2px;
        padding-right: 2px;
    }

    .mobile-app-grid {
        grid-gap: 6px;
    }

    .nowrap-title {
        white-space: nowrap;
        font-size: 1.2rem;
    }

    .search-results-header .search-result-count {
        align-self: flex-start;
        font-size: 0.8rem;
        padding: 4px 10px;
    }

    .app-section-container {
        padding: 10px;
    }

    /* Load More button optimization for mobile */
    .load-more-btn {
        padding: 8px 20px;
        border-radius: 20px;
        font-size: 0.9rem;
        width: 80%;
        max-width: 150px;
    }

    /* App page mobile optimizations */
    .mobile-app-header {
        padding: 15px;
        width: 100%;
        margin-bottom: 5px;
    }

    .mobile-app-icon-container {
        flex: 0 0 70px;
        margin-right: 20px;
    }

    .mobile-app-info {
        flex: 1;
        overflow: hidden;
        padding-top: 3px;
    }

    .mobile-app-info .app-hero-title {
        font-size: 1.1rem;
        line-height: 1.2;
        margin-bottom: 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .mobile-app-info .app-hero-developer {
        font-size: 0.8rem;
        margin-bottom: 5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-app-info .app-hero-rating {
        font-size: 0.8rem;
    }

    .mobile-app-info .app-stars i {
        font-size: 0.8rem;
    }

    .app-download-buttons-mobile {
        padding: 0 10px;
    }

    .app-download-buttons-mobile .btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .app-details-mobile {
        padding: 5px;
    }

    .app-detail-mobile-item {
        display: flex;
        background-color: #f8f9fa;
        border-radius: 10px;
        padding: 12px;
        height: 100%;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
        transition: all 0.2s ease;
    }

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

    .app-detail-mobile-icon {
        flex: 0 0 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        color: var(--park-primary);
        margin-right: 12px;
        background-color: rgba(var(--park-primary-rgb), 0.1);
        height: 32px;
        width: 32px;
        border-radius: 50%;
    }

    .app-detail-mobile-content {
        flex: 1;
        overflow: hidden;
    }

    .app-detail-mobile-label {
        font-size: 0.7rem;
        color: #666;
        margin-bottom: 3px;
        font-weight: 500;
    }

    .app-detail-mobile-value {
        font-size: 0.85rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .app-detail-mobile-value-link,
    .app-detail-mobile-value-link {
        font-size: 0.85rem;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Mobile sidebar optimization */
    .fs-mobile-title {
        font-size: 1.1rem;
    }

    .mobile-sidebar-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-gap: 8px;
    }

    .sidebar-app-item {
        margin-bottom: 10px !important;
    }

    #sidebarAppsMore {
        grid-column: span 2;
    }

    #showMoreSidebarBtn {
        padding: 2px 10px;
        font-size: 0.8rem;
        margin-top: 0;
    }
}

/* Developer page mobile styling */
@media (max-width: 767.98px) {
    .developer-hero-title {
        font-size: 1.2rem;
        line-height: 1.3;
        margin-bottom: 8px;
        padding: 0 15px;
        word-break: break-word;
        overflow-wrap: break-word;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        max-width: 100%;
    }
}