/* Component style file */

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
html {
    scroll-behavior: smooth;
}

/* Reduce paint complexity */
* {
    box-sizing: border-box;
}

/* 基于实际容器宽度的精确计算 - 专注网格功能 */
.emoji-grid {
    display: grid;
    gap: 1.5rem;
    width: 100%;
    box-sizing: border-box;
    contain: layout style paint;
    /* 移除margin，由main.min.css的容器样式控制 */
}

/* 桌面版：900px容器，减去padding后约788px可用，3列最佳 */
.emoji-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* 中等屏幕：调整为2列 */
@media (max-width: 1200px) {
    .emoji-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
}

/* 移动端响应式：基于实际视口 */
@media (max-width: 768px) {
    .emoji-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .emoji-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.emoji-item {
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
    position: relative;
    /* 添加卡片边框和阴影，但不设置背景色保持透明 */
}

.emoji-item:hover {
    transform: translateY(-1px);
}

.emoji-card-link, .emoji-link {
    text-decoration: none;
    color: inherit;
    display: block;
    flex: 1;
}

.emoji-content {
    display: flex;
    padding: 1.5rem;
    gap: 1rem;
    align-items: flex-start; /* 确保图片和文字顶部对齐 */
}

.emoji-preview {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
    background-color: #f8f9fa;
    border-radius: 4px;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

.emoji-details {
    flex: 1;
    min-width: 0;
}

.emoji-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    min-width: 0;
}

.emoji-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
}

.emoji-grid .emoji-code {
    background: #f0f0f0;
    color: #666;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
    display: inline-block;
    align-self: flex-start;
}

.emoji-description {
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.emoji-stats {
    margin-top: 0.5rem;
}

.usage-count {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #888;
    font-size: 0.85rem;
}

.usage-icon {
    opacity: 0.7;
}

.emoji-actions {
    padding: 1rem 1.5rem;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 0.5rem;
    border-radius: 0 0 12px 12px;
}

.emoji-copy-btn {
    background: #FE2C55;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.75rem 1.5rem;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.15s ease;
    flex: 1;
    box-shadow: 0 2px 4px rgba(254, 44, 85, 0.2);
}

.emoji-copy-btn:hover {
    background-color: #e62548;
}

/* ===== TIKTOK EMOJIS PREVIEW SECTION STYLES ===== */
.tiktok-emojis-preview-section {
    margin: 3rem 0;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    /* 恢复边框和阴影，但保持透明背景 */
}

.tiktok-emojis-preview-section h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: #333;
}

.tiktok-emojis-preview-section .section-description {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
}

/* ===== VIEW ALL BUTTON STYLES ===== */
.view-all-button {
    display: inline-block;
    background-color: #FE2C55;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border: none;
}

.view-all-button:hover {
    background-color: #e62548;
    color: white;
    text-decoration: none;
}

.view-all-button:visited,
.view-all-button:active,
.view-all-button:link {
    color: white;
    text-decoration: none;
}

/* ===== UNIFIED COPY BUTTON SYSTEM ===== */

/* All copy buttons display "Copy" */
.emoji-copy-btn::after,
/* Copy按钮伪元素 - 排除TikTok详情页 */
.emoji-grid .copy-btn::after,
.kaomoji-preview-copy::after {
    content: "Copy";
    display: inline-block;
    pointer-events: none;
}

.emoji-copy-btn:active {
    background-color: #d41f42;
}

.emoji-copy-btn.copied {
    background: #e62548;
    color: white;
}

/* All copy buttons show "Copied!" when clicked */
.emoji-copy-btn.copied::after,
/* Copied状态伪元素 - 排除TikTok详情页 */
.emoji-grid .copy-btn.copied::after,
.kaomoji-preview-copy.copied::after {
    content: 'Copied!';
    pointer-events: none;
}

/* ===== DOWNLOAD BUTTON VARIANTS ===== */

/* Download buttons display "Download" */
.emoji-download-btn::after {
    content: "Download";
    display: inline-block;
    pointer-events: none;
}

.emoji-download-btn.downloading::after {
    content: "Downloading...";
    pointer-events: none;
}

.emoji-download-btn {
    background: #f0f9ff;
    color: #0369a1;
    border: 1.5px solid #bae6fd;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    box-shadow: 0 1px 3px rgba(3, 105, 161, 0.08);
    width: auto;
}

.emoji-download-btn:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0c4a6e;
}

.emoji-download-btn:active {
    background: #bfdbfe;
}

.emoji-download-btn.downloading {
    background: #dbeafe;
    border-color: #60a5fa;
    color: #1e40af;
    box-shadow: 0 1px 3px rgba(30, 64, 175, 0.12);
}

/* ===== UNIFIED DOWNLOAD BUTTON SYSTEM ===== */

/* All download buttons display "Download" */
.emoji-download-btn::after {
    content: 'Download';
    pointer-events: none; /* 防止伪元素阻止点击事件 */
}

/* All download buttons show "Downloading..." when clicked */
.emoji-download-btn.downloading::after {
    content: 'Downloading...';
    pointer-events: none; /* 防止伪元素阻止点击事件 */
}

/* EMOJI CODES SHOWCASE */
.emoji-codes-showcase {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.emoji-codes-showcase h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 0.5rem;
    text-align: center;
}

