/**
 * MemeSubito - Stili Frontend
 */

/* Container */
.memesubito-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Logo */
.ms-logo {
    margin-bottom: 20px;
}

.ms-logo-img {
    max-height: 80px;
    width: auto;
}

.ms-logo-small {
    margin-bottom: 15px;
}

.ms-logo-img-small {
    max-height: 50px;
    width: auto;
}

/* Hero */
.ms-hero {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 20px;
}

.ms-title {
    font-size: 3.5rem;
    margin: 0 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wink {
    font-size: 3rem;
    animation: wink 2s ease-in-out infinite;
}

@keyframes wink {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-10deg); }
}

.domain {
    color: #888;
    font-size: 1.8rem;
    font-weight: 300;
}

.ms-subtitle {
    font-size: 1.4rem;
    color: #666;
    margin: 0;
    font-weight: 400;
}

/* Sezioni */
.ms-section-title {
    font-size: 1.6rem;
    margin-bottom: 25px;
    color: #333;
    font-weight: 700;
}

/* Categorie Grid */
.ms-categories {
    margin-bottom: 50px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 15px;
    border-radius: 18px;
    text-decoration: none;
    color: #333;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.category-card.all-cats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.category-card.all-cats:hover {
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.cat-emoji-lg {
    font-size: 3.5rem;
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.category-card:hover .cat-emoji-lg {
    transform: scale(1.1);
}

.cat-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.cat-count {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 8px;
    font-weight: 500;
}

/* Meme Grid */
.ms-memes {
    margin-bottom: 50px;
}

.memes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px 25px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.memes-filters {
    display: flex;
    align-items: center;
    gap: 15px;
}

.meme-count {
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
}

#meme-sort {
    padding: 10px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
}

#meme-sort:hover {
    border-color: #667eea;
}

#meme-sort:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.memes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.meme-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.meme-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.meme-image-wrap {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
}

.meme-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.meme-card:hover .meme-image-wrap img {
    transform: scale(1.08);
}

.meme-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.meme-card:hover .meme-overlay {
    opacity: 1;
}

.view-btn {
    padding: 14px 28px;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.view-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.meme-info {
    padding: 20px;
}

.meme-cat-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.meme-title {
    font-size: 1.15rem;
    margin: 0 0 15px;
    color: #333;
    line-height: 1.4;
    font-weight: 600;
}

.meme-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 25px;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.action-btn:hover {
    background: #e8e8e8;
    transform: translateY(-2px);
}

/* Paginazione */
.memes-pagination {
    display: flex;
    justify-content: center;
    margin-top: 50px;
    gap: 8px;
    flex-wrap: wrap;
}

.memes-pagination a,
.memes-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0 18px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.memes-pagination a {
    background: #f5f5f5;
    color: #333;
}

.memes-pagination a:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.memes-pagination .current {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.memes-pagination .prev,
.memes-pagination .next {
    padding: 0 25px;
}

/* No memes */
.no-memes {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 20px;
}

.no-emoji {
    font-size: 6rem;
    margin-bottom: 25px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.no-memes p {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 25px;
}

.no-memes .button {
    display: inline-block;
    padding: 14px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.no-memes .button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Torna all'Homepage */
.back-to-home {
    text-align: center;
    margin-top: 50px;
    padding: 30px;
}

.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 35px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}

.btn-back-home:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

/* Categorie Page */
.categories-grid-large {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

.category-card-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 45px 25px;
    border-radius: 22px;
    text-decoration: none;
    color: #333;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.category-card-large:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.cat-emoji-xl {
    font-size: 4.5rem;
    margin-bottom: 18px;
    transition: transform 0.3s ease;
}

.category-card-large:hover .cat-emoji-xl {
    transform: scale(1.15) rotate(-5deg);
}

.category-card-large h3 {
    margin: 0 0 12px;
    font-size: 1.4rem;
}

/* ==================== SINGLE MEME PAGE ==================== */

/* Breadcrumb */
.ms-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    flex-wrap: wrap;
}

.ms-breadcrumb a { 
    color: #666; 
    text-decoration: none; 
    transition: color 0.3s; 
}

.ms-breadcrumb a:hover { 
    color: #FFD93D; 
}

.ms-breadcrumb .sep { 
    color: #ccc; 
}

.ms-breadcrumb .current { 
    color: #333; 
    font-weight: 600; 
}

/* Single Meme */
.meme-single {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.1);
}

.meme-single-header { 
    text-align: center; 
    margin-bottom: 30px; 
}

.meme-single-title { 
    font-size: 2rem; 
    font-weight: 700; 
    margin: 15px 0 10px; 
    color: #2C3E50; 
}

.meme-single-desc { 
    font-size: 1.1rem; 
    color: #666; 
    margin: 0; 
}

.meme-single-image-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
}

