/* =====================================================
   Diễn đàn DỰ ĐOÁN HÔM NAY - Custom CSS
   ===================================================== */

/* Google Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Variables ── */
:root {
    --ctdd-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --ctdd-bg: #f8f5f0;
    --ctdd-card-radius: 16px;
    --ctdd-shadow: 0 2px 12px rgba(0,0,0,.06);
    --ctdd-transition: .25s cubic-bezier(.4,0,.2,1);

    /* Region colours */
    --ctdd-mb-primary: #e05252;
    --ctdd-mb-bg: #fef6f4;
    --ctdd-mt-primary: #2eac68;
    --ctdd-mt-bg: #f3faf6;
    --ctdd-mn-primary: #e8a838;
    --ctdd-mn-bg: #fefaf2;

    /* Rank badge */
    --ctdd-rank-gold: linear-gradient(135deg,#f6d365,#fda085);
    --ctdd-rank-silver: linear-gradient(135deg,#c0c0c0,#e8e8e8);
    --ctdd-rank-bronze: linear-gradient(135deg,#cd7f32,#e8b879);
}
/* ── Page wrapper ── */
.ctdd-page {
    font-family: var(--ctdd-font);
    background: var(--ctdd-bg);
    padding: 24px 0 48px;
}

/* ── Page title ── */
.ctdd-title-wrap {
    text-align: left;
    margin-bottom: 8px;
}

.ctdd-title {
    font-size: 28px;
    font-weight: 800;
    color: #2d2d2d;
    margin: 0 0 6px;
    line-height: 1.2;
}

.ctdd-subtitle {
    font-size: 14px;
    font-style: italic;
    color: #888;
    margin: 0;
}

/* ── 3-column grid ── */
.ctdd-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.ctdd-page {
    background: #f8f5f0;
    font-family: 'Inter', sans-serif;
    padding-bottom: 60px;
}

.ctdd-header-area {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    gap: 40px;
}

@media (max-width: 991px) {
    .ctdd-header-area {
        flex-direction: column;
        gap: 20px;
    }
}

.ctdd-user-action-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    flex: 1;
    max-width: 600px;
}

.submit-title {
    font-size: 15px;
    margin-bottom: 12px;
    color: #444;
}

.submit-inputs {
    display: flex;
    gap: 12px;
}

.submit-inputs select, 
.submit-inputs input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.submit-inputs select { width: 140px; }
.submit-inputs input { flex: 1; }

.submit-btn {
    background: #e51919;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.submit-btn:hover { background: #d41818; }

.submit-feedback { font-size: 13px; margin-top: 10px; }
.submit-feedback.success { color: #2e7d32; }
.submit-feedback.error { color: #d32f2f; }

.login-prompt { text-align: center; }
.login-prompt-btns { display: flex; gap: 10px; justify-content: center; margin-top: 15px; }
.prompt-login-btn { 
    background: #e51919; color: #fff; text-decoration: none; 
    padding: 8px 20px; border-radius: 6px; font-weight: 600; font-size: 14px;
}
.prompt-register-btn {
    border: 1px solid #e51919; color: #e51919; text-decoration: none;
    padding: 8px 20px; border-radius: 6px; font-weight: 600; font-size: 14px;
}

.real-badge { color: #ff9800; font-size: 14px; margin-left: 4px; }
.real-user {background: rgba(255,152,0,0.02); }

/* ── Region card ── */
.ctdd-card {
    background: #fff;
    border-radius: var(--ctdd-card-radius);
    box-shadow: var(--ctdd-shadow);
    overflow: hidden;
    transition: box-shadow var(--ctdd-transition), transform var(--ctdd-transition);
}

.ctdd-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.1);
    transform: translateY(-2px);
}

/* ── Card header ── */
.ctdd-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: var(--ctdd-card-radius) var(--ctdd-card-radius) 0 0;
}

.ctdd-card--mb .ctdd-card-header { background: var(--ctdd-mb-bg); border-bottom: 2px solid var(--ctdd-mb-primary); }
.ctdd-card--mt .ctdd-card-header { background: var(--ctdd-mt-bg); border-bottom: 2px solid var(--ctdd-mt-primary); }
.ctdd-card--mn .ctdd-card-header { background: var(--ctdd-mn-bg); border-bottom: 2px solid var(--ctdd-mn-primary); }

.ctdd-region-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    flex-shrink: 0;
}

.ctdd-card--mb .ctdd-region-dot { background: var(--ctdd-mb-primary); }
.ctdd-card--mt .ctdd-region-dot { background: var(--ctdd-mt-primary); }
.ctdd-card--mn .ctdd-region-dot { background: var(--ctdd-mn-primary); }

.ctdd-region-name {
    font-size: 18px;
    font-weight: 700;
}

.ctdd-card--mb .ctdd-region-name { color: var(--ctdd-mb-primary); }
.ctdd-card--mt .ctdd-region-name { color: var(--ctdd-mt-primary); }
.ctdd-card--mn .ctdd-region-name { color: var(--ctdd-mn-primary); }

.ctdd-header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ctdd-header-left-top {
    display: flex;
    align-items: center;
}

.ctdd-provinces-text {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.ctdd-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    animation: ctdd-pulse 2s infinite;
}

.ctdd-card--mb .ctdd-time-badge { background: var(--ctdd-mb-primary); }
.ctdd-card--mt .ctdd-time-badge { background: var(--ctdd-mt-primary); }
.ctdd-card--mn .ctdd-time-badge { background: var(--ctdd-mn-primary); }

.ctdd-time-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    animation: ctdd-blink 1s infinite;
}

@keyframes ctdd-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .3; }
}

@keyframes ctdd-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0,0,0,.15); }
    70% { box-shadow: 0 0 0 6px rgba(0,0,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

/* ── DB Hôm qua (yesterday numbers) ── */
.ctdd-yesterday {
    display: block;
    align-items: center;
    padding: 12px 18px;
    gap: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.ctdd-yesterday-label {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    color: #aaa;
    letter-spacing: .5px;
    white-space: nowrap;
}

.ctdd-yesterday-nums {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ctdd-yesterday-rows {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px 0;
}

.ctdd-prov-numbers {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ctdd-prov-tag {
    font-size: 14px;
    font-weight: 700;
    color: #444;
}

.ctdd-num-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.ctdd-ynum {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.ctdd-card--mb .ctdd-ynum { background: var(--ctdd-mb-primary); }
.ctdd-card--mt .ctdd-ynum { background: var(--ctdd-mt-primary); }
.ctdd-card--mn .ctdd-ynum { background: var(--ctdd-mn-primary); }

/* ── Expert list ── */
.ctdd-expert-list {
    padding: 10px 18px 18px;
}

.ctdd-expert-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    gap: 12px;
    border-bottom: 1px solid #f5f5f5;
    transition: background var(--ctdd-transition);
}

.ctdd-expert-item:last-child {
    border-bottom: none;
}

.ctdd-expert-item:hover {
    background: rgba(0,0,0,.015);
    border-radius: 8px;
    margin: 0 -8px;
    padding: 10px 8px;
}

/* rank number */
.ctdd-rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.ctdd-rank--1 { background: var(--ctdd-rank-gold); }
.ctdd-rank--2 { background: var(--ctdd-rank-silver); color: #555; }
.ctdd-rank--3 { background: var(--ctdd-rank-bronze); }
.ctdd-rank--4,
.ctdd-rank--5,
.ctdd-rank--6 {
    background: #eee;
    color: #888;
}

/* avatar */
.ctdd-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    overflow: hidden;
}

.ctdd-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* expert info */
.ctdd-expert-info {
    flex: 1;
    min-width: 0;
}

.ctdd-expert-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ctdd-expert-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #999;
}

.ctdd-accuracy {
    font-weight: 600;
}

.ctdd-card--mb .ctdd-accuracy { color: var(--ctdd-mb-primary); }
.ctdd-card--mt .ctdd-accuracy { color: var(--ctdd-mt-primary); }
.ctdd-card--mn .ctdd-accuracy { color: var(--ctdd-mn-primary); }

.ctdd-streak {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* .ctdd-streak::before {
    content: '🔥';
    font-size: 11px;
} */

/* prediction number */
.ctdd-pred-num {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,.12);
    position: relative;
}

.ctdd-card--mb .ctdd-pred-num { background: linear-gradient(135deg, var(--ctdd-mb-primary), #ff7878); }
.ctdd-card--mt .ctdd-pred-num { background: linear-gradient(135deg, var(--ctdd-mt-primary), #5cd88e); }
.ctdd-card--mn .ctdd-pred-num { background: linear-gradient(135deg, var(--ctdd-mn-primary), #f5c563); }

/* ── Footer Actions ── */
.ctdd-footer-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 50px;
    gap: 12px;
}

.ctdd-footer-actions > div {
    width: 100%;
    display: flex;
    justify-content: center;
}

.ctdd-view-all-btn,
.btn-leaderboard-premium {
    width: 100%;
    max-width: 420px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-sizing: border-box;
}

/* Nút chính - Đăng ký */
.ctdd-view-all-btn {
    background: #2d2d2d;
    color: #fff !important;
    border: 2px solid #2d2d2d;
    gap: 10px;
}

.ctdd-view-all-btn:hover {
    background: #000;
    border-color: #000;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Nút phụ - BXH */
.btn-leaderboard-premium {
    background: #fff;
    border: 2px solid #e2e8f0;
    color: #475569 !important;
    gap: 10px;
}

.btn-leaderboard-premium i {
    color: #fbbf24;
    font-size: 18px;
}

.btn-leaderboard-premium:hover {
    border-color: #e51919;
    color: #e51919 !important;
    background: #fdf2f2;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(229, 25, 25, 0.1);
}

/* Xử lý mũi tên */
.ctdd-view-all-btn .arrow {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 18px;
}

.ctdd-view-all-btn:hover .arrow {
    transform: translateX(5px);
}

/* ── Disclaimer ── */
.ctdd-disclaimer {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: #bbb;
}

.ctdd-disclaimer::before {
    content: '⚠';
    margin-right: 4px;
}

/* ── Breadcrumb ── */
.ctdd-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #aaa;
    margin-bottom: 16px;
}

.ctdd-breadcrumb a {
    color: #888;
    text-decoration: none;
    transition: color .2s;
}

.ctdd-breadcrumb a:hover {
    color: var(--ctdd-mb-primary);
}

.ctdd-breadcrumb .separator {
    color: #ccc;
}

.ctdd-breadcrumb .current {
    color: #555;
    font-weight: 500;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .ctdd-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .ctdd-title { font-size: 22px; }
}

@media (max-width: 768px) {
    .ctdd-page { padding: 16px 0 32px; }
    .ctdd-grid { gap: 12px; }
    .ctdd-title { font-size: 20px; }
    .ctdd-card-header { padding: 12px 14px; }
    .ctdd-region-name { font-size: 16px; }
    .ctdd-expert-list { padding: 8px 14px 14px; }
    .ctdd-yesterday { padding: 10px 14px; }
    .ctdd-pred-num { width: 38px; height: 38px; font-size: 16px; }
    .ctdd-avatar { width: 34px; height: 34px; font-size: 14px; }
}

@media (max-width: 480px) {
    .ctdd-title { font-size: 18px; }
    .ctdd-expert-name { font-size: 13px; }
    .ctdd-expert-stats { font-size: 11px; }
    .ctdd-pred-num { width: 34px; height: 34px; font-size: 14px; }
}

/* ── Skeleton loading animation ── */
.ctdd-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: ctdd-shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes ctdd-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Entrance animations ── */
.ctdd-card {
    animation: ctdd-fadeUp .5s ease-out both;
}

.ctdd-card:nth-child(1) { animation-delay: .1s; }
.ctdd-card:nth-child(2) { animation-delay: .2s; }
.ctdd-card:nth-child(3) { animation-delay: .3s; }

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

.ctdd-expert-item {
    animation: ctdd-slideIn .4s ease-out both;
}

.ctdd-expert-item:nth-child(1) { animation-delay: .15s; }
.ctdd-expert-item:nth-child(2) { animation-delay: .25s; }
.ctdd-expert-item:nth-child(3) { animation-delay: .35s; }
.ctdd-expert-item:nth-child(4) { animation-delay: .45s; }
.ctdd-expert-item:nth-child(5) { animation-delay: .55s; }
.ctdd-expert-item:nth-child(6) { animation-delay: .65s; }

@keyframes ctdd-slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