.emoji-codes-showcase .section-description {
    color: #666;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
}

.emoji-codes-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding: 0;
    align-items: stretch;
}

.emoji-code-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
    min-height: 60px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.emoji-code-item:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
    transform: translateY(-2px);
    background: #fbfcfd;
}

.emoji-code-text {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #333;
    background: #f8f9fa;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-weight: 500;
    border: 1px solid #e9ecef;
    white-space: nowrap;
    word-break: keep-all;
    flex: 1;
    min-width: 0;
}

.emoji-code-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);

}

/* 长文本自适应处理 */
.emoji-code-text[data-long="true"] {
    font-size: 0.85rem;
    padding: 0.3rem 0.5rem;
}

/* 超长文本适配 */
.emoji-code-item[data-very-long="true"] .emoji-code-text {
    font-size: 0.8rem;
    padding: 0.3rem 0.4rem;
}

/* 确保文本不会被截断 */
.emoji-code-item {
    min-width: 240px;
}



/* RESOURCES SECTION STYLES */
.resources-section {
    margin: 2rem 0;
}

.resources-section h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1.5rem;
    text-align: center;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.resource-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.resource-icon {
    width: 48px;
    height: 48px;
}

.resource-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.resource-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.resource-content h3 {
    font-size: 1.25rem;
    color: #333;
    margin: 0;
}

.resource-content p {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
}

.resource-link {
    color: #007bff;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .emoji-codes-showcase {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .emoji-codes-list {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
        align-items: stretch;
    }
    
    .emoji-code-item {
        padding: 0.8rem 1rem;
        min-height: 50px;
    }
    
    .emoji-code-text {
        font-size: 0.9rem;
        padding: 0.3rem 0.5rem;
    }
    
    .emoji-code-icon {
        width: 30px;
        height: 30px;
    }
    
    .resources-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

/* 超小屏幕优化 - 为移动设备进一步优化emoji codes布局 */
@media (max-width: 480px) {
    .emoji-codes-list {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 0.8rem;
        align-items: stretch;
    }
    
    .emoji-code-item {
        padding: 0.7rem 0.8rem;
        min-height: 45px;
    }
    
    .emoji-code-text {
        font-size: 0.8rem;
        padding: 0.25rem 0.4rem;
    }
    
    .emoji-code-icon {
        width: 26px;
        height: 26px;
    }
    
    .emoji-code-item {
        min-width: 160px;
    }
    
    .resources-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .resource-card {
        padding: 1.5rem;
    }
}

/* Showcase container styles */
.showcase-container {
    text-align: center;
    margin: 2rem 0;
}

.showcase-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ===== UNIFIED EMOJI CARD VARIANTS ===== */

/* Trending变体 - 更紧凑的布局 */
.emoji-item--trending {
    background: linear-gradient(135deg, #f8faff 0%, #ffffff 100%);
    border: 1px solid #e1e8ed;
}

.emoji-item--trending .emoji-content {
    padding: 1.25rem;  /* 稍微紧凑一些，减少高度 */
    gap: 0.75rem;      /* 减少图片和文字之间的间距 */
}

.emoji-item--trending .emoji-preview {
    width: 44px;
    height: 44px;
}

.emoji-item--trending .emoji-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;  /* 进一步减少文字元素之间的间距 */
}

.emoji-item--trending .emoji-title {
    gap: 0.2rem;      /* 减少title内部元素的间距 */
    margin-bottom: 0.3rem;  /* 减少与description的间距 */
}

.emoji-item--trending .emoji-seo-subtitle {
    font-size: 0.875rem;  /* 与tiktok-emojis页面保持一致 */
    color: #666;          /* 与tiktok-emojis页面保持一致 */
    margin: 0.1rem 0 0;   /* 减少上下边距，避免与title的margin-bottom重复 */
    font-weight: 400;
    line-height: 1.3;     /* 与tiktok-emojis页面保持一致 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Full变体 - 完整功能的卡片（默认样式） */
/* .emoji-item--full使用默认的emoji-item样式，无需额外CSS */

/* Compact变体 - 更小更密集 */
.emoji-item--compact {
    padding: 1rem;
}

.emoji-item--compact .emoji-content {
    padding: 1rem;
}

.emoji-item--compact .emoji-preview {
    width: 40px;
    height: 40px;
}

.emoji-item--compact .emoji-name {
    font-size: 1rem;
}

.emoji-item--compact .emoji-description {
    font-size: 0.85rem;
    line-height: 1.3;
}

/* Trending section现在使用统一组件，无需特殊样式 */

/* 确保SEO副标题在所有变体中样式一致 */
.emoji-seo-subtitle {
    color: #666;
    font-size: 0.875rem;
    margin: 0.25rem 0 0.5rem 0;
    font-weight: 400;
    line-height: 1.3;  /* 与tiktok-emojis页面保持一致 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .emoji-item--trending .emoji-preview {
        width: 40px;
        height: 40px;
    }
    
    .emoji-item--trending .emoji-name {
        font-size: 1rem;
    }
    
    .emoji-item--trending .emoji-seo-subtitle {
        font-size: 0.8rem;  /* 响应式情况下稍微小一点，但不要太小 */
    }
}
