/* =============================================================
   PYQ-PRO DESIGN SYSTEM — assets/pyq-pro.css
   -------------------------------------------------------------
   The visual language taken from the reference mockups (indigo
   palette, pill buttons, circular category icons, rounded soft-
   shadow cards, white breadcrumb pill, hero + search, stats
   banner, dark mode). Applied only where the template adds the
   body class `pyq-pro`, so it never leaks to auth/admin pages.
   Components map onto the existing theme class names so the
   drill-down / launcher keep working unchanged.
   ============================================================= */

body.pyq-pro {
    --primary: #16233D; --primary-light: #3D4E6E; --primary-dark: #0D1626;
    --accent: #C6821F; --success: #2F6B41; --danger: #A3341F;
    --gray-50: #F6F3EB; --gray-100: #EFEADA; --gray-200: #E7E0CE; --gray-300: #D8CDAF;
    --gray-500: #8B93A6; --gray-700: #5B6B85; --gray-900: #16233D;
    --card-bg: #ffffff; --border: #E7E0CE; --text: #2B3A55; --text-muted: #5B6B85;
    --shadow: 0 10px 25px -5px rgba(22,35,61,0.07), 0 8px 10px -6px rgba(22,35,61,0.03);
    --shadow-hover: 0 20px 30px -10px rgba(22,35,61,0.22);
    --radius: 14px;
    background: #F6F3EB; color: var(--text);
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
body.pyq-pro.pyq-dark {
    --gray-50: #1e293b; --gray-100: #334155; --gray-200: #475569; --gray-300: #64748b;
    --gray-500: #94a3b8; --gray-700: #cbd5e1; --gray-900: #f1f5f9;
    --card-bg: #1e293b; --border: #334155; --text: #f1f5f9; --text-muted: #94a3b8;
    background: #0f172a;
}

/* App top bar (sits above the theme header on pro pages) */
.pyq-pro-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; max-width:1280px; margin:0 auto; padding:14px 24px; flex-wrap:wrap; }
.pyq-pro-bar .pyq-pro-logo { font-size:22px; font-weight:800; color:var(--primary); display:flex; align-items:center; gap:8px; letter-spacing:-0.5px; }
.pyq-pro-bar .pyq-pro-logo span { color:var(--gray-900); }
.pyq-pro-bar .pyq-pro-actions { display:flex; align-items:center; gap:10px; }
.pyq-pro-iconbtn { width:40px; height:40px; border-radius:50%; border:1px solid var(--border); background:var(--card-bg); color:var(--gray-500); display:inline-flex; align-items:center; justify-content:center; cursor:pointer; font-size:15px; transition:.2s; }
.pyq-pro-iconbtn:hover { background:var(--gray-100); color:var(--gray-900); }

/* Breadcrumb as a white rounded pill */
body.pyq-pro .pyq-breadcrumb { background:var(--card-bg); border:1px solid var(--gray-100); border-radius:12px; padding:12px 16px; box-shadow:var(--shadow); margin:0 0 22px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:14px; }
body.pyq-pro .pyq-bc-link { color:var(--gray-500); text-decoration:none; font-weight:500; padding:2px 4px; border-radius:6px; }
body.pyq-pro .pyq-bc-link:hover { color:var(--primary); }
body.pyq-pro .pyq-bc-sep { color:var(--gray-300); }
body.pyq-pro .pyq-bc-current { color:var(--gray-900); font-weight:600; }

