/* ENT Test — Detail Page (mobile-first) */

.enttest-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px 12px;
}

/* ── Back link ── */
.enttest-detail-back {
    display: inline-block;
    font-size: 13px;
    color: #4052B5;
    text-decoration: none;
    margin-bottom: 12px;
    font-weight: 500;
}
.enttest-detail-back:hover {
    text-decoration: underline;
    color: #3445a0;
}

/* ── Hero Banner ── */
.enttest-detail-hero {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    min-height: 160px;
    display: flex;
    align-items: flex-end;
    margin-bottom: 16px;
}
.enttest-detail-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.enttest-detail-hero-overlay {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 20px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
}
.enttest-detail-badge {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}
.enttest-detail-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ── Rating + Sales Row ── */
.enttest-detail-meta-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.enttest-detail-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}
.enttest-detail-star {
    color: #f59e0b;
    font-size: 16px;
}
.enttest-detail-review-count {
    color: #94a3b8;
    font-weight: 400;
}
.enttest-detail-sales {
    font-size: 13px;
    color: #64748b;
}

/* ── Stats Pills ── */
.enttest-detail-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.enttest-detail-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e8eaee;
    text-align: center;
}
.enttest-detail-stat-val {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}
.enttest-detail-stat-label {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}
.enttest-detail-stat-free {
    color: #059669;
}
.enttest-detail-stat-promo {
    color: #ef4444;
}
.enttest-detail-stat-old {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: line-through;
}
.enttest-detail-stat--price {
    border-color: #4052B5;
    background: #f0f2ff;
}

/* ── Promo Banner ── */
.enttest-detail-promo-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 10px;
    font-size: 13px;
    color: #92400e;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.enttest-detail-promo-pct {
    font-weight: 700;
    background: #ef4444;
    color: #fff;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
}
.enttest-detail-promo-timer {
    margin-left: auto;
    font-weight: 600;
    white-space: nowrap;
}

/* ── CTA Buttons ── */
.enttest-detail-cta {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.enttest-detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}
.enttest-detail-btn--primary {
    background: #4052B5;
    color: #fff;
    flex: 1;
    min-width: 0;
}
.enttest-detail-btn--primary:hover {
    background: #3445a0;
    color: #fff;
    text-decoration: none;
}
.enttest-detail-btn--outline {
    background: #fff;
    color: #4052B5;
    border: 1px solid #4052B5;
}
.enttest-detail-btn--outline:hover {
    background: #f0f2ff;
    color: #3445a0;
    text-decoration: none;
}
.enttest-detail-btn--sm {
    padding: 8px 16px;
    font-size: 13px;
    flex: none;
}

/* ── Disabled CTA button ── */
.enttest-detail-btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Fill questions banner (owner, incomplete) ── */
.enttest-detail-fill {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
    border: 1px solid #bfdbfe;
    border-left: 4px solid #3b82f6;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}
.enttest-detail-fill-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}
.enttest-detail-fill-body {
    flex: 1;
    min-width: 0;
}
.enttest-detail-fill-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 4px;
}
.enttest-detail-fill-desc {
    font-size: 13px;
    color: #3b82f6;
    line-height: 1.4;
    margin-bottom: 10px;
}
.enttest-detail-fill-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.enttest-detail-fill-bar {
    flex: 1;
    height: 8px;
    background: #dbeafe;
    border-radius: 4px;
    overflow: hidden;
}
.enttest-detail-fill-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 4px;
    transition: width 0.3s ease;
    min-width: 2px;
}
.enttest-detail-fill-nums {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
}
.enttest-detail-fill-nums b {
    color: #1e40af;
    font-weight: 700;
}
.enttest-detail-fill-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: #3b82f6;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.enttest-detail-fill-btn:hover {
    background: #2563eb;
    color: #fff;
    text-decoration: none;
}

/* ── Author preview banner (shown to owner/admin for unapproved tests) ── */
.enttest-detail-preview {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 18px;
    margin-bottom: 20px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.08);
}
.enttest-detail-preview-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}
.enttest-detail-preview-body {
    flex: 1;
    min-width: 0;
}
.enttest-detail-preview-title {
    font-size: 14px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 2px;
}
.enttest-detail-preview-desc {
    font-size: 13px;
    color: #78350f;
    line-height: 1.5;
}
.enttest-detail-preview-desc b {
    color: #92400e;
    font-weight: 700;
}

/* ── Sections ── */
.enttest-detail-section {
    margin-bottom: 24px;
}
.enttest-detail-section h2 {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8eaee;
}
.enttest-detail-review-total {
    font-weight: 400;
    color: #94a3b8;
    font-size: 14px;
}

/* Description */
.enttest-detail-desc {
    font-size: 14px;
    line-height: 1.65;
    color: #334155;
}
.enttest-detail-desc p { margin: 0 0 10px; }
.enttest-detail-desc p:last-child { margin: 0; }

/* ── Subjects ── */
.enttest-detail-subjects {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.enttest-detail-subj {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e8eaee;
    flex-wrap: wrap;
}
.enttest-detail-subj-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    flex: 1;
    min-width: 120px;
}
.enttest-detail-subj-info {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}
.enttest-detail-subj-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: #dbeafe;
    color: #1e40af;
    white-space: nowrap;
}
.enttest-detail-subj-tag--opt {
    background: #fef3c7;
    color: #92400e;
}

/* ── Reviews ── */
.enttest-detail-reviews {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}
.enttest-detail-review {
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e8eaee;
}
.enttest-detail-review-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.enttest-detail-review-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
}
.enttest-detail-review-stars {
    display: flex;
    gap: 1px;
}
.enttest-detail-star-sm {
    font-size: 13px;
    color: #d0d0d0;
}
.enttest-detail-star-sm.filled {
    color: #f59e0b;
}
.enttest-detail-review-date {
    font-size: 11px;
    color: #94a3b8;
    margin-left: auto;
}
.enttest-detail-review-text {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    margin: 0;
}
.enttest-detail-no-reviews {
    font-size: 14px;
    color: #94a3b8;
    text-align: center;
    padding: 24px 16px;
    margin: 0;
}

/* ══════════════════════════════════
   Dark Theme
   ══════════════════════════════════ */
body.theme-dark .enttest-detail-back { color: #7b8efc; }
body.theme-dark .enttest-detail-back:hover { color: #a0aef0; }
body.theme-dark .enttest-detail-title { color: #fff; }
body.theme-dark .enttest-detail-rating { color: #e0e0e0; }
body.theme-dark .enttest-detail-sales { color: #94a3b8; }
body.theme-dark .enttest-detail-stat { background: #1e293b; border-color: #2a2d44; }
body.theme-dark .enttest-detail-stat-val { color: #e0e0e0; }
body.theme-dark .enttest-detail-stat-label { color: #94a3b8; }
body.theme-dark .enttest-detail-stat--price { background: #252850; border-color: #4052B5; }
body.theme-dark .enttest-detail-stat-free { color: #34d399; }
body.theme-dark .enttest-detail-promo-banner { background: linear-gradient(135deg, #422006, #713f12); color: #fde68a; }
body.theme-dark .enttest-detail-btn--primary { background: #4f46e5; color: #fff; }
body.theme-dark .enttest-detail-btn--primary:hover { background: #6366f1; color: #fff; }
body.theme-dark .enttest-detail-btn--outline { background: #1e293b; color: #7b8efc; border-color: #4052B5; }
body.theme-dark .enttest-detail-btn--outline:hover { background: #252850; color: #a0b4fc; }
body.theme-dark .enttest-detail-section h2 { color: #e0e0e0; border-color: #2a2d44; }
body.theme-dark .enttest-detail-desc { color: #cbd5e1; }
body.theme-dark .enttest-detail-subj { background: #1e293b; border-color: #2a2d44; }
body.theme-dark .enttest-detail-subj-name { color: #e0e0e0; }
body.theme-dark .enttest-detail-subj-info { color: #94a3b8; }
body.theme-dark .enttest-detail-subj-tag { background: #1e3a5f; color: #93c5fd; }
body.theme-dark .enttest-detail-subj-tag--opt { background: #422006; color: #fde68a; }
body.theme-dark .enttest-detail-review { background: #1e293b; border-color: #2a2d44; }
body.theme-dark .enttest-detail-review-name { color: #e0e0e0; }
body.theme-dark .enttest-detail-review-text { color: #94a3b8; }
body.theme-dark .enttest-detail-no-reviews { color: #64748b; }
body.theme-dark .enttest-detail-review-total { color: #64748b; }
body.theme-dark .enttest-detail-fill {
    background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(99,102,241,0.08) 100%);
    border-color: rgba(59,130,246,0.3);
    border-left-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
body.theme-dark .enttest-detail-fill-title { color: #93c5fd; }
body.theme-dark .enttest-detail-fill-desc { color: #60a5fa; }
body.theme-dark .enttest-detail-fill-bar { background: #1e3a5f; }
body.theme-dark .enttest-detail-fill-nums { color: #94a3b8; }
body.theme-dark .enttest-detail-fill-nums b { color: #93c5fd; }
body.theme-dark .enttest-detail-fill-btn { background: #4f46e5; color: #fff; }
body.theme-dark .enttest-detail-fill-btn:hover { background: #6366f1; color: #fff; }
body.theme-dark .enttest-detail-preview {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.35);
    border-left-color: #f59e0b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
body.theme-dark .enttest-detail-preview-title { color: #fde68a; }
body.theme-dark .enttest-detail-preview-desc { color: #fbbf24; }
body.theme-dark .enttest-detail-preview-desc b { color: #fef3c7; }

/* ══════════════════════════════════
   Tablet (769px+)
   ══════════════════════════════════ */
@media (min-width: 769px) {
    .enttest-detail {
        padding: 24px 16px;
    }
    .enttest-detail-hero {
        min-height: 220px;
        border-radius: 16px;
        margin-bottom: 20px;
    }
    .enttest-detail-hero-overlay {
        padding: 28px 24px;
    }
    .enttest-detail-title {
        font-size: 26px;
    }
    .enttest-detail-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }
    .enttest-detail-stat {
        padding: 16px 12px;
    }
    .enttest-detail-stat-val {
        font-size: 24px;
    }
    .enttest-detail-stat-label {
        font-size: 12px;
    }
    .enttest-detail-cta {
        flex-wrap: nowrap;
    }
    .enttest-detail-btn {
        padding: 14px 28px;
        font-size: 15px;
    }
    .enttest-detail-section h2 {
        font-size: 18px;
    }
    .enttest-detail-desc {
        font-size: 15px;
    }
    .enttest-detail-review {
        padding: 16px;
    }
}

/* ══════════════════════════════════
   Desktop (1024px+)
   ══════════════════════════════════ */
@media (min-width: 1024px) {
    .enttest-detail-hero {
        min-height: 260px;
    }
    .enttest-detail-title {
        font-size: 30px;
    }
    .enttest-detail-stat-val {
        font-size: 28px;
    }
}

/* ── Access status block ── */
.enttest-detail-access {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 16px 0 16px;
}
.enttest-detail-access-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}
.enttest-detail-access-title {
    font-weight: 700;
    font-size: 15px;
    color: #16a34a;
    margin-bottom: 2px;
}
.enttest-detail-access-info {
    font-size: 14px;
    color: #15803d;
}

/* ── Inline code activation form ── */
.enttest-detail-code-form {
    margin: 20px 0 0;
    padding: 16px;
    background: var(--rui-body-bg, #f8f9fa);
    border: 1px solid var(--rui-border-color, #e5e7eb);
    border-radius: 12px;
}
.enttest-detail-code-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--rui-text-primary, #1d2233);
}
.enttest-detail-code-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.enttest-detail-code-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 16px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 1px solid var(--rui-border-color, #d1d5db);
    border-radius: 8px;
    background: #fff;
    color: var(--rui-text-primary, #1d2233);
    outline: none;
    transition: border-color 0.2s;
    max-width: 220px;
}
.enttest-detail-code-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.enttest-detail-code-btn {
    white-space: nowrap;
    flex-shrink: 0;
}
.enttest-detail-code-msg {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}
.enttest-detail-code-msg--success {
    background: #dcfce7;
    color: #16a34a;
}
.enttest-detail-code-msg--error {
    background: #fee2e2;
    color: #dc2626;
}

/* ── Dark theme ── */
body.theme-dark .enttest-detail-access {
    background: #052e16;
    border-color: #166534;
}
body.theme-dark .enttest-detail-access-title {
    color: #6ee7b7;
}
body.theme-dark .enttest-detail-access-info {
    color: #86efac;
}
body.theme-dark .enttest-detail-code-form {
    background: var(--rui-body-bg, #1e1e2e);
    border-color: var(--rui-border-color, #3f3f5e);
}
body.theme-dark .enttest-detail-code-title {
    color: #e0e0e0;
}
body.theme-dark .enttest-detail-code-input {
    background: #2d2d44;
    border-color: #4f4f6e;
    color: #e0e0e8;
}
body.theme-dark .enttest-detail-code-msg--success {
    background: #064e3b;
    color: #6ee7b7;
}
body.theme-dark .enttest-detail-code-msg--error {
    background: #7f1d1d;
    color: #fca5a5;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    .enttest-detail-code-row {
        flex-direction: column;
    }
    .enttest-detail-code-input {
        max-width: 100%;
        width: 100%;
    }
    .enttest-detail-code-btn {
        width: 100%;
    }
}
