/**
 * HuSNS Mobile Hot Page Styles
 * 热门页面样式 - 美化增强版
 */

/* ========== 变量定义 ========== */
:root {
    --hot-primary: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    --hot-gold: linear-gradient(135deg, #ffd700 0%, #ffb700 50%, #ff8c00 100%);
    --hot-silver: linear-gradient(135deg, #e8e8e8 0%, #c0c0c0 100%);
    --hot-bronze: linear-gradient(135deg, #cd7f32 0%, #b87333 100%);
    --hot-glow: 0 4px 20px rgba(255, 107, 107, 0.3);
}

/* ========== 页面容器 ========== */
.hot-wrapper {
    min-height: 100vh;
    background: linear-gradient(180deg, #fef9f9 0%, #fff5f5 50%, #fafafa 100%);
    padding-bottom: env(safe-area-inset-bottom);
}

@media (prefers-color-scheme: dark) {
    .hot-wrapper {
        background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    }
}

/* ========== 头部样式 ========== */
.hot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(env(safe-area-inset-top) + 12px) 16px 12px 16px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 50%, #f44336 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(244, 67, 54, 0.3);
}

.hot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    pointer-events: none;
}

.hot-header::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: -5%;
    right: -5%;
    height: 30px;
    background: linear-gradient(180deg, rgba(255, 107, 107, 0.1) 0%, transparent 100%);
    border-radius: 50% 50% 0 0;
}

.hot-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hot-back:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.hot-back:active {
    transform: scale(0.95);
}

.hot-back svg {
    width: 22px;
    height: 22px;
}

.hot-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hot-title-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    animation: fire-pulse 1.5s ease-in-out infinite;
}

.hot-title-icon svg {
    width: 20px;
    height: 20px;
    fill: white;
    stroke: white;
}

@keyframes fire-pulse {
    0%, 100% { 
        transform: scale(1); 
        background: rgba(255, 255, 255, 0.25);
    }
    50% { 
        transform: scale(1.1); 
        background: rgba(255, 255, 255, 0.35);
    }
}

.hot-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hot-refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hot-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.hot-refresh-btn:active {
    transform: rotate(180deg) scale(0.95);
}

.hot-refresh-btn svg {
    width: 20px;
    height: 20px;
}

/* ========== 标签栏样式 ========== */
.hot-tabs {
    background: white;
    position: sticky;
    top: calc(env(safe-area-inset-top) + 60px);
    z-index: 99;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    .hot-tabs {
        background: #252542;
    }
}

.hot-tab-bar {
    display: flex;
    height: 56px;
    padding: 0 8px;
}

.hot-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary-color);
    font-size: 13px;
    font-weight: 500;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 3px;
    padding: 8px 4px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.hot-tab-item:active {
    background: rgba(255, 107, 107, 0.05);
}

.hot-tab-item.active {
    color: #ff6b6b;
    font-weight: 700;
}

.hot-tab-item.active .tab-icon {
    transform: scale(1.15);
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

/* 滑动指示器 */
.tab-slide-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b6b, #ff8e53);
    border-radius: 3px 3px 0 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--background-color);
    transition: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .tab-icon {
        background: #363654;
    }
}

.tab-icon svg {
    width: 15px;
    height: 15px;
}

/* ========== 帖子列表 ========== */
.post-list {
    padding: 16px 12px;
    padding-top: 12px;
}

/* ========== 排名卡片样式 ========== */
.hot-rank-wrapper {
    position: relative;
    margin-bottom: 14px;
    animation: slideInUp 0.5s ease-out forwards;
    opacity: 0;
}

.hot-rank-wrapper:nth-child(1) { animation-delay: 0.05s; }
.hot-rank-wrapper:nth-child(2) { animation-delay: 0.1s; }
.hot-rank-wrapper:nth-child(3) { animation-delay: 0.15s; }
.hot-rank-wrapper:nth-child(4) { animation-delay: 0.2s; }
.hot-rank-wrapper:nth-child(5) { animation-delay: 0.25s; }
.hot-rank-wrapper:nth-child(n+6) { animation-delay: 0.3s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 前三名特殊样式 */
.hot-rank-wrapper.top-rank {
    position: relative;
}

.hot-rank-wrapper.top-rank::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    border-radius: 0 4px 4px 0;
}