.meme-single-image {
    max-width: 100%;
    max-height: 600px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.no-image-lg {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #999;
    background: #f5f5f5;
    border-radius: 8px;
}

.meme-single-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.action-btn-lg {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    background: linear-gradient(135deg, #FFD93D, #FF8C42);
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 140, 66, 0.4);
}

.meme-single-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.stat-item { 
    color: #666; 
    font-size: 0.95rem; 
}

.stat-item strong { 
    color: #333; 
}

.meme-related { 
    margin-top: 50px; 
}

/* ==================== ADS ==================== */
.ms-ads {
    margin: 20px 0;
    text-align: center;
}

.ms-ads-top {
    margin-bottom: 30px;
}

.ms-ads-bottom {
    margin-top: 30px;
}

/* ==================== CUSTOM PAGES ==================== */
.memesubito-custom-page {
    max-width: 900px;
    margin: 0 auto;
}

.ms-page-title {
    font-size: 2rem;
    margin-bottom: 25px;
    color: #333;
}

.ms-page-content {
    line-height: 1.8;
}

.ms-page-content p {
    margin-bottom: 1.5em;
}

.ms-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

/* ==================== RESPONSIVE ==================== */

/* Tablet */
@media (max-width: 992px) {
    .ms-title {
        font-size: 2.8rem;
    }
    
    .wink {
        font-size: 2.5rem;
    }
    
    .domain {
        font-size: 1.5rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .memes-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }
    
    .categories-grid-large {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .ms-logo-img {
        max-height: 60px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .memesubito-container {
        padding: 15px;
    }
    
    .ms-hero {
        padding: 30px 15px;
        margin-bottom: 15px;
    }
    
    .ms-title {
        font-size: 2.2rem;
        gap: 6px;
    }
    
    .wink {
        font-size: 2rem;
    }
    
    .domain {
        font-size: 1.2rem;
    }
    
    .ms-subtitle {
        font-size: 1.1rem;
    }
    
    .ms-categories {
        padding: 20px 15px;
        margin-bottom: 35px;
    }
    
    .ms-section-title {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .category-card {
        padding: 20px 10px;
    }
    
    .cat-emoji-lg {
        font-size: 2.5rem;
        margin-bottom: 8px;
    }
    
    .cat-name {
        font-size: 0.95rem;
    }
    
    .cat-count {
        font-size: 0.8rem;
    }
    
    .memes-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 18px;
        gap: 12px;
    }
    
    .memes-filters {
        width: 100%;
        justify-content: space-between;
    }
    
    #meme-sort {
        flex: 1;
        max-width: 150px;
    }
    
    .memes-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .meme-card {
        border-radius: 16px;
    }
    
    .meme-info {
        padding: 15px;
    }
    
    .meme-title {
        font-size: 1.05rem;
    }
    
    .action-btn {
        padding: 8px 14px;
        font-size: 0.9rem;
    }
    
    .memes-pagination {
        gap: 5px;
    }
    
    .memes-pagination a,
    .memes-pagination span {
        min-width: 38px;
        height: 38px;
        padding: 0 12px;
        font-size: 0.9rem;
    }
    
    .memes-pagination .prev,
    .memes-pagination .next {
        padding: 0 15px;
    }
    
    .no-memes {
        padding: 50px 15px;
    }
    
    .no-emoji {
        font-size: 4rem;
    }
    
    .no-memes p {
        font-size: 1.1rem;
    }
    
    .btn-back-home {
        padding: 14px 28px;
        font-size: 1rem;
    }
    
    .categories-grid-large {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .category-card-large {
        padding: 30px 15px;
    }
    
    .cat-emoji-xl {
        font-size: 3rem;
    }
    
    .category-card-large h3 {
        font-size: 1.1rem;
    }
    
    /* Single meme mobile */
    .meme-single { 
        padding: 20px; 
    }
    
    .meme-single-title { 
        font-size: 1.5rem; 
    }
    
    .meme-single-image { 
        max-height: 400px; 
    }
    
    .meme-single-actions { 
        flex-direction: column; 
        align-items: center; 
    }
    
    .action-btn-lg { 
        width: 100%; 
        max-width: 250px; 
        justify-content: center; 
    }
    
    .ms-logo-img {
        max-height: 50px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .ms-title {
        font-size: 1.8rem;
    }
    
    .wink {
        font-size: 1.6rem;
    }
    
    .domain {
        font-size: 1rem;
    }
    
    .ms-subtitle {
        font-size: 1rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .category-card {
        padding: 18px 8px;
        border-radius: 14px;
    }
    
    .cat-emoji-lg {
        font-size: 2rem;
    }
    
    .cat-name {
        font-size: 0.85rem;
    }
    
    .cat-count {
        font-size: 0.75rem;
    }
    
    .meme-actions {
        gap: 8px;
    }
    
    .action-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .ms-logo-img {
        max-height: 40px;
    }
}
