/**
Plugin Name: solotutes-frontend
Author: Prakash Joshi
Author URI: https://prakashjoshi.in
Description: Custom styles for solotutes-frontend plugin
Stylesheet for: questions template (single-question.php, archive-question.php)
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: solotutes-frontend
*/

/* =========================================
   1. ROOT VARIABLES (Dono --q aur --sq wale)
========================================= */
:root {
  /* For Archive/Hub Page */
  --q-primary: #145BAB;
  --q-primary-hover: #0f4687;
  --q-text-main: #1E293B;
  --q-text-muted: #64748B;
  --q-bg-light: #F4F7F9;
  --q-border: #E2E8F0;
  --q-white: #FFFFFF;
  --q-radius: 10px;
  --q-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);

  /* For Single Question Page (Missing in your code, added here) */
  --sq-primary: #145BAB;
  --sq-success: #22C55E;
  --sq-danger: #EF4444;
  --sq-border: #E2E8F0;
  --sq-card: #FFFFFF;
  --sq-text: #1E293B;
  --sq-muted: #64748B;
  --sq-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  --sq-radius: 10px;
  --sq-bg: #F4F7F9;
}

/* =========================================
   2. MAIN WRAPPERS (Width Fixed for Sidebar Layout)
========================================= */
.sq-page-wrapper, .qhub-wrapper { 
    width: 100%; 
    margin: 20px 0; 
    padding: 0; 
    font-family: 'Inter', sans-serif; 
    color: var(--sq-text); 
    box-sizing: border-box;
}