/* Hero + search (top of catalog) */
.pyq-hero { background:var(--card-bg); border:1px solid var(--gray-200); border-top:3px solid var(--accent); border-radius:var(--radius); padding:44px 32px; text-align:center; margin:0 0 32px; box-shadow:var(--shadow); }
body.pyq-dark .pyq-hero { background:linear-gradient(145deg,#1e293b,#0f172a); }
.pyq-hero h1 { font-family:'Fraunces', Georgia, serif; font-size:38px; font-weight:700; color:var(--gray-900); letter-spacing:-0.01em; margin:0; }
.pyq-hero h1 em { color:var(--accent); font-style:normal; }
.pyq-hero p { color:var(--gray-500); font-size:17px; margin:12px 0 24px; }
.pyq-hero-search { max-width:600px; margin:0 auto; background:var(--card-bg); border:1px solid var(--gray-200); border-radius:40px; padding:8px 8px 8px 24px; display:flex; align-items:center; box-shadow:var(--shadow-hover); }
.pyq-hero-search input { flex:1; border:none; outline:none; background:transparent; font-size:16px; padding:10px 0; color:var(--text); }
.pyq-hero-search button { background:var(--primary); color:#fff; border:none; padding:12px 26px; border-radius:40px; font-weight:600; cursor:pointer; transition:.2s; }
.pyq-hero-search button:hover { background:var(--primary-dark); }

/* Stats banner */
.pyq-stats-banner { display:flex; justify-content:space-around; flex-wrap:wrap; gap:16px; background:var(--card-bg); border:1px solid var(--border); border-radius:20px; padding:22px; margin:0 0 34px; box-shadow:var(--shadow); }
.pyq-stats-banner .pyq-sb-num { font-size:26px; font-weight:800; color:var(--gray-900); }
.pyq-stats-banner .pyq-sb-lbl { color:var(--gray-500); font-size:13px; }

/* Section header */
body.pyq-pro .pyq-section-label { color:var(--gray-700); font-size:13px; text-transform:uppercase; letter-spacing:.06em; font-weight:700; margin:26px 0 14px; }
body.pyq-pro h2.pyq-pro-h2 { font-size:26px; font-weight:700; color:var(--gray-900); margin:0 0 4px; }

/* Folder / category cards → circular icon, rounded, lift on hover */
body.pyq-pro .pyq-folder-box { background:var(--card-bg); border:1px solid var(--border); border-radius:var(--radius); padding:26px 18px; text-align:center; box-shadow:var(--shadow); transition:.25s; }
body.pyq-pro .pyq-folder-box:hover { transform:translateY(-6px); box-shadow:var(--shadow-hover); border-color:var(--primary-light); }
body.pyq-pro .pyq-folder-icon { width:64px; height:64px; border-radius:50%; background:var(--gray-100); color:var(--primary); font-size:1.5rem; }
body.pyq-pro .pyq-folder-name { color:var(--gray-900); font-size:17px; font-weight:700; }
body.pyq-pro .pyq-folder-meta { color:var(--gray-500); }
body.pyq-pro .pyq-folder-arrow { color:var(--gray-300); }
body.pyq-pro .pyq-folder-box:hover .pyq-folder-arrow { color:var(--primary); }

/* Exam cards → rounded, soft shadow, lift */
body.pyq-pro .pyq-exam-card { background:var(--card-bg); border:1px solid var(--border); border-radius:var(--radius); padding:22px; box-shadow:var(--shadow); transition:.25s; }
body.pyq-pro .pyq-exam-card:hover { transform:translateY(-4px); box-shadow:var(--shadow-hover); border-color:var(--primary-light); }
body.pyq-pro .pyq-exam-title { color:var(--gray-900); font-size:18px; }
body.pyq-pro .pyq-exam-meta { color:var(--gray-500); }

/* Pills */
body.pyq-pro .pyq-badge { border-radius:40px; padding:3px 12px; font-size:11px; }
body.pyq-pro .pyq-badge.free { background:rgba(16,185,129,.14); color:var(--success); }
body.pyq-pro .pyq-badge.owned, body.pyq-pro .pyq-badge.unlocked { background:rgba(37,99,235,.14); color:#2563eb; }
body.pyq-pro .pyq-badge.bundle { background:rgba(124,58,237,.12); color:#7c3aed; }
body.pyq-pro .pyq-badge.paid { background:rgba(245,158,11,.16); color:#b45309; }

/* Pill buttons */
body.pyq-pro .pyq-card-btn, body.pyq-pro .pyq-exam-btn, body.pyq-pro .pyq-pdf-btn { border-radius:40px; font-weight:600; box-shadow:none; }
body.pyq-pro .pyq-exam-btn.start { background:var(--primary); color:#fff; }
body.pyq-pro .pyq-exam-btn.start:hover { background:var(--primary-dark); }
body.pyq-pro .pyq-pdf-btn.pdf { background:transparent; color:var(--gray-700); border:1px solid var(--gray-300); }
body.pyq-pro .pyq-pdf-btn.pdf:hover { background:var(--gray-100); }
body.pyq-pro .pyq-card-btn.buy { background:var(--accent); color:#fff; }
body.pyq-pro .pyq-card-btn.buy:hover { background:#9C6510; }

/* Bundle / series box */
body.pyq-pro .pyq-bundle-box { background:linear-gradient(135deg, rgba(79,70,229,.08), rgba(129,140,248,.10)); border:1px solid rgba(79,70,229,.25); border-radius:var(--radius); }
body.pyq-pro .pyq-bundle-box .bundle-info strong { color:var(--primary-dark); }
body.pyq-pro .bundle-buy-btn { background:var(--primary); border-radius:40px; }
body.pyq-pro .bundle-buy-btn:hover { background:var(--primary-dark); }

/* Search field + results on pro pages */
body.pyq-pro .pyq-search { border-radius:40px; border:1px solid var(--border); background:var(--card-bg); }
body.pyq-pro .pyq-search:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(79,70,229,.15); }
body.pyq-pro .pyq-search-results, body.pyq-pro .pyq-no-items { background:var(--card-bg); border:1px solid var(--border); border-radius:var(--radius); }
body.pyq-pro .pyq-result-row { background:var(--gray-50); border:1px solid var(--border); border-radius:14px; }
body.pyq-pro .pyq-result-open { background:var(--primary); border-radius:40px; }
body.pyq-pro .pyq-result-open:hover { background:var(--primary-dark); }

/* Dashboard welcome card + rank */
.pyq-welcome { background:var(--card-bg); border:1px solid var(--border); border-radius:var(--radius); padding:28px 30px; box-shadow:var(--shadow); display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:16px; margin-bottom:24px; }
.pyq-welcome h2 { font-family:'Fraunces', Georgia, serif; font-weight:600; font-size:22px; color:var(--gray-900); margin:0; }
.pyq-welcome p { color:var(--gray-500); margin:4px 0 0; }
.pyq-rank { background:var(--accent); color:#fff; padding:8px 22px; border-radius:40px; font-weight:700; font-size:14px; white-space:nowrap; }

/* Dashboard stat cards (re-skin existing .pyq-stat) */
body.pyq-pro .pyq-stats { gap:18px; }
body.pyq-pro .pyq-stat { background:var(--card-bg); border:1px solid var(--border); border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); text-align:left; }
body.pyq-pro .pyq-stat-value { color:var(--gray-900); font-size:30px; font-weight:800; }
body.pyq-pro .pyq-stat-label { color:var(--gray-500); font-size:13px; font-weight:600; }

@media (max-width:640px) {
    .pyq-hero { padding:30px 18px; border-radius:24px; }
    .pyq-hero h1 { font-size:27px; }
    .pyq-stats-banner { gap:10px; padding:16px; }
    .pyq-stats-banner .pyq-sb-num { font-size:20px; }
}

/* ---------- Catalog UI: sections, flash cards, chips, search ---------- */
body.pyq-pro .pyq-ui-section { margin: 0 0 40px; }
body.pyq-pro .pyq-ui-section-head { display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
body.pyq-pro .pyq-ui-section-head h2 { margin:0; }
body.pyq-pro .pyq-ui-section-sub { color:var(--gray-500); font-size:14px; }
body.pyq-pro .pyq-ui-searchwrap { position:relative;  margin:0 0 12px; }
body.pyq-pro .pyq-ui-sicon { position:absolute; left:16px; top:50%; transform:translateY(-50%); color:var(--gray-500); }
body.pyq-pro .pyq-ui-search { width:100%; padding:11px 16px 11px 42px; border-radius:40px; border:1px solid var(--border); background:var(--card-bg); color:var(--text); outline:none; }
body.pyq-pro .pyq-ui-search:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(79,70,229,.15); }
body.pyq-pro .pyq-ui-chips { display:flex; gap:8px; flex-wrap:wrap; margin:0 0 16px; }
body.pyq-pro .pyq-ui-chip { padding:7px 18px; border-radius:40px; background:var(--card-bg); border:1px solid var(--border); color:var(--gray-700); font-weight:600; font-size:13px; cursor:pointer; transition:.18s; font-family:inherit; }
body.pyq-pro .pyq-ui-chip:hover { border-color:var(--primary-light); color:var(--primary); }
body.pyq-pro .pyq-ui-chip.active { background:var(--primary); border-color:var(--primary); color:#fff; }
body.pyq-pro .pyq-ui-gridwrap { position:relative; min-height:40px; }
body.pyq-pro .pyq-ui-nomatch { margin-top:8px; }

/* Flash category cards — similar shape, distinct accent per category */
body.pyq-pro .pyq-flash { position:relative; overflow:hidden; border-top:3px solid transparent; }
body.pyq-pro .pyq-flash::after { content:""; position:absolute; inset:auto -20px -30px auto; width:90px; height:90px; border-radius:50%; opacity:.10; }
body.pyq-pro .pyq-accent-0 .pyq-folder-icon { background:#EFEADA; color:#16233D; } body.pyq-pro .pyq-accent-0 { border-top-color:#16233D; } body.pyq-pro .pyq-accent-0::after { background:#16233D; }
body.pyq-pro .pyq-accent-1 .pyq-folder-icon { background:#FBF0DC; color:#9C6510; } body.pyq-pro .pyq-accent-1 { border-top-color:#C6821F; } body.pyq-pro .pyq-accent-1::after { background:#C6821F; }
body.pyq-pro .pyq-accent-2 .pyq-folder-icon { background:#FBEAE6; color:#A3341F; } body.pyq-pro .pyq-accent-2 { border-top-color:#A3341F; } body.pyq-pro .pyq-accent-2::after { background:#A3341F; }
body.pyq-pro .pyq-accent-3 .pyq-folder-icon { background:#E7F1E4; color:#2F6B41; } body.pyq-pro .pyq-accent-3 { border-top-color:#2F6B41; } body.pyq-pro .pyq-accent-3::after { background:#2F6B41; }
body.pyq-pro .pyq-accent-4 .pyq-folder-icon { background:#EAE7F2; color:#4A3F73; } body.pyq-pro .pyq-accent-4 { border-top-color:#4A3F73; } body.pyq-pro .pyq-accent-4::after { background:#4A3F73; }
body.pyq-pro .pyq-accent-5 .pyq-folder-icon { background:#E3EEF0; color:#2A5F66; } body.pyq-pro .pyq-accent-5 { border-top-color:#2A5F66; } body.pyq-pro .pyq-accent-5::after { background:#2A5F66; }

/* PDF card accent + badge */
body.pyq-pro .pyq-pdf-card { border-left:3px solid #A3341F; }
body.pyq-pro .pyq-badge.pdf { background:rgba(163,52,31,.12); color:#A3341F; }

/* Dashboard My-Exams quick card parity */
body.pyq-pro .pyq-quick-card { background:var(--card-bg); border:1px solid var(--border); border-radius:var(--radius); padding:18px; box-shadow:var(--shadow); text-decoration:none; color:inherit; display:flex; align-items:center; gap:12px; transition:.2s; }
body.pyq-pro .pyq-quick-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-hover); border-color:var(--primary-light); }
body.pyq-pro .pyq-quick-card .qc-ico { width:42px; height:42px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:1.2rem; background:var(--gray-100); }

/* Featured-card design freedom (image banner / custom background / wide span) */
.pyq-fc-section{ max-width:1280px; margin:0 auto 36px; padding:0 24px; }
.pyq-fc-grid .pyq-exam-card{ overflow:hidden; }
.pyq-fc-grid .pyq-fc-wide{ grid-column: span 2; }
.pyq-fc-img{ height:120px; margin:-2px -2px 12px; border-radius:14px; background-size:cover; background-position:center; background-color:var(--gray-100); }
@media (max-width:640px){ .pyq-fc-grid .pyq-fc-wide{ grid-column: span 1; } }
/* v6.1 catalog global toolbar */
.pyq-catalog-bar{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; background:var(--card-bg,#fff); border:1px solid var(--border,#e2e8f0); border-radius:16px; padding:12px; margin:0 0 22px; box-shadow:var(--shadow,0 1px 2px rgba(0,0,0,.04)); }
.pyq-catalog-search{ position:relative; flex:1 1 320px; display:flex; align-items:center; }
.pyq-catalog-search span{ position:absolute; left:14px; color:#94a3b8; }
.pyq-catalog-search input{ width:100%; padding:12px 14px 12px 40px; border:1px solid var(--border,#e2e8f0); border-radius:40px; background:var(--card-bg,#fff); color:var(--text,#1e293b); font-size:0.95rem; }
.pyq-catalog-search input:focus{ outline:none; border-color:#4f46e5; box-shadow:0 0 0 3px rgba(79,70,229,.15); }
.pyq-catalog-bar select{ padding:11px 12px; border:1px solid var(--border,#e2e8f0); border-radius:40px; background:var(--card-bg,#fff); color:var(--text,#1e293b); font-family:inherit; }
.pyq-browse-wrap .pyq-ui-searchwrap{ max-width:none; }
@media (max-width:640px){ .pyq-catalog-bar select{ flex:1 1 45%; } }



/* =============================================================
   PHASE 1: INSTANT SCANNABILITY (Free/Owned vs Paid)
   ============================================================= */

/* 1. Green "Ready" lane for Free & Owned cards */
.pyq-exam-card[data-group="free"],
.pyq-exam-card[data-group="owned"] {
    border-left: 4px solid #22c55e;
    background: #fafffe; /* very soft mint tint */
    transition: border-color 0.2s ease, background 0.2s ease;
}
.pyq-exam-card[data-group="free"]:hover,
.pyq-exam-card[data-group="owned"]:hover {
    border-left-color: #15803d;
    background: #ffffff;
}

/* 2. Paid cards stay strictly neutral (no tint, flat grey border) */
.pyq-exam-card[data-group="paid"] {
    border-left: 1px solid #e2e8f0; /* default grey */
    background: #ffffff;
}

/* 3. Badge Prioritisation */
.pyq-badge.free {
    background: #16a34a !important;
    color: #ffffff !important;
    font-weight: 700;
}
.pyq-badge.owned,
.pyq-badge.unlocked {
    background: #2563eb !important;
    color: #ffffff !important;
    font-weight: 700;
}
.pyq-badge.paid {
    background: #fff7ed !important;
    color: #d97706 !important;
    font-weight: 700;
}
.pyq-badge.bundle {
    background: #f5f3ff !important;
    color: #7c3aed !important;
    font-weight: 700;
}
.pyq-badge.expired {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    font-weight: 700;
}
body.pyq-pro .pyq-badge.free, body.pyq-pro .pyq-badge.owned,
body.pyq-pro .pyq-badge.unlocked {
    /* keep pro layer consistent with canonical system */
}

/* 4. Button Emotion Switching: Paid "Buy" becomes a ghost button */
.pyq-exam-card[data-group="paid"] .buy {
    background: transparent !important;
    color: #d97706 !important;
    border: 2px solid #d97706 !important;
    box-shadow: none !important;
}
.pyq-exam-card[data-group="paid"] .buy:hover {
    background: #fffbeb !important;
    color: #b45309 !important;
    border-color: #b45309 !important;
    transform: translateY(-1px);
}




/* =============================================================
   PHASE 2: MICRO-INTERACTIONS (Hover, Smooth Transitions, Clear Button)
   ============================================================= */

/* --- Premium "Pop & Lift" Card Hover --- */
.pyq-exam-card,
.pyq-folder-box {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.3s ease, 
                border-color 0.2s ease;
    will-change: transform;
    position: relative;
    z-index: 1;
}
.pyq-exam-card:hover,
.pyq-folder-box:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 20px 40px -12px rgba(22, 35, 61, 0.30) !important;
    z-index: 5;
    border-color: rgba(37, 99, 235, 0.2);
}

/* --- Smooth Fade for Filtering Cards --- */
.pyq-ui-gridwrap .pyq-exam-card,
.pyq-ui-gridwrap .pyq-folder-box {
    transition: opacity 0.18s ease, transform 0.18s ease;
}
/* Cards that are hidden by filters get a subtle shrink + fade */
.pyq-ui-gridwrap .pyq-exam-card[style*="display: none"],
.pyq-ui-gridwrap .pyq-folder-box[style*="display: none"] {
    opacity: 0;
    transform: scale(0.96);
    pointer-events: none;
    /* Delay the display:none so the fade plays first */
    animation: pyqFadeOut 0.18s forwards;
}
@keyframes pyqFadeOut {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.96); }
}

/* --- "Clear Filters" Button (Inside Empty States) --- */
.pyq-no-items .pyq-clear-filters-btn {
    display: inline-block;
    margin-top: 18px;
    padding: 10px 28px;
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.pyq-no-items .pyq-clear-filters-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.pyq-no-items .pyq-clear-filters-btn:active {
    transform: translateY(0);
}
