/* ESATTO COME IL VECCHIO MARKETPLACE */

.search-container {
    max-width: 600px;
    margin: 0 auto 3rem;
    position: relative;
}


/* Utility classes per mobile/desktop */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
    
    /* Nascondi i filtri su mobile */
    .filter-tabs {
        display: none !important;
    }
}

/* Marketplace description - stili originali */
.marketplace-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin: 0;
    line-height: 1.5;
}

.filter-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 0.5rem;
    margin: 1.5rem 0 2rem 0;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-weight: 500;
    font-size: 0.9rem;
}

.filter-tab:hover,
.filter-tab.active {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}


.section-title-alt {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: white;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem;
}

.app-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    text-decoration: none;
    color: inherit;
}

.app-card.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.app-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-info {
    flex: 1;
    min-width: 0;
}

.app-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    line-height: 1.3;
}

.app-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.8rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.8rem;
}

.app-badge {
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
    border-radius: 12px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0.1px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 24px;
}

.badge-type {
    background: #2196F3;
    color: white;
}

.badge-selfhosted {
    background: #607D8B;
    color: white;
}


.badge-featured {
    background: #FF9800;
    color: white;
}

.badge-coming-soon {
    background: #E91E63;
    color: white;
}

.badge-free {
    background: #4CAF50;
    color: white;
}

.badge-premium {
    background: #FFC107;
    color: #333;
}

.badge-new {
    background: #00BCD4;
    color: white;
}

/* Simple hover effect */
.app-badge:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* Responsive badge adjustments */
@media (max-width: 768px) {
    .app-badge {
        font-size: 0.7rem;
        padding: 0.35rem 0.6rem;
    }
    
    .app-badges {
        gap: 0.4rem;
        margin-top: 0.6rem;
    }
}

/* Featured Carousel Styles - Google Play Style */
.featured-section {
    margin-bottom: 3rem;
}

.featured-carousel-container {
    position: relative;
    overflow: hidden;
    padding: 0; /* Nessun padding, lo gestisce il container */
}

.featured-carousel {
    overflow: hidden;
}

.featured-track {
    display: flex;
    transition: transform 0.4s ease;
    gap: 1rem;
}

.featured-item {
    flex: 0 0 420px;
    min-width: 420px;
}

.featured-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: 420px; /* Molto più alto come Google Play */
    position: relative;
}

.featured-item-link:hover {
    text-decoration: none;
    color: inherit;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.featured-item-content {
    display: flex;
    flex-direction: column; /* Layout verticale come Google Play */
    height: 100%;
    position: relative;
}

.featured-item-image {
    width: 100%;
    height: 233px; /* Altezza calcolata per rapporto 1920:1067 con larghezza 420px */
    overflow: hidden;
    position: relative;
    border-radius: 16px 16px 0 0; /* Arrotondamento solo in alto per seguire il link container */
}

.featured-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Mostra l'immagine completa senza distorsioni */
    transition: transform 0.3s ease;
}

.image-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.featured-item-link:hover .featured-item-image img {
    transform: scale(1.03);
}

.featured-item-info {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    background: #9c4dff; /* Viola più chiaro dello sfondo come placeholder */
    position: relative;
    overflow: hidden;
    transition: background 0.8s ease;
}

.featured-item-info > * {
    position: relative;
    z-index: 1;
}

/* Overlay viola per il loading - copre tutto il box */
.featured-item-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #9c4dff;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.8s ease;
    border-radius: 16px;
}

.featured-item-link.color-loaded::after {
    opacity: 0;
}

.featured-badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
    display: flex;
    gap: 0.5rem;
}

.featured-badge,
.coming-soon-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

.featured-badge {
    background: #FF9800;
}

.coming-soon-badge {
    background: #E91E63;
}

.featured-item-desc {
    font-size: 1.2rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9); /* Testo bianco come Google Play */
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Solo 2 righe come Google Play */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    min-height: 42px; /* Altezza minima uguale al logo per allineamento */
}

.featured-item-app-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.featured-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    margin-left: 0.75rem;
    color: white; /* Testo bianco come Google Play */
    line-height: 1.3;
}

