/* * File: assets/css/modules/public-rankings.css
 * Description: 排行榜專用樣式 (Clean RWD Implementation)
 */

/* --- Section Header (New) --- */
.se-section-header-row {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.se-icon-trophy {
    color: #eab308;
    width: 24px;
    height: 24px;
}

.se-more-link {
    font-size: 0.8rem;
    color: #6b7280;
    text-decoration: none;
}

/* --- Ranking Tabs --- */
.se-ranking-tabs-container {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 5px;
    margin-top: 1rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
}

.se-rank-tab-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 999px;
    border: 1px solid #eee;
    background: #f9fafb;
    color: #374151;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.se-rank-tab-btn.active {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.se-rank-tab-btn:hover:not(.active) {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.se-tab-icon-img {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    object-fit: contain;
}

.se-tab-icon-svg {
    width: 16px;
    height: 16px;
    margin-right: 6px;
}

/* --- Content Area --- */
.se-ranking-content-container {
    min-height: 200px;
}

.se-rank-list-content {
    display: none;
    animation: seFadeIn 0.3s;
}

.se-rank-list-content.active {
    display: block;
}

/* --- Ranking Item (Mobile: Row) --- */
.se-rank-item {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
    margin-bottom: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    /* For Grid Stretch */
}

/* Rank Number */
.se-rank-num {
    font-size: 1.2rem;
    font-weight: 500;
    width: 40px;
    text-align: center;
    font-style: italic;
    color: #212529;
    margin-right: 5px;
    flex-shrink: 0;
}

.se-rank-num.rank-1 {
    color: #eab308;
    text-shadow: 0 1px 0 #ca8a04;
}

.se-rank-num.rank-2 {
    color: #94a3b8;
    text-shadow: 0 1px 0 #64748b;
}

.se-rank-num.rank-3 {
    color: #b45309;
    text-shadow: 0 1px 0 #78350f;
}

/* Image */
.se-rank-img-link {
    display: block;
    flex-shrink: 0;
    margin-right: 12px;
}

.se-rank-img {
    width: 70px;
    height: 70px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #eee;
}

/* Info Column */
.se-rank-info {
    flex: 1;
    min-width: 0;
}

/* min-width: 0 is crucial for flex text truncation */

.se-rank-brand {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.se-rank-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 4px 0;
    line-height: 1.3;

    /* [Update] Full Text Display */
    white-space: normal;
    overflow: visible;
}

.se-rank-title a {
    color: inherit;
    text-decoration: none;
}

.se-rank-discount {
    display: inline-block;
    width: fit-content;
    background-color: #fee2e2;
    color: #dc2626;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    margin-top: 4px;
}

/* Actions */
.se-rank-actions {
    margin-left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Empty State */
.se-empty-msg {
    text-align: center;
    color: #999;
    padding: 20px;
}

/* Header Elements (Template Page) */
.se-ranking-page-wrapper {
    padding-bottom: 100px;
}

.se-nav-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    margin-right: 10px;
    padding: 5px;
}

.se-page-title {
    font-weight: 700;
    font-size: 1.125rem;
    flex: 1;
    text-align: center;
    margin: 0;
}

.se-nav-spacer {
    width: 24px;
}


/* =========================================
   Desktop RWD Enhancements (>= 1024px)
   ========================================= */
@media (min-width: 1024px) {

    /* 1. Grid Dashboard Layout */
    .se-rank-list-content.active {
        display: grid;
        /* 卡片最小 300px，自動填滿 */
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
        align-items: stretch;
    }

    /* 2. Card Style Enhancement */
    .se-rank-item {
        flex-direction: row;
        /* 保持橫向排列，但外框變大 */
        margin-bottom: 0;
        padding: 15px;
        align-items: center;
        /* 垂直置中 (Modified) */
        position: relative;
        /* For actions absolute positioning if needed */
    }

    /* Hover Effect */
    .se-rank-item:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
        border-color: #d1d5db;
        z-index: 5;
    }

    /* 3. Elements Sizing */
    .se-rank-img {
        width: 90px;
        height: 90px;
    }

    .se-rank-title {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .se-rank-num {
        font-size: 2rem;
        width: 50px;
        margin-right: 15px;
        align-self: center;
    }

    /* 4. Action Buttons Hover Reveal */
    .se-rank-actions {
        /* Desktop: 移到底部水平排列 */
        flex-direction: row;
        position: absolute;
        bottom: 15px;
        right: 15px;
        opacity: 0;
        transition: opacity 0.2s;
    }

    .se-rank-item:hover .se-rank-actions {
        opacity: 1;
    }

    /* 5. Tabs Centering */
    .se-ranking-tabs-container {
        justify-content: center;
        overflow: visible;
        margin-bottom: 2rem;
    }

    .se-rank-tab-btn {
        padding: 8px 24px;
        font-size: 1rem;
    }

    /* [New] Limit items to Top 3 on Desktop as well */
    .se-mobile-hidden {
        display: none !important;
    }
}

/* [New] Mobile Hidden Logic (Redundant now but kept for safety/legacy if PHP changes) */
@media (max-width: 1023px) {
    .se-mobile-hidden {
        display: none !important;
    }
}

/* [New] View All Button Styles */
.se-view-all-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background-color: #f3f4f6;
    /* Gray-100 */
    color: #4b5563;
    /* Gray-600 */
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.se-view-all-btn:hover {
    background-color: #e5e7eb;
    /* Gray-200 */
    color: #1f2937;
    /* Gray-800 */
    transform: translateY(-1px);
}

```