/* =============================================================================
   IQ Test — Styles (Orange theme, matches project)
   ============================================================================= */

.iq-app {
    max-width: 720px;
    margin: 0 auto;
}

.iq-hidden { display: none !important; }

/* Hero / Welcome */
.iq-hero {
    text-align: center;
    padding: 48px 24px;
}

.iq-hero-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 28px rgba(249, 115, 22, 0.3);
}

.iq-hero-icon svg {
    width: 36px;
    height: 36px;
    stroke: #fff;
}

.iq-hero-title {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.iq-hero-subtitle {
    font-size: 1.1rem;
    color: #f97316;
    font-weight: 600;
    margin: 0 0 16px;
}

.iq-hero-desc {
    color: #64748b;
    line-height: 1.8;
    max-width: 480px;
    margin: 0 auto 32px;
    font-size: 0.95rem;
}

/* Features */
.iq-features {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.iq-feature {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.iq-feature svg {
    width: 28px;
    height: 28px;
    stroke: #f97316;
    background: rgba(249, 115, 22, 0.08);
    padding: 12px;
    box-sizing: content-box;
    border-radius: 14px;
}

.iq-feature span {
    font-size: 0.85rem;
    color: #475569;
    font-weight: 600;
}

/* Buttons */
.iq-btn {
    display: inline-block;
    padding: 14px 36px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    text-decoration: none;
    text-align: center;
}

.iq-btn-primary {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.35);
}

.iq-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.45);
}

.iq-btn-outline {
    background: #fff;
    color: #f97316;
    border: 2px solid #f97316;
}

.iq-btn-outline:hover {
    background: rgba(249, 115, 22, 0.06);
}

/* Top 10 */
.iq-top10 {
    margin-top: 48px;
    padding-top: 36px;
    border-top: 1px solid #e2e8f0;
}

.iq-top10-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.iq-top10-title svg { stroke: #f97316; }

.iq-top10-list {
    max-width: 480px;
    margin: 0 auto;
}

.iq-top10-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    transition: background 0.2s;
}

.iq-top10-item:hover {
    background: #f8fafc;
}

.iq-rank {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    flex-shrink: 0;
}

.iq-rank-top {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
}

.iq-rank-name {
    flex: 1;
    font-weight: 600;
    color: #0f172a;
    font-size: 0.9rem;
}

.iq-rank-country {
    font-size: 0.8rem;
    color: #94a3b8;
}

.iq-rank-score {
    font-weight: 800;
    font-size: 1rem;
    color: #f97316;
    min-width: 36px;
    text-align: right;
}

.iq-top10-more {
    display: inline-block;
    margin-top: 16px;
    font-size: 0.9rem;
    color: #f97316;
    font-weight: 600;
    text-decoration: none;
}

.iq-top10-more:hover {
    text-decoration: underline;
}

/* Test Section */
.iq-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #fff7ed;
    border: 1px solid rgba(249, 115, 22, 0.15);
    border-radius: 12px;
    margin-bottom: 16px;
}

.iq-timer {
    font-weight: 700;
    font-size: 0.95rem;
    color: #ea580c;
    display: flex;
    align-items: center;
    gap: 6px;
}

.iq-timer svg { stroke: #ea580c; }

.iq-pos {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: #475569;
    font-size: 0.9rem;
}

.iq-percent {
    background: #f97316;
    color: #fff;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.iq-progress {
    width: 100%;
    border-radius: 3px;
    overflow: hidden;
}


.iq-progress .tips{
    font-weight: bold;
    color: #ff2424;
    margin-top: 12px;
}

.iq-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #f97316, #ea580c);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.iq-question-box {
    background: #fafafa;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iq-question-img {
    max-width: 100%;
    height: auto;
    display: block;
}

.iq-answers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.iq-answer {
    cursor: pointer;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.iq-answer:hover {
    border-color: #f97316;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.15);
    transform: translateY(-2px);
}

.iq-answer.iq-answer-selected {
    border-color: #f97316;
    background: #fff7ed;
}

.answer-text {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: #0f172a;
    margin-top: 8px;
}

.iq-answer img {
    width: 100%;
    display: block;
    aspect-ratio: 1/1;
    object-fit: contain;
    padding: 8px;
}

/* Country Section */
.iq-country-box {
    text-align: center;
    padding: 48px 24px;
}

.iq-country-box h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
}

.iq-country-box p {
    color: #64748b;
    margin-bottom: 24px;
}

.iq-input, .iq-select {
    width: 100%;
    max-width: 380px;
    padding: 14px 18px;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 16px;
    transition: border-color 0.2s;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.iq-input:focus, .iq-select:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
}

/* Results */
.iq-result-box {
    text-align: center;
    padding: 48px 24px;
}

.iq-result-box h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 24px;
}

.iq-score-ring {
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #ea580c);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 40px rgba(249, 115, 22, 0.35);
}

.iq-score-number {
    font-size: 3.5rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
}