.hot-rank-wrapper.top-rank:nth-child(1)::before {
    background: linear-gradient(180deg, #ffd700, #ffb700);
    box-shadow: 0 0 10px rgba(255, 183, 0, 0.5);
}

.hot-rank-wrapper.top-rank:nth-child(2)::before {
    background: linear-gradient(180deg, #c0c0c0, #a8a8a8);
}

.hot-rank-wrapper.top-rank:nth-child(3)::before {
    background: linear-gradient(180deg, #cd7f32, #b87333);
}

/* ========== 排名徽章样式 ========== */
.hot-rank {
    position: absolute;
    left: 16px;
    top: 16px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.hot-rank:active {
    transform: scale(0.95);
}

@media (prefers-color-scheme: dark) {
    .hot-rank {
        background: #2a2a48;
    }
}

/* 第一名 - 金色 */
.hot-rank.top1 {
    background: linear-gradient(145deg, #ffd700 0%, #ffb700 50%, #ff8c00 100%);
    box-shadow: 0 6px 24px rgba(255, 183, 0, 0.5);
    animation: glow-gold 2s ease-in-out infinite;
}

@keyframes glow-gold {
    0%, 100% { box-shadow: 0 6px 24px rgba(255, 183, 0, 0.5); }
    50% { box-shadow: 0 6px 32px rgba(255, 183, 0, 0.8); }
}

/* 第二名 - 银色 */
.hot-rank.top2 {
    background: linear-gradient(145deg, #f0f0f0 0%, #c0c0c0 50%, #a8a8a8 100%);
    box-shadow: 0 4px 16px rgba(192, 192, 192, 0.5);
}

/* 第三名 - 铜色 */
.hot-rank.top3 {
    background: linear-gradient(145deg, #cd7f32 0%, #b87333 50%, #a0522d 100%);
    box-shadow: 0 4px 16px rgba(205, 127, 50, 0.5);
}

/* 排名数字样式 */
.rank-number {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-secondary-color);
}

/* 奖牌图标 */
.rank-medal {
    display: flex;
    align-items: center;
    justify-content: center;
}

.medal-icon {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.medal-icon.gold {
    color: #fff;
    animation: sparkle 1.5s ease-in-out infinite;
}

.medal-icon.silver,
.medal-icon.bronze {
    color: #fff;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.15) rotate(5deg); }
}

/* 排名徽章标签 */
.hot-rank-badge {
    position: absolute;
    top: 0;
    right: 16px;
    padding: 5px 12px;
    border-radius: 10px 10px 0 10px;
    z-index: 5;
    animation: badge-pop 0.4s ease-out;
}

@keyframes badge-pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.hot-rank-badge.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    box-shadow: 0 4px 12px rgba(255, 183, 0, 0.4);
}

.hot-rank-badge.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
}

.hot-rank-badge.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #b87333);
}

.badge-text {
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ========== 空状态样式 ========== */
.hot-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    min-height: 60vh;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hot-empty-icon {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: white;
    box-shadow: 0 12px 40px rgba(255, 107, 107, 0.4);
    animation: float 3s ease-in-out infinite, glow 2s ease-in-out infinite;
    position: relative;
}

.hot-empty-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140px;
    height: 140px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px dashed rgba(255, 107, 107, 0.4);
    animation: rotate-border 8s linear infinite;
}

@keyframes rotate-border {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.hot-empty-icon::after {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    opacity: 0.2;
    z-index: -1;
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(1.03); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 12px 40px rgba(255, 107, 107, 0.4); }
    50% { box-shadow: 0 16px 50px rgba(255, 107, 107, 0.6); }
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.2; }
    100% { transform: scale(1.4); opacity: 0; }
}

.hot-empty-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 12px 0;
    letter-spacing: 0.5px;
}

.hot-empty-hint {
    font-size: 15px;
    color: var(--text-secondary-color);
    margin: 0;
    padding: 10px 24px;
    background: var(--background-color);
    border-radius: 20px;
}

@media (prefers-color-scheme: dark) {
    .hot-empty-hint {
        background: #2a2a48;
    }
}

/* ========== 加载更多按钮 ========== */
.load-more {
    padding: 24px 20px;
    display: flex;
    justify-content: center;
}

.load-more-btn {
    padding: 14px 48px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: white;
    border: none;
    border-radius: 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    position: relative;
    overflow: hidden;
}

.load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.load-more-btn:hover::before {
    left: 100%;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.5);
}

.load-more-btn:active {
    transform: scale(0.98) translateY(0);
}

/* ========== 位置卡片样式 ========== */
.moment-location-card,
.moment-location-link {
    margin: 8px 16px 8px 60px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.08), rgba(255, 165, 2, 0.08));
    border: 1px solid rgba(255, 107, 107, 0.15);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.moment-location-card:hover,
.moment-location-link:hover {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 165, 2, 0.15));
    transform: scale(1.02);
}

.location-pin svg {
    fill: var(--danger-color, #ff5252);
}

.location-text {
    color: var(--danger-color, #ff5252);
    font-weight: 500;
}

/* ========== 暗色模式适配 ========== */
@media (prefers-color-scheme: dark) {
    .hot-header {
        background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    }
    
    .hot-rank.top1 {
        background: linear-gradient(145deg, #ffd700 0%, #ffb700 100%);
    }
    
    .hot-empty-icon {
        background: linear-gradient(135deg, #ff5252 0%, #d32f2f 100%);
    }
    
    .load-more-btn {
        background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    }
}

/* ========== 响应式适配 ========== */
@media (max-width: 360px) {
    .hot-tab-item {
        min-width: 60px;
        font-size: 12px;
    }
    
    .tab-icon {
        width: 26px;
        height: 26px;
    }
    
    .hot-rank {
        width: 40px;
        height: 40px;
        left: 12px;
    }
    
    .hot-rank-badge {
        right: 12px;
    }
}

/* ========== Loading 状态 ========== */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-spinner svg {
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
    color: var(--primary-color, #ff6b6b);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-secondary-color);
}
