/* ============================================
   NHACAI TOPLIST — Homepage Cards + Detail Page
   ============================================ */

/* --- Homepage Toplist Cards --- */

.toplist-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 0;
}

.toplist-card {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 20px 24px;
    position: relative;
    transition: box-shadow 0.2s ease;
}

.toplist-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Logo + Rank Badge Overlay */
.toplist-card-logo {
    flex-shrink: 0;
    width: 80px;
    margin-right: 20px;
    text-align: center;
    position: relative;
}

.toplist-rank-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #f59e0b;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Rank 1 - Gold with glow animation */
@keyframes toplist-glow {
    0%   { box-shadow: 0 0 8px rgba(255, 215, 0, 0.4), inset 0 0 0 1px rgba(255, 215, 0, 0.2); }
    50%  { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), inset 0 0 0 1px rgba(255, 215, 0, 0.4); }
    100% { box-shadow: 0 0 8px rgba(255, 215, 0, 0.4), inset 0 0 0 1px rgba(255, 215, 0, 0.2); }
}

@keyframes toplist-badge-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.toplist-rank-1 {
    border: 2px solid #FFD700;
    border-left: 5px solid #FFD700;
    background: linear-gradient(135deg, #FFFBEB 0%, #FFF9E0 8%, #fff 25%);
    animation: toplist-glow 2.5s ease-in-out infinite;
}

.toplist-rank-1:hover {
    box-shadow: 0 0 24px rgba(255, 215, 0, 0.7) !important;
}

.toplist-rank-1 .toplist-rank-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
    width: 36px;
    height: 36px;
    font-size: 17px;
    box-shadow: 0 3px 10px rgba(255, 165, 0, 0.6);
    animation: toplist-badge-pulse 2s ease-in-out infinite;
}

.toplist-rank-1 .toplist-card-name,
.toplist-rank-1 .toplist-card-name-mobile {
    color: #D4A017;
    font-size: 22px;
}

/* Rank 2 - Silver */
.toplist-rank-2 {
    border-left: 5px solid #A8A8A8;
    background: linear-gradient(90deg, #F5F5F5 0%, #fff 15%);
}
.toplist-rank-2 .toplist-rank-badge {
    background: linear-gradient(135deg, #C0C0C0, #808080);
    color: #fff;
    width: 34px;
    height: 34px;
    font-size: 16px;
    box-shadow: 0 3px 8px rgba(192, 192, 192, 0.5);
}
.toplist-rank-2 .toplist-card-name,
.toplist-rank-2 .toplist-card-name-mobile {
    color: #5A5A5A;
    font-size: 22px;
}

/* Rank 3 - Bronze */
.toplist-rank-3 {
    border-left: 5px solid #CD7F32;
    background: linear-gradient(90deg, #FFF5EB 0%, #fff 15%);
}
.toplist-rank-3 .toplist-rank-badge {
    background: linear-gradient(135deg, #CD7F32, #A0522D);
    color: #fff;
    width: 34px;
    height: 34px;
    font-size: 16px;
    box-shadow: 0 3px 8px rgba(205, 127, 50, 0.5);
}
.toplist-rank-3 .toplist-card-name,
.toplist-rank-3 .toplist-card-name-mobile {
    color: #A0522D;
    font-size: 22px;
}

.toplist-card-logo img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 10px;
}

.toplist-card-name-mobile {
    display: none;
    font-weight: 600;
    font-size: 13px;
    margin-top: 6px;
    color: #1a1a1a;
}

/* Info */
.toplist-card-info {
    flex: 1;
    min-width: 0;
    margin-right: 20px;
}

.toplist-card-name {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #1a1a1a;
}

.toplist-card-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
}

.toplist-card-desc p {
    margin: 0 0 4px 0;
}

/* Rating */
.toplist-card-rating {
    flex-shrink: 0;
    text-align: center;
    margin-right: 24px;
    min-width: 100px;
}

.toplist-stars {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-bottom: 4px;
}

.toplist-star {
    font-size: 18px;
}

.toplist-star-full {
    color: #f59e0b;
}

.toplist-star-half {
    color: #f59e0b;
    opacity: 0.6;
}

.toplist-star-empty {
    color: #d1d5db;
}

.toplist-rating-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}


/* Buttons */
.toplist-card-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 140px;
}