.iq-score-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 700;
    letter-spacing: 2px;
}

.iq-score-level {
    font-size: 1.3rem;
    font-weight: 800;
    color: #f97316;
    margin-bottom: 6px;
}

.iq-score-desc {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 28px;
}

.iq-details {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 8px 20px;
    max-width: 400px;
    margin: 0 auto 28px;
}

.iq-detail {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.iq-detail:last-child { border-bottom: none; }
.iq-detail span { color: #64748b; }
.iq-detail strong { color: #0f172a; }

.iq-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Ad Carousel Modal */
.iq-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
}

.ad-carousel-wrap {
    position: relative;
    width: 90%;
    max-width: 420px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.22);
    background: #fff;
}

.ad-carousel-header {
    padding: 20px 24px 12px;
    text-align: center;
}

.ad-progress-text {
    font-size: 0.95rem;
    color: #475569;
    font-weight: 600;
    margin-bottom: 10px;
}
.ad-progress-text strong {
    color: #f97316;
    font-size: 1.25rem;
}

.ad-progress-bar-wrap {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.ad-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #f97316, #fb923c, #f97316);
    background-size: 200% 100%;
    border-radius: 999px;
    transition: width 0.4s ease-out;
    animation: progressShine 2s linear infinite;
}

@keyframes progressShine {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

.ad-carousel {
    position: relative;
    min-height: 240px;
}

.ad-card {
    position: absolute;
    inset: 0;
    padding: 32px 28px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.5s, transform 0.5s;
    pointer-events: none;
}
.ad-card.active {
    position: relative;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.ad-card-tag {
    display: inline-block;
    width: fit-content;
    padding: 5px 14px;
    border-radius: 20px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.ad-card-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px;
    line-height: 1.4;
}

.ad-card-desc {
    font-size: 0.92rem;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 20px;
}

.ad-card-btn {
    display: inline-block;
    width: fit-content;
    padding: 10px 24px;
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s;
}
.ad-card-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: #fff;
}

.ad-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 0 20px;
    background: inherit;
}

.ad-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: all 0.3s;
}
.ad-dot.viewed {
    background: #22c55e;
}
.ad-dot.active {
    width: 24px;
    border-radius: 4px;
    background: #6366f1;
}

/* Ranking Page */
.iq-ranking-page {
    max-width: 900px;
    margin: 0 auto;
}

.iq-ranking-header {
    text-align: center;
    padding: 32px 0 28px;
}

.iq-ranking-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.iq-ranking-header h1 svg { stroke: #f97316; }

.iq-ranking-header p {
    color: #64748b;
    margin-bottom: 20px;
}

.iq-ranking-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.iq-ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.iq-ranking-table thead {
    background: #f8fafc;
}

.iq-ranking-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 700;
    color: #475569;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.iq-ranking-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.iq-rank-highlight {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.04), rgba(251, 191, 36, 0.04));
}

.iq-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    background: #e2e8f0;
    color: #64748b;
}

.iq-rank-badge-top {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
}

.iq-rank-name-cell { font-weight: 600; }
.iq-rank-score-cell { font-weight: 800; color: #f97316; }

.iq-level-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.iq-level-genius { background: rgba(249, 115, 22, 0.12); color: #c2410c; }
.iq-level-excellent { background: rgba(16, 185, 129, 0.12); color: #047857; }
.iq-level-good { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; }
.iq-level-normal { background: rgba(100, 116, 139, 0.1); color: #475569; }

/* Pagination */
.iq-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px 0;
}

.iq-page-btn {
    padding: 10px 20px;
    background: #f97316;
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
}

.iq-page-btn:hover {
    background: #ea580c;
    color: #fff;
}

.iq-page-info {
    color: #64748b;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 640px) {
    .iq-hero { padding: 32px 16px; }
    .iq-hero-title { font-size: 1.6rem; }
    .iq-features { gap: 24px; }
    .iq-answers { gap: 8px; }
    .iq-score-ring { width: 130px; height: 130px; }
    .iq-score-number { font-size: 2.8rem; }
    .iq-btn { padding: 12px 28px; font-size: 0.95rem; }
    .iq-status-bar { padding: 10px 14px; }
    .iq-ranking-header h1 { font-size: 1.4rem; }
    .iq-ranking-table { font-size: 0.8rem; }
    .iq-ranking-table th, .iq-ranking-table td { padding: 10px 8px; }
}

/* Animation */
@keyframes iqFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.iq-fade-in {
    animation: iqFadeIn 0.4s ease-out;
}

/* Ranking: current user highlight */
.iq-rank-me {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.06)) !important;
    position: relative;
}
.iq-rank-me td { color: #1e40af !important; font-weight: 600; }
.iq-rank-me .iq-rank-score-cell { color: #2563eb !important; }

.iq-me-tag {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    white-space: nowrap;
    animation: iqMePulse 2s ease-in-out infinite;
}

@keyframes iqMePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