.featured-item-logo {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.featured-item-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-install-btn {
    padding: 0.7rem 1.2rem;
    background: rgba(255, 255, 255, 0.9); /* Pulsante bianco su sfondo scuro */
    color: #1976D2; /* Testo blu */
    border: none;
    border-radius: 20px; /* Più arrotondato come Google Play */
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0;
}

.featured-install-btn:hover {
    background: white; /* Completamente bianco al hover */
    color: #1565C0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Featured Section Header */
.featured-section-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0;
}

.featured-section-header .section-title-alt {
    margin-bottom: 0; /* Rimuovi margin bottom per allineamento */
}

.featured-nav-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.featured-nav-btn {
    width: 36px;
    height: 36px;
    border: 1px solid white;
    border-radius: 50%;
    background: transparent;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.featured-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: scale(1.05);
}

.featured-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

    .featured-nav-btn:disabled:hover {
        background: transparent;
        color: white;
    }

/* Coming Soon Ribbon */
.coming-soon-ribbon {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 120px;
    height: 120px;
    overflow: hidden;
    z-index: 2;
}

.coming-soon-ribbon::before {
    content: 'Coming Soon';
    position: absolute;
    bottom: 20px;
    right: -30px;
    width: 150px;
    height: 30px;
    background: #E91E63;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    line-height: 30px;
    transform: rotate(-45deg);
    transform-origin: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Doublegram Affiliate Banner */
.affiliate-banner {
    background: #3879d4;
    border-radius: 16px;
    padding: 2rem;
    margin: 3rem 0;
    box-shadow: 0 8px 32px rgba(56,121,212,0.3);
    position: relative;
    overflow: hidden;
}

.affiliate-banner-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.affiliate-banner-logo {
    flex-shrink: 0;
}

.affiliate-logo {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.affiliate-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.affiliate-banner-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.affiliate-banner-description {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.95);
    margin: 0;
    line-height: 1.4;
}

.affiliate-banner-validity {
    background: rgba(255,255,255,0.1);
    margin: 1.5rem -2rem -2rem -2rem;
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.9);
    font-style: italic;
    font-weight: 500;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.ton-highlight {
    display: inline-block;
    vertical-align: middle;
    font-weight: 600;
    color: white;
}

.ton-icon {
    width: 60px;
    height: 60px;
    vertical-align: middle;
}

.affiliate-banner-btn {
    background: rgba(255,255,255,0.95);
    color: #0098EA;
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    white-space: nowrap;
}

.marketplace-header {
    margin-bottom: 0;
}

.affiliate-banner-btn:hover {
    background: white;
    color: #0098EA;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    text-decoration: none;
}

@media (max-width: 768px) {
    .marketplace-title-alt {
        font-size: 2rem;
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
        padding: 0 0.5rem;
    }
    
    .filter-tabs {
        padding: 0 1rem;
    }
    
    .app-card {
        flex-direction: column;
        text-align: center;
    }
    
    .app-icon {
        align-self: center;
    }
    
    /* Mobile carousel adjustments */
    .featured-carousel-container {
        padding: 0; /* Nessun padding, lo gestisce il container */
    }
    
    .featured-section-header {
        padding: 0; /* Nessun padding anche su mobile per allineamento */
    }
    
    .featured-item {
        flex: 0 0 320px;
        min-width: 320px;
    }
    
    .featured-item-link {
        height: 360px; /* Altezza maggiore anche mobile */
    }
    
    .featured-item-content {
        flex-direction: column; /* Sempre verticale come desktop */
    }
    
    .featured-item-image {
        width: 100%;
        height: 178px; /* Altezza calcolata per rapporto 1920:1067 con larghezza 320px mobile */
    }
    
    .featured-item-info {
        padding: 1rem;
    }
    
    .featured-item-desc {
        font-size: 1rem; /* Più grande da mobile */
        margin-bottom: 0.8rem;
    }
    
    .featured-item-title {
        font-size: 1rem;
        margin-left: 0.6rem;
    }
    
    .featured-item-logo {
        width: 36px;
        height: 36px;
    }
    
    .featured-install-btn {
        padding: 0.6rem 1rem; /* Più piccolo da mobile */
        font-size: 0.8rem;
        border-radius: 20px;
    }
    
    
    .carousel-btn {
        width: 40px;
        height: 40px;
    }
    
    .carousel-prev {
        left: 5px;
    }
    
    .carousel-next {
        right: 5px;
    }
    
    /* Nascondi le frecce dello slider su mobile */
    .featured-section {
        margin-top: 2rem; /* Spazio tra descrizione e slider */
    }
    
    .featured-section-header {
        display: none; /* Nascondi completamente le frecce */
    }
    
    /* Mobile banner adjustments - più compatto */
    .affiliate-banner {
        padding: 1rem;
        margin: 3rem 0; /* Stesso margine delle altre sezioni */
        border-radius: 12px;
    }
    
    .affiliate-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .affiliate-logo {
        width: 60px;
        height: 60px;
    }
    
    .affiliate-banner-text {
        gap: 0.75rem;
    }
    
    .affiliate-banner-title {
        font-size: 1.3rem;
    }
    
    .affiliate-banner-description {
        font-size: 1rem;
    }
    
    .affiliate-banner-validity {
        font-size: 0.85rem;
        margin: 1rem -1rem -1rem -1rem;
        padding: 0.75rem 1rem;
    }
    
    .affiliate-banner-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* CTA Informazioni */
.info-cta {
    margin: 4rem 0 2rem 0;
    text-align: center;
    padding: 3rem 2rem;
    background: #8729ff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(135, 41, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.info-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.info-cta-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

.info-cta-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0 0 1rem 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.info-cta-description {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    margin: 0 0 2rem 0;
    line-height: 1.5;
}

.info-cta-btn {
    display: inline-flex;
    align-items: center;
    padding: 1rem 2rem;
    background: white;
    color: #8729ff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.info-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    text-decoration: none;
    color: #6a1b9a;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .info-cta {
        margin: 3rem 0 1.5rem 0;
        padding: 2rem 1.5rem;
    }
    
    .info-cta-title {
        font-size: 1.5rem;
    }
    
    .info-cta-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .info-cta-btn {
        padding: 0.9rem 1.8rem;
        font-size: 0.95rem;
    }
}