.toplist-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.toplist-btn svg {
    flex-shrink: 0;
}

.toplist-btn-visit {
    background: #f59e0b;
    color: #fff;
    border: 2px solid #f59e0b;
}

.toplist-btn-visit:hover {
    background: #d97706;
    border-color: #d97706;
    color: #fff;
}

.toplist-btn-review {
    background: #fff;
    color: #333;
    border: 2px solid #d1d5db;
}

.toplist-btn-review:hover {
    border-color: #f59e0b;
    color: #f59e0b;
}

/* --- Detail Page --- */

.toplist-detail {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0;
}

.toplist-detail-header {
    display: flex;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    gap: 24px;
}

.toplist-detail-logo-wrap {
    flex-shrink: 0;
    text-align: center;
    position: relative;
}

.toplist-detail-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 14px;
    border: 1px solid #e5e5e5;
}

.toplist-detail-rating-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background: #f59e0b;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

.toplist-detail-info {
    flex: 1;
    min-width: 0;
}

.toplist-detail-name {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #1a1a1a;
}

.toplist-detail-subtitle {
    display: block;
    font-size: 14px;
    color: #888;
    margin-bottom: 12px;
}

.toplist-detail-desc {
    font-size: 14px;
    line-height: 1.7;
    color: #444;
}

.toplist-detail-desc p {
    margin: 0 0 6px 0;
}

.toplist-detail-cta {
    flex-shrink: 0;
    text-align: center;
}

.toplist-btn-large {
    padding: 14px 40px;
    font-size: 16px;
}

/* --- Pros & Cons --- */

.toplist-detail-proscons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.toplist-detail-pros,
.toplist-detail-cons {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 24px;
}

.toplist-proscons-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.toplist-proscons-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

.toplist-proscons-icon {
    font-size: 24px;
    opacity: 0.5;
}

.toplist-icon-pros {
    color: #22c55e;
}

.toplist-icon-cons {
    color: #ef4444;
}

.toplist-detail-pros ul,
.toplist-detail-cons ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toplist-detail-pros li,
.toplist-detail-cons li {
    padding: 8px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.toplist-detail-pros li:last-child,
.toplist-detail-cons li:last-child {
    border-bottom: none;
}

.toplist-check {
    color: #22c55e;
    font-size: 16px;
    flex-shrink: 0;
}

.toplist-cross {
    color: #ef4444;
    font-size: 16px;
    flex-shrink: 0;
}

/* --- Responsive --- */

@media (max-width: 768px) {
    .toplist-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px 16px;
        gap: 12px;
    }

    .toplist-card-logo {
        width: 80px;
        margin-right: 0;
        order: 1;
    }

    .toplist-card-logo img {
        width: 70px;
        height: 70px;
    }

    .toplist-rank-badge {
        top: -8px;
        left: -8px;
    }

    .toplist-card-name-mobile {
        display: block;
    }

    .toplist-card-info {
        width: 100%;
        order: 2;
        margin-right: 0;
    }

    .toplist-card-name {
        display: none;
    }

    .toplist-card-desc {
        text-align: left;
    }

    .toplist-card-rating {
        order: 3;
        margin-right: 0;
        min-width: auto;
    }

    .toplist-card-actions {
        width: 100%;
        order: 4;
        flex-direction: row;
        min-width: auto;
    }

    .toplist-card-actions .toplist-btn {
        flex: 1;
    }

    /* Detail page */
    .toplist-detail-header {
        flex-direction: column;
        padding: 20px;
        text-align: center;
    }

    .toplist-detail-logo-wrap {
        margin: 0 auto;
    }

    .toplist-detail-cta {
        width: 100%;
    }

    .toplist-btn-large {
        width: 100%;
    }

    .toplist-detail-proscons {
        grid-template-columns: 1fr;
    }
}
