/* Meme Archive Page Styles */

.archive-header {
    text-align: center;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 0 0 2rem 0;
    position: relative;
    display: block;
}

.archive-title {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 0.5rem;
    text-align: center;
}

.archive-description {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
    text-align: center;
}

.emoji-count {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: #007bff;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    z-index: 10;
}

/* Meme Grid Styles */
.sticker-grid {
    display: grid;
    gap: 20px;
    margin: 0;
    justify-content: center;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.sticker-item {
    width: 100%;
    aspect-ratio: 1/1;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.sticker-item:hover {
    transform: translateY(-10px) scale(1.08);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.sticker-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

@media (min-width: 769px) {
    .sticker-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        text-decoration: none;
    }
}

@media (max-width: 768px) {
    .sticker-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        text-decoration: none;
        padding: 1rem;
        box-sizing: border-box;
    }
}

.sticker-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sticker-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sticker-placeholder {
    font-size: 3rem;
    line-height: 1;
    text-align: center;
    user-select: all;
}

.sticker-name {
    font-size: 16px;
    color: #666;
    margin-top: 0.5rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* Pagination Styles */
.pagination {
    margin: 0;
    text-align: center;
}

.pagination .nav-links {
    display: inline-flex;
    gap: 0.5rem;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination .page-numbers:hover {
    background: #007bff;
    color: white;
}

.pagination .current {
    background: #007bff;
    color: white;
}

/* Mobile Responsive */
/* Medium screens - 显示4个 */
@media (min-width: 769px) and (max-width: 1019px) {
    .sticker-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
    
    .sticker-item {
        background: rgba(255, 255, 255, 0.85);
        border-radius: 10px;
        max-height: 200px; /* 限制最大高度 */
    }
    
    .sticker-placeholder {
        font-size: 2.5rem;
    }
    
    .sticker-name {
        font-size: 14px;
    }
}

/* Desktop Responsive - 大屏幕适配 (1020px及以上显示5个) */
@media (min-width: 1020px) {
    .sticker-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 25px;
    }
    
    .sticker-item {
        background: rgba(255, 255, 255, 0.85);
        border-radius: 12px;
        max-height: 200px; /* 限制最大高度 */
    }
    
    .sticker-placeholder {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .archive-title {
        font-size: 2rem;
    }
    
    .archive-description {
        font-size: 1rem;
    }
    
    /* Mobile adaptation for statistics number */
    .emoji-count {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.9rem !important;
    }
    
    /* Mobile meme grid layout - display 2 memes per row */
    .sticker-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 15px !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 15px !important;
    }
    
    .sticker-item {
        width: 100% !important;
        aspect-ratio: 1/1 !important;
        position: relative !important;
        display: block !important;
        overflow: hidden !important;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        max-height: 200px; /* 限制最大高度 */
    }
    
    .sticker-item:hover {
        transform: translateY(-5px) scale(1.03);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
        background: rgba(255, 255, 255, 0.95);
    }
    
    .sticker-placeholder {
        font-size: 3rem !important;
    }
    
    .sticker-name {
        font-size: 14px !important;
        white-space: normal !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        line-height: 1.3 !important;
        max-height: 2.6em !important;
    }
}

@media (max-width: 480px) {
    /* Small screen devices also maintain 2 memes per row */
    .sticker-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 10px !important;
    }
    
    .sticker-item {
        width: 100% !important;
        aspect-ratio: 1/1 !important;
        position: relative !important;
        display: block !important;
        overflow: hidden !important;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 6px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
        max-height: 180px; /* Limit maximum height */
    }
    
    .sticker-item:hover {
        transform: translateY(-3px) scale(1.02);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }
    
    .sticker-link {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 100% !important;
        text-decoration: none !important;
        padding: 0.75rem !important;
        box-sizing: border-box !important;
    }
    
    .sticker-placeholder {
        font-size: 2.5rem !important;
    }
    
    .sticker-name {
        font-size: 12px !important;
    }
}