/* ============================================================
   33IQ AI Model Challenge - Redesigned Interface
   ============================================================ */

/* Override global #bottom layout for full-width hero */
#bottom { min-height: 0 !important; margin: 0 !important; }
#bottom .inner { padding-top: 0 !important; }

/* ----- Hero Section ----- */
.model-hero {
    width: 100%;
    clear: both;
    background: linear-gradient(160deg, #1e3a8a 0%, #1e40af 30%, #2563EB 60%, #3b82f6 100%);
    margin-top: -86px;
    margin-top: -102px\9;
    padding: 120px 0 70px;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.model-hero::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -15%;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(124,58,237,0.18) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.model-hero::after {
    content: '';
    position: absolute;
    bottom: -25%;
    left: -8%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(245,158,11,0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.model-hero .hero-inner { position: relative; z-index: 1; }
.model-hero h2 {
    color: #fff;
    font-size: 42px;
    margin-bottom: 14px;
    font-weight: 800;
    letter-spacing: -1px;
}
.model-hero h2 span {
    background: linear-gradient(90deg, #FDE68A, #F59E0B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.model-hero .subtitle {
    font-size: 17px;
    opacity: 0.88;
    line-height: 1.9;
    margin-bottom: 36px;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}
.model-hero .hero-stats { margin-bottom: 36px; }
.model-hero .hero-stats .hero-stat {
    display: inline-block;
    margin: 0 28px;
    text-align: center;
    vertical-align: top;
}
.hero-stat .stat-number {
    font-size: 38px;
    font-weight: 800;
    color: #FDE68A;
    line-height: 1;
    display: block;
    margin-bottom: 6px;
}
.hero-stat .stat-label {
    font-size: 13px;
    opacity: 0.72;
    letter-spacing: 0.5px;
}
.hero-stat-divider {
    display: inline-block;
    width: 1px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    vertical-align: middle;
    margin: 0 4px;
}

/* ----- Buttons ----- */
.otf-btn {
    display: inline-block;
    padding: 14px 40px;
    font-size: 16px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    letter-spacing: 0.3px;
    position: relative;
}
.otf-btn:active { transform: scale(0.97); }
.otf-btn-primary {
    background: linear-gradient(135deg, #F59E0B, #d97706);
    color: #fff;
    box-shadow: 0 2px 8px rgba(245,158,11,0.35), 0 1px 2px rgba(0,0,0,0.1);
}
.otf-btn-primary:hover {
    background: linear-gradient(135deg, #F59E0B, #c27803);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(245,158,11,0.45), 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}
.otf-btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.35);
}
.otf-btn-outline:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
    border-color: rgba(255,255,255,0.6);
}
.otf-btn-enroll {
    background: linear-gradient(135deg, #F59E0B, #d97706);
    color: #fff;
    font-size: 18px;
    padding: 16px 52px;
    box-shadow: 0 4px 20px rgba(245,158,11,0.4);
}
.otf-btn-enroll:hover {
    background: linear-gradient(135deg, #e5a50a, #b95f03);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(245,158,11,0.5);
}
.otf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ----- Section Common ----- */
.model-section { padding: 48px 0 64px; min-height: 370px; }
.model-section-alt { background: #f8fafc; }
.model-section-colored { background: #eff6ff; }
.width80 { max-width: 1050px; margin: 0 auto; padding: 0 20px; }

.section-header { text-align: center; margin-bottom: 52px; }
.section-header .section-accent {
    display: inline-block;
    width: 52px;
    height: 4px;
    background: linear-gradient(90deg, #2563EB, #7C3AED);
    border-radius: 2px;
    margin-bottom: 24px;
}
.section-header h3 {
    font-size: 30px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}
.section-header .section-desc {
    font-size: 15px;
    color: #64748b;
}

/* ----- How It Works (4 Steps) ----- */
.steps-row {
    text-align: center;
    position: relative;
    margin-top: 66px;
}
.steps-row::before {
    content: '';
    position: absolute;
    top: 40px;
    left: 18%;
    right: 18%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #c7d2fe 15%, #c7d2fe 85%, transparent);
    z-index: 0;
}
.model-step {
    display: inline-block;
    width: 200px;
    vertical-align: top;
    text-align: center;
    padding: 0 12px;
    position: relative;
    z-index: 1;
    margin: 0 8px;
}
.step-icon-wrap {
    width: 80px;
    height: 80px;
    line-height: 76px;
    border-radius: 50%;
    background: #fff;
    margin: 0 auto 18px;
    box-shadow: 0 2px 12px rgba(37,99,235,0.1);
    border: 2px solid #e0e7ff;
    position: relative;
    font-size: 32px;
}
.step-icon-wrap .step-num-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 26px;
    height: 26px;
    line-height: 26px;
    border-radius: 50%;
    background: #2563EB;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(37,99,235,0.35);
}
.model-step h5 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.model-step p {
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}

/* ----- AI Model Cards Grid ----- */
.model-cards-row {
    font-size: 0;
    text-align: center;
}
.model-card-col {
    display: inline-block;
    vertical-align: top;
    width: 16.3%;
    min-width: 140px;
    font-size: 14px;
    padding: 0 8px;
    margin-bottom: 16px;
}
.model-card {
    background: #fff;
    border-radius: 12px;
    padding: 26px 10px 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 3px 10px rgba(0,0,0,0.03);
    border: 1px solid #eef2f6;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.model-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.1), 0 2px 6px rgba(0,0,0,0.05);
    border-color: #bfdbfe;
}
.model-card-top {
    border-color: #F59E0B;
    box-shadow: 0 1px 3px rgba(245,158,11,0.07), 0 4px 14px rgba(245,158,11,0.07);
}
.model-card-top:hover {
    border-color: #F59E0B;
    box-shadow: 0 6px 20px rgba(245,158,11,0.15);
}
.model-card .rank-badge {
    position: absolute;
    top: 0;
    right: 0;
}
.model-card .rank-badge-inner {
    display: inline-block;
    background: linear-gradient(135deg, #F59E0B, #d97706);
    color: #fff;
    padding: 3px 10px 3px 12px;
    border-radius: 0 0 0 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.model-card .model-icon-box {
    width: 42px;
    height: 42px;
    line-height: 42px;
    border-radius: 10px;
    margin: 0 auto 10px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.model-card .model-name {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.model-card .accuracy {
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -1px;
}
.model-card .accuracy small {
    font-size: 15px;
    font-weight: 500;
}
.model-card .detail {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 12px;
}
.model-card .progress {
    height: 6px;
    margin-bottom: 0;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}
.model-card .progress .bar {
    border-radius: 4px;
    min-width: 4px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----- User Ranking Table ----- */
.model-rank-panel {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid #eef2f6;
}
.model-rank-panel .nav-tabs {
    border-bottom: 2px solid #eef2f6;
    padding: 0 20px;
    background: #fafbfc;
}
.model-rank-panel .nav-tabs > li { margin-bottom: -2px; }
.model-rank-panel .nav-tabs > li > a {
    border: none;
    padding: 13px 24px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    margin-right: 0;
    border-radius: 0;
    transition: color 0.2s;
}
.model-rank-panel .nav-tabs > li > a:hover {
    color: #2563EB;
    background: transparent;
    border: none;
}
.model-rank-panel .nav-tabs > .active > a,
.model-rank-panel .nav-tabs > .active > a:hover {
    color: #2563EB;
    border: none;
    border-bottom: 3px solid #2563EB;
    background: transparent;
    font-weight: 600;
}
.model-rank-panel .table { margin-bottom: 0; }
.model-rank-panel .table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    border-top: none;
    padding: 12px 8px;
}
.model-rank-panel .table td {
    border-top: 1px solid #f1f5f9;
    padding: 11px 8px;
    vertical-align: middle;
    font-size: 14px;
}
.model-rank-panel .table tr:hover td { background: #f8fafc; }
.model-rank-panel .table tr.rank-top td { background: #fffbeb; }
.rank-medal {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    border-radius: 50%;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}
.rank-medal-1 { background: linear-gradient(135deg, #F59E0B, #d97706); box-shadow: 0 2px 6px rgba(245,158,11,0.35); }
.rank-medal-2 { background: linear-gradient(135deg, #94a3b8, #64748b); box-shadow: 0 2px 6px rgba(100,116,139,0.3); }
.rank-medal-3 { background: linear-gradient(135deg, #d97706, #b45309); box-shadow: 0 2px 6px rgba(180,83,9,0.3); }
.win-badge {
    display: inline-block;
    background: #dc2626;
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.empty-state {
    padding: 48px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}
.empty-state .empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ----- Recent Wins Table ----- */
.recent-table-wrap {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid #eef2f6;
}
.recent-table-wrap .table { margin-bottom: 0; }
.recent-table-wrap .table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    border-top: none;
}
.recent-table-wrap .table td {
    border-top: 1px solid #f1f5f9;
    padding: 11px 8px;
    vertical-align: middle;
}
.recent-table-wrap .table tr:hover td { background: #f8fafc; }
.model-tag {
    display: inline-block;
    background: #fee2e2;
    color: #dc2626;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin: 1px 2px;
}

/* ----- FAQ Section ----- */
.model-faq-list { margin: 0 auto; }
.faq-item {
    background: #fff;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #eef2f6;
    transition: border-color 0.2s;
}
.faq-item:hover { border-color: #bfdbfe; }
.faq-item .faq-q {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.faq-item .faq-q .faq-num {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 6px;
    background: #eff6ff;
    color: #2563EB;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    margin-right: 8px;
}
.faq-item .faq-a {
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;
    padding-left: 32px;
}


/* ----- Enrollment Status ----- */
.enroll-status-tag {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}
.enroll-status-success {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
}

/* ----- Utility ----- */
.text-muted { color: #94a3b8; }
.text-sm { font-size: 13px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

@keyframes countIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: countIn 0.5s ease-out forwards; }

/* ----- Responsive ----- */
@media (max-width: 767px) {
    .model-hero { margin-top: -60px; padding: 90px 0 40px; }
    .model-hero h2 { font-size: 28px; }
    .model-hero .subtitle { font-size: 14px; }
    .hero-stat .stat-number { font-size: 26px; }
    .hero-stat-divider { height: 36px; margin: 0 2px; }
    .hero-stats .hero-stat { margin: 0 12px; }
    .model-card-col { width: 47%; min-width: 0; margin-bottom: 12px; }
    .model-card { padding: 20px 8px 16px; }
    .model-card .accuracy { font-size: 32px; }
    .model-step { width: 140px; margin: 0 4px; padding: 0 4px; }
    .steps-row::before { left: 10%; right: 10%; }
    .model-section { padding: 40px 0; }
    .section-header h3 { font-size: 24px; }
    .otf-btn { padding: 12px 28px; font-size: 14px; }
    .otf-btn-enroll { padding: 14px 36px; font-size: 16px; }
}

/* ----- AI Model Accuracy Ranking Table ----- */
.accuracy-rank-table { table-layout: fixed; width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; border: 1px solid #eef2f6; }
.accuracy-rank-table thead th { background: #f8fafc; color: #64748b; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding: 12px 16px; border-bottom: 2px solid #eef2f6; text-align: left; }
.accuracy-rank-table thead th:first-child { text-align: center; width: 60px; }
.accuracy-rank-table thead th:nth-child(2) { width: 180px; }
.accuracy-rank-table thead th:nth-child(3) { width: 200px; }
.accuracy-rank-table thead th:nth-child(4) { text-align: right; width: 100px; }
.accuracy-rank-table thead th:nth-child(5) { width: 160px; }
.accuracy-rank-table tbody td { padding: 14px 16px; border-bottom: 1px solid #f1f5f9; font-size: 14px; vertical-align: middle; }
.accuracy-rank-table tbody tr:last-child td { border-bottom: none; }
.accuracy-rank-table tbody tr:hover td { background: #f8fafc; }
.accuracy-rank-table .rank-cell { text-align: center; }
.accuracy-rank-table .rank-num { display: inline-block; width: 28px; height: 28px; line-height: 28px; border-radius: 50%; font-weight: 700; font-size: 13px; color: #64748b; background: #f1f5f9; }
.accuracy-rank-table tr:nth-child(1) .rank-num { background: #2563EB; color: #fff; }
.accuracy-rank-table tr:nth-child(2) .rank-num { background: #64748b; color: #fff; }
.accuracy-rank-table tr:nth-child(3) .rank-num { background: #92400e; color: #fff; }
.accuracy-rank-table .model-cell { font-weight: 600; color: #1e293b; }
.accuracy-rank-table .model-cell .model-provider { font-size: 12px; color: #94a3b8; font-weight: 400; }
.accuracy-rank-table .type-cell { font-size: 13px; color: #475569; }
.accuracy-rank-table .type-cell span { display: block; line-height: 1.6; }
.accuracy-rank-table .type-cell .type-label { font-size: 11px; color: #94a3b8; }
.accuracy-rank-table .acc-cell { text-align: right; font-weight: 700; font-size: 18px; }
.accuracy-rank-table .acc-cell small { font-size: 12px; font-weight: 500; color: #94a3b8; }
.accuracy-rank-table .bar-cell { width: 180px; }
.accuracy-rank-table .bar-cell .progress { height: 8px; margin: 0; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.accuracy-rank-table .bar-cell .bar { border-radius: 4px; min-width: 4px; transition: width 0.8s ease; }
.accuracy-tabs { margin-bottom: 24px; text-align: center; }
.accuracy-tabs .tab-btn { display: inline-block; padding: 10px 28px; margin: 0 4px; border: 1px solid #e2e8f0; border-radius: 24px; background: #fff; color: #64748b; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; transition: all 0.2s; }
.accuracy-tabs .tab-btn:hover { color: #2563EB; border-color: #bfdbfe; }
.accuracy-tabs .tab-btn.active { background: #2563EB; color: #fff; border-color: #2563EB; }

/* ----- Scroll Reveal Animation ----- */
.section-reveal { opacity: 1; }
.section-reveal.visible { opacity: 1; transform: translateY(0); }

/* ----- Recent Wins Timeline ----- */
.recent-table-wrap { background: transparent; border: none; box-shadow: none; overflow: visible; position: relative; padding-left: 28px; }
.recent-table-wrap::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(180deg, #2563EB 0%, #93c5fd 100%); border-radius: 1px; opacity: 0.4; }
.recent-win-card { position: relative; background: #fff; border: 1px solid #eef2f6; border-radius: 10px; padding: 18px 22px; margin-bottom: 14px; transition: border-color 0.2s, box-shadow 0.2s; }
.recent-win-card:hover { border-color: #bfdbfe; box-shadow: 0 2px 12px rgba(37,99,235,0.05); }
.recent-win-card::before { content: ''; position: absolute; left: -23px; top: 24px; width: 10px; height: 10px; background: #fff; border: 2px solid #93c5fd; border-radius: 50%; }
.recent-win-card .win-header { display: flex; align-items: center; margin-bottom: 12px; gap: 10px; }
.recent-win-card .win-avatar-link { flex-shrink: 0; }
.recent-win-card .win-avatar { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #e0e7ff; display: block; transition: border-color 0.2s; }
.recent-win-card .win-avatar-link:hover .win-avatar { border-color: #2563EB; }
.recent-win-card .win-user-info { flex: 1; min-width: 0; line-height: 1.3; }
.recent-win-card .win-user-info a { color: #333; font-weight: 600; font-size: 14px; text-decoration: none; }
.recent-win-card .win-user-info a:hover { color: #2563EB; }
.recent-win-card .win-story { font-size: 14px; color: #64748b; margin-bottom: 10px; line-height: 1.7; padding-left: 44px; }
.recent-win-card .win-story a { color: #334155; font-weight: 500; text-decoration: none; border-bottom: 1px solid #e2e8f0; }
.recent-win-card .win-story a:hover { color: #2563EB; border-bottom-color: #93c5fd; }
.recent-win-card .win-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding-left: 44px; }
.recent-win-card .win-tags-label { font-size: 12px; color: #94a3b8; margin-right: 4px; }
.recent-win-card .win-time { position: absolute; top: 18px; right: 22px; font-size: 12px; color: #94a3b8; }
.model-tag { display: inline-block; background: #fef3c7; color: #92400e; padding: 3px 12px; border-radius: 20px; font-size: 12px; font-weight: 500; line-height: 1.5; }
@media (max-width: 767px) {
    .recent-win-card .win-time { position: static; margin-top: 10px; padding-left: 44px; }
    .recent-win-card { padding: 14px 16px; }
    .recent-win-card .win-story, .recent-win-card .win-tags { padding-left: 0; }
}

.rank-num-plain { display: inline-block; width: 28px; height: 28px; line-height: 28px; border-radius: 50%; text-align: center; font-weight: 600; font-size: 13px; color: #64748b; background: #f1f5f9; }

/* Fix back-to-top button on model page */
#toolBackTo.back-to, #toolBackTo.back-to-show { z-index: 9999; right: 20px; }
