
/* Pharmacy Quiz Modern Card-Grid Portal */
.pq-portal {
    max-width: 1180px;
    margin: 24px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #0f172a;
}

/* Selector / Filter Panel (Mint-tinted rounded container) */
.pq-selector-panel {
    background: #f0fdf4;
    border: 1px solid #d1fae5;
    border-radius: 16px;
    padding: 20px 22px;
    margin-bottom: 24px;
}
.pq-selector-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.pq-portal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}
.pq-portal-sub {
    font-weight: 600;
    color: #047857;
}
.pq-portal-lead {
    margin: 4px 0 0;
    font-size: 13.5px;
    color: #475569;
}
.pq-count-chip {
    background: #ffffff;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
}

.pq-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
}
.pq-filter-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 200px;
}
.pq-filter-grow {
    flex: 1;
    min-width: 220px;
}
.pq-filter-field label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #64748b;
}
.pq-select-input,
.pq-text-input {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 14px;
}
.pq-btn-emerald {
    height: 40px;
    padding: 0 18px;
    background: #047857 !important;
    color: #ffffff !important;
    border: 0 !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    opacity: 1 !important;
}
.pq-btn-emerald:hover {
    background: #065f46 !important;
}

/* 4-Column Responsive Card Grid */
.pq-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}
@media (max-width: 1024px) {
    .pq-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .pq-card-grid { grid-template-columns: 1fr; }
}

.pq-grid-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.pq-grid-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
    border-color: #a7f3d0;
}

.pq-card-media {
    position: relative;
    height: 128px;
    background-size: cover;
    background-position: center;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.pq-media-pill {
    align-self: flex-start;
    background: rgba(15, 23, 42, 0.65);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
}
.pq-media-bottom {
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.45);
}

.pq-card-body {
    padding: 14px 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}
.pq-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.pq-card-title {
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}
.pq-rating-pill {
    flex-shrink: 0;
    background: #fef3c7;
    color: #92400e;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
}
.pq-card-desc {
    margin: 0;
    font-size: 13px;
    color: #475569;
    line-height: 1.45;
    flex: 1;
}
.pq-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.pq-tag {
    background: #f1f5f9;
    color: #334155;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}
.pq-card-footer {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pq-card-meta {
    font-size: 11.5px;
    color: #64748b;
}
.pq-link-btn {
    background: transparent !important;
    border: 0 !important;
    padding: 4px 0 !important;
    color: #047857 !important;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    opacity: 1 !important;
}
.pq-link-btn:hover {
    color: #065f46 !important;
    text-decoration: underline;
}

.pq-empty-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    color: #475569;
}

/* Active Quiz Container */
.pq-quiz-app {
    max-width: 820px;
    margin: 20px auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    color: #1e293b;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}
.pq-quiz-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.pq-quiz-header h3 { margin: 0; font-size: 19px; color: #0f172a; }
.pq-meta-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pq-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #d1fae5; color: #065f46; }
.pq-timer { background: #fef3c7; color: #92400e; }
.pq-timer.pq-timer-warn { background: #fee2e2; color: #b91c1c; }

.pq-btn { background: #047857 !important; color: #ffffff !important; border: 0 !important; border-radius: 8px; padding: 10px 18px; cursor: pointer; font-weight: 600; opacity: 1 !important; }
.pq-btn:hover { background: #065f46 !important; color: #ffffff !important; }
.pq-btn:disabled { opacity: 0.45 !important; cursor: not-allowed; }
.pq-btn-sec { background: #f1f5f9 !important; color: #1e293b !important; }
.pq-btn-sec:hover { background: #e2e8f0 !important; color: #0f172a !important; }

.pq-progress { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin: 10px 0 18px; }
.pq-progress-fill { height: 100%; background: #059669; transition: width .25s; }

.pq-opt {
    display: block;
    width: 100%;
    text-align: left;
    padding: 13px 16px;
    margin-bottom: 10px;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 10px;
    background-color: #ffffff !important;
    color: #1e293b !important;
    font-size: 15px;
    line-height: 1.4;
    cursor: pointer;
    opacity: 1 !important;
    transition: border-color .15s, background-color .15s;
}
.pq-opt:hover:not(:disabled) { border-color: #059669 !important; background-color: #ecfdf5 !important; color: #064e3b !important; }
.pq-opt.selected { border-color: #047857 !important; background-color: #d1fae5 !important; color: #064e3b !important; font-weight: 600; }
.pq-opt.pq-opt-ok { border-color: #16a34a !important; background-color: #dcfce7 !important; color: #14532d !important; font-weight: 600; }
.pq-opt.pq-opt-bad { border-color: #dc2626 !important; background-color: #fee2e2 !important; color: #7f1d1d !important; }

.pq-hint-box { margin: 10px 0 14px; padding: 10px 14px; background: #fffbeb; border-left: 4px solid #f59e0b; border-radius: 6px; font-size: 14px; color: #78350f; }
.pq-instant-box { margin-top: 12px; padding: 12px 14px; border-radius: 8px; font-size: 14px; }

.pq-img-frame {
    width: 520px;
    max-width: 100%;
    height: 320px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    padding: 6px;
    box-sizing: border-box;
}
.pq-img-stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 100%;
    line-height: 0;
}
.pq-img-stage img {
    display: block;
    max-width: 100%;
    max-height: 306px;
    width: auto;
    height: auto;
}
.pq-pin { position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; background: #dc2626; color: #ffffff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #ffffff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.pq-pin.pq-pin-ok { background: #16a34a; }
.pq-pin.pq-pin-bad { background: #dc2626; }

.pq-label-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.pq-label-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; }
.pq-label-badge { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #dc2626; color: #fff; font-weight: 700; font-size: 13px; }
.pq-label-select { flex: 1; min-width: 180px; padding: 8px 10px; border: 1.5px solid #cbd5e1; border-radius: 6px; background: #ffffff !important; color: #1e293b !important; font-size: 14px; }

.pq-scorecard { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.pq-score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.pq-score-tile { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; text-align: center; }
.pq-score-tile small { display: block; color: #64748b; font-size: 12px; }
.pq-score-tile strong { font-size: 18px; color: #0f172a; }
.pq-pass-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pq-pass-badge.pass { background: #dcfce7; color: #166534; }
.pq-pass-badge.fail { background: #fee2e2; color: #991b1b; }

.pq-review-ok { border-left: 4px solid #16a34a; background: #f0fdf4; padding: 12px 14px; margin-bottom: 12px; color: #14532d; border-radius: 0 8px 8px 0; }
.pq-review-bad { border-left: 4px solid #dc2626; background: #fef2f2; padding: 12px 14px; margin-bottom: 12px; color: #7f1d1d; border-radius: 0 8px 8px 0; }