/* =========================================
   3. SINGLE QUESTION PAGE STYLES
========================================= */
/* Breadcrumbs */
.sq-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; margin-bottom: 25px; color: var(--sq-muted); }
.sq-breadcrumb a { color: var(--sq-primary); text-decoration: none; font-weight: 500; }
.sq-breadcrumb a:hover { text-decoration: underline; }
.sq-breadcrumb span { color: #cbd5e1; }

/* Main Question Box */
.sq-main-card { background: var(--sq-card); border: 1px solid var(--sq-border); border-radius: var(--sq-radius); padding: 40px; box-shadow: var(--sq-shadow); margin-bottom: 40px; }
.sq-badge-type { display: inline-block; background: #EEF2FF; color: var(--sq-primary); font-size: 12px; font-weight: 800; padding: 6px 12px; border-radius: 20px; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 0.5px; }

.sq-q-title { font-size: 26px; font-weight: 800; margin: 0 0 25px 0; line-height: 1.4; color: #0f172a; }
.sq-hi-text { display: block; margin-top: 8px; font-size: 18px; color: var(--sq-muted); font-weight: 500; }

/* Answers (QA & OLN) */
.sq-answer-block {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-left: 5px solid #22C55E;
    border-radius: 8px;
    padding: 20px 25px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}
.sq-answer-icon { flex-shrink: 0; margin-top: 2px; }
.sq-answer-content { color: #14532D; font-size: 17px; font-weight: 600; line-height: 1.6; flex-grow: 1; }
.sq-answer-content p { margin: 0 0 10px 0; }
.sq-answer-content p:last-child { margin: 0; }

/* Options (MCQ) */
.sq-options-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.sq-opt-item { display: flex; align-items: center; gap: 15px; padding: 15px 20px; border: 2px solid var(--sq-border); border-radius: 8px; cursor: pointer; transition: 0.2s; background: #fafafa; font-weight: 500; }
.sq-opt-item:hover { border-color: var(--sq-primary); background: #fff; }
.sq-opt-item.correct { background: #F0FDF4; border-color: var(--sq-success); color: #166534; }
.sq-opt-item.wrong { background: #FEF2F2; border-color: var(--sq-danger); color: #991B1B; }
.sq-opt-letter { background: var(--sq-border); color: var(--sq-muted); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; font-size: 13px; }
.sq-opt-item.correct .sq-opt-letter { background: var(--sq-success); color: #fff; }
.sq-opt-item.wrong .sq-opt-letter { background: var(--sq-danger); color: #fff; }
.opt-status-icon { margin-left: auto; font-weight: 700; font-size: 14px; }

.sq-explanation { margin-top: 20px; background: #FFFBEB; border: 1px solid #FEF3C7; padding: 20px; border-radius: 8px; display: none; }
.sq-explanation strong { color: #B45309; display: block; margin-bottom: 8px; }

/* Sections Common */
.sq-section-title { font-size: 24px; font-weight: 800; margin: 0 0 25px 0; padding-bottom: 10px; border-bottom: 2px solid var(--sq-border); color: var(--sq-text); }

/* Parent Post Banner */
.parent-post-banner { background: linear-gradient(135deg, var(--sq-primary), #074bb3); border-radius: var(--sq-radius); padding: 30px; display: flex; align-items: center; gap: 30px; color: #fff; box-shadow: 0 10px 25px rgba(20,91,171,0.2); margin-bottom: 40px; }
.parent-img { width: 120px; height: 120px; border-radius: 8px; object-fit: cover; border: 2px solid rgba(255,255,255,0.2); flex-shrink: 0; }
.parent-info h4 { margin: 0 0 10px 0; font-size: 22px; color: #fff; }
.parent-info p { margin: 0 0 20px 0; font-size: 14px; opacity: 0.9; }
.parent-btn { background: #fff; color: var(--sq-primary); padding: 10px 20px; border-radius: 6px; font-weight: 700; text-decoration: none; display: inline-block; transition: 0.2s; }
.parent-btn:hover { background: #f1f5f9; }

/* Related MCQs Grid */
.mcq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-bottom: 40px; }
.mcq-card { background: var(--sq-card); border: 1px solid var(--sq-border); padding: 25px; border-radius: var(--sq-radius); box-shadow: var(--sq-shadow); }
.mcq-title { font-weight: 700; font-size: 16px; margin-bottom: 15px; line-height: 1.4; }
.mcq-title a { color: var(--sq-text); text-decoration: none; }
.mcq-title a:hover { color: var(--sq-primary); }
.mcq-card .sq-options-list { gap: 8px; }
.mcq-card .sq-opt-item { padding: 10px 15px; font-size: 14px; }
.mcq-card .sq-opt-letter { width: 24px; height: 24px; font-size: 11px; }

/* Related QA/OLN List */
.qa-text-list { display: flex; flex-direction: column; gap: 15px; margin-bottom: 50px; }
.qa-text-item { background: var(--sq-card); border: 1px solid var(--sq-border); border-radius: 8px; padding: 20px; transition: 0.2s; display: flex; gap: 15px; align-items: flex-start; text-decoration: none; color: var(--sq-text); }
.qa-text-item:hover { border-color: var(--sq-primary); box-shadow: var(--sq-shadow); transform: translateX(5px); }
.qa-text-icon { background: #EEF2FF; color: var(--sq-primary); width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.qa-text-content h4 { margin: 0 0 5px 0; font-size: 16px; line-height: 1.4; }
.qa-text-content p { margin: 0; font-size: 13px; color: var(--sq-muted); }

/* Mixed Content Grid (Explore More) */
.explore-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; margin-bottom: 40px; }
.explore-card { background: var(--sq-card); border: 1px solid var(--sq-border); border-radius: var(--sq-radius); overflow: hidden; display: flex; flex-direction: column; transition: 0.2s; box-shadow: var(--sq-shadow); }
.explore-card:hover { transform: translateY(-4px); border-color: #cbd5e1; }
.e-thumb { height: 150px; background: var(--sq-bg); position: relative; }
.e-thumb img { width: 100%; height: 100%; object-fit: cover; }
.e-badge { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,0.95); font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 4px; color: var(--sq-primary); text-transform: uppercase; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.e-body { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.e-body h4 { margin: 0 0 10px 0; font-size: 15px; line-height: 1.4; }
.e-body a { color: var(--sq-text); text-decoration: none; }
.e-body a:hover { color: var(--sq-primary); }
.e-meta { font-size: 12px; color: var(--sq-muted); margin-top: auto; padding-top: 15px; border-top: 1px solid var(--sq-border); display: flex; justify-content: space-between; }


/* =========================================
   4. ARCHIVE / HUB PAGE STYLES
========================================= */
/* Breadcrumb */
.qhub-breadcrumb { font-size: 14px; margin-bottom: 25px; color: var(--q-text-muted); display: flex; align-items: center; gap: 8px; }
.qhub-breadcrumb a { color: var(--q-primary); text-decoration: none; font-weight: 500; }
.qhub-breadcrumb a:hover { text-decoration: underline; }

/* Page Header */
.qhub-header { background: var(--q-bg-light); border-radius: var(--q-radius); padding: 40px; margin-bottom: 40px; text-align: center; border: 1px solid var(--q-border); }
.qhub-header h1 { margin: 0 0 10px 0; font-size: 32px; font-weight: 800; color: var(--q-text-main); }
.qhub-header p { margin: 0; color: var(--q-text-muted); font-size: 16px; }

/* Filters Bar */
.qhub-filters { display: flex; justify-content: space-between; align-items: center; background: var(--q-white); padding: 15px 20px; border-radius: var(--q-radius); border: 1px solid var(--q-border); margin-bottom: 30px; box-shadow: var(--q-shadow); gap: 20px; flex-wrap: wrap; }
.q-search-box { flex: 1; min-width: 250px; position: relative; }
.q-search-box input { width: 100%; padding: 12px 15px 12px 40px; border: 1px solid var(--q-border); border-radius: 6px; font-size: 14px; outline: none; }
.q-search-box i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--q-text-muted); }
.q-type-filter select { padding: 12px 20px; border: 1px solid var(--q-border); border-radius: 6px; font-size: 14px; background: var(--q-bg-light); outline: none; cursor: pointer; }

/* Question List Layout */
.q-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 15px; }
.q-list-item { background: var(--q-white); border: 1px solid var(--q-border); border-radius: var(--q-radius); padding: 20px; display: flex; align-items: center; gap: 20px; transition: 0.2s ease; text-decoration: none; color: var(--q-text-main); }
.q-list-item:hover { transform: translateY(-3px); box-shadow: var(--q-shadow); border-color: var(--q-primary); }
.q-item-content { flex: 1; }
.q-item-title { font-size: 16px; font-weight: 600; line-height: 1.5; margin: 0; }
.q-item-icon { color: var(--q-text-muted); transition: 0.2s; }
.q-list-item:hover .q-item-icon { color: var(--q-primary); transform: translateX(5px); }

/* Badges */
.q-badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; flex-shrink: 0; width: 60px; text-align: center; }
.q-badge.qa { background: #E0E7FF; color: var(--q-primary); }
.q-badge.mcq { background: #D1FAE5; color: #059669; }
.q-badge.oln { background: #FCE7F3; color: #BE185D; }

/* Hub Grid Layout */
.qhub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; }
.subject-card { background: var(--q-white); border: 1px solid var(--q-border); border-radius: var(--q-radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--q-shadow); }
.subject-card-head { background: var(--q-bg-light); padding: 20px; border-bottom: 1px solid var(--q-border); display: flex; justify-content: space-between; align-items: center; }
.subject-card-head h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--q-text-main); }
.subject-card-body { padding: 0; flex-grow: 1; }
.hub-preview-list { list-style: none; margin: 0; padding: 0; }
.hub-preview-list li { border-bottom: 1px solid var(--q-bg-light); }
.hub-preview-list li:last-child { border-bottom: none; }
.hub-preview-list a { display: flex; align-items: flex-start; gap: 12px; padding: 15px 20px; text-decoration: none; color: var(--q-text-main); transition: 0.2s; }
.hub-preview-list a:hover { background: var(--q-bg-light); }
.hub-preview-title { font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.subject-card-footer { padding: 15px 20px; border-top: 1px solid var(--q-border); background: var(--q-white); }
.btn-view-all { display: block; text-align: center; padding: 10px; background: var(--q-bg-light); color: var(--q-primary); border-radius: 6px; font-size: 14px; font-weight: 600; text-decoration: none; transition: 0.2s; }
.btn-view-all:hover { background: var(--q-primary); color: var(--q-white); }

/* Pagination */
.st-pagination { margin-top: 40px; display: flex; justify-content: center; gap: 8px; }
.st-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 10px; background: var(--q-white); border: 1px solid var(--q-border); border-radius: 6px; color: var(--q-text-main); text-decoration: none; font-weight: 600; transition: 0.2s; }
.st-pagination .page-numbers:hover { background: var(--q-bg-light); }
.st-pagination .page-numbers.current { background: var(--q-primary); color: var(--q-white); border-color: var(--q-primary); }

/* =========================================
   5. RESPONSIVE QUERIES
========================================= */
@media(max-width: 768px) {
  .sq-main-card { padding: 20px; }
  .sq-q-title { font-size: 22px; }
  .parent-post-banner { flex-direction: column; text-align: center; }
  .qa-text-item { flex-direction: column; gap: 10px; }
  .qhub-filters { flex-direction: column; align-items: stretch; }
  .q-list-item { flex-direction: column; align-items: flex-start; gap: 10px; }
  .q-badge { width: auto; display: inline-block; }
  .qhub-grid { grid-template-columns: 1fr; }
}