/* =========================================================
   Sidebar Cards — District & Sessions Court Mardan
   Template system adapted from the live portal at
   mardandc.peshawarhighcourt.gov.pk

   Each .sc-card declares its template via .sc-{template}.
   Each colour is applied via .sc-color-{name} which sets
   the accent CSS variables consumed by the template.

   Animations are gated by prefers-reduced-motion.
   ========================================================= */

.sc-card {
    --accent: #0b7a53;
    --accent-deep: #07593c;
    --accent-soft: #eaf7f1;
    --accent-border: #cce7da;
    --accent-rgb: 11, 122, 83;
    --ink: #1a2732;
    --muted: #65717c;
    --border: #dfe6e9;
    --bg: #ffffff;

    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(145deg, #ffffff 0%, var(--accent-soft) 185%);
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: 0 5px 16px rgba(21, 38, 32, .055);
    transition: transform .26s cubic-bezier(.2,.8,.2,1),
                box-shadow .26s ease,
                border-color .26s ease,
                filter .26s ease;
}

.sc-card:hover {
    transform: translateY(-4px) scale(1.005);
    border-color: var(--accent-border);
    box-shadow: 0 14px 30px rgba(var(--accent-rgb), .18);
    filter: saturate(1.02);
}

/* Animated top accent bar (sheen sweep) */
.sc-card::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-deep) 0%, var(--accent) 30%, rgba(255,255,255,.95) 48%, var(--accent) 62%, var(--accent-deep) 100%);
    background-size: 240% 100%;
    animation: scSheen 4.8s ease-in-out infinite;
    z-index: 1;
}

@keyframes scSheen {
    0%, 30% { background-position: 100% 0; }
    70%, 100% { background-position: 0% 0; }
}

/* Soft glow blob in top-right corner */
.sc-card::after {
    content: "";
    position: absolute;
    right: -34px;
    top: -42px;
    width: 112px;
    height: 112px;
    background: rgba(var(--accent-rgb), .065);
    border-radius: 50%;
    box-shadow: 0 0 0 18px rgba(var(--accent-rgb), .025);
    z-index: -1;
    transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .35s ease;
}

.sc-card:hover::after {
    transform: translate(-6px, 7px) scale(1.08);
}

.sc-inner {
    position: relative;
    z-index: 2;
    padding: 14px 14px 12px;
}

/* Staggered card entrance */
.sc-card {
    opacity: 0;
    transform: translateY(14px) scale(.985);
    animation: scIn .58s cubic-bezier(.2,.75,.2,1) forwards;
    animation-delay: var(--sc-delay, .05s);
    will-change: transform, box-shadow;
}

@keyframes scIn {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Colour palette ===== */
.sc-color-green    { --accent:#0b7a53; --accent-deep:#07593c; --accent-soft:#eaf7f1; --accent-border:#cce7da; --accent-rgb:11,122,83; }
.sc-color-blue     { --accent:#173b63; --accent-deep:#102f50; --accent-soft:#eef3f9; --accent-border:#d2deed; --accent-rgb:23,59,99; }
.sc-color-navy     { --accent:#1f3a8a; --accent-deep:#172554; --accent-soft:#eef2fb; --accent-border:#d6dcef; --accent-rgb:31,58,138; }
.sc-color-purple   { --accent:#6750a4; --accent-deep:#4c397d; --accent-soft:#f2effa; --accent-border:#ddd6ef; --accent-rgb:103,80,164; }
.sc-color-teal     { --accent:#087f8c; --accent-deep:#05606a; --accent-soft:#eaf7f8; --accent-border:#cce7e9; --accent-rgb:8,127,140; }
.sc-color-amber    { --accent:#c99a2e; --accent-deep:#8b6517; --accent-soft:#fff7df; --accent-border:#ead89e; --accent-rgb:201,154,46; }
.sc-color-rose     { --accent:#a54e74; --accent-deep:#7b3956; --accent-soft:#fbf0f5; --accent-border:#ecd4df; --accent-rgb:165,78,116; }
.sc-color-red      { --accent:#9f3535; --accent-deep:#742626; --accent-soft:#fbefef; --accent-border:#ebcfcf; --accent-rgb:159,53,53; }
.sc-color-orange   { --accent:#c16a12; --accent-deep:#914e0d; --accent-soft:#fff4e8; --accent-border:#efd9bf; --accent-rgb:193,106,18; }
.sc-color-gold     { --accent:#a87810; --accent-deep:#785709; --accent-soft:#fff7df; --accent-border:#ead89e; --accent-rgb:168,120,16; }
.sc-color-navy-green {
    /* dark hero — different mechanism: surface is dark, text is light */
    --accent:#0b6241;
    --accent-deep:#052f22;
    --accent-soft:#183f68;
    --accent-border:#0d8a5e;
    --accent-rgb:11,98,65;
}

/* ===== Common pieces ===== */
.sc-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    border-radius: 11px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.72), 0 4px 10px rgba(var(--accent-rgb), .06);
    font-size: 17px;
    transform-origin: center;
    transition: transform .26s cubic-bezier(.2,.8,.2,1), box-shadow .26s ease;
}
.sc-card:hover .sc-icon {
    transform: translateY(-2px) rotate(-2deg) scale(1.08);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.78), 0 8px 16px rgba(var(--accent-rgb), .15);
    filter: saturate(1.08);
}

.sc-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
    padding: 2px 8px;
    color: var(--accent-deep);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .4px;
}
.sc-label::before {
    content: "";
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .38);
    animation: scDot 2.2s ease-in-out infinite;
}
@keyframes scDot {
    0%,100% { opacity: .5; transform: scale(.82); box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
    45%     { opacity: 1; transform: scale(1); box-shadow: 0 0 0 5px rgba(var(--accent-rgb), .10); }
    60%     { opacity: .82; }
}

.sc-title {
    color: var(--ink);
    font-size: 15px;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -.08px;
}

.sc-body {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
    font-weight: 500;
}

.sc-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
    min-height: 32px;
    padding: 7px 12px;
    color: #fff;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(var(--accent-rgb), .16);
    font-size: 11.5px;
    font-weight: 800;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.sc-btn::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -45%;
    width: 26%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.42), transparent);
    transform: rotate(18deg);
    animation: scShine 4.6s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}
.sc-btn > * { position: relative; z-index: 1; }
.sc-btn::after {
    content: "›";
    margin-left: 7px;
    font-size: 16px;
    line-height: 0;
    transition: transform .2s ease;
}
.sc-btn:hover {
    background: var(--accent-deep);
    border-color: var(--accent-deep);
    transform: translateY(-1px);
    box-shadow: 0 7px 15px rgba(var(--accent-rgb), .24);
}
.sc-btn:hover::after { transform: translateX(3px); }
@keyframes scShine {
    0%, 52% { left: -45%; opacity: 0; }
    60% { opacity: 1; }
    78% { left: 125%; opacity: .7; }
    100% { left: 125%; opacity: 0; }
}

/* =========================================================
   Template 1 — STANDARD
   Light card with multi-colour accent + icon + body + CTA.
   ========================================================= */
.sc-standard { display: flex; flex-direction: column; height: 100%; }
.sc-standard .sc-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.sc-standard .sc-text-block { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sc-standard .sc-body { margin: 8px 0 12px; }
.sc-standard .sc-linklist { margin: 8px 0 6px; padding: 0; list-style: none; }
.sc-standard .sc-linklist li { margin: 0; padding: 0; }
.sc-standard .sc-linklist a {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px;
    color: var(--accent-deep);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 5px;
    transition: background .2s ease, transform .2s ease;
}
.sc-standard .sc-linklist a:hover {
    background: #fff;
    transform: translateX(2px);
}

/* =========================================================
   Template 2 — HERO (dark gradient — like .mardan-leave)
   ========================================================= */
.sc-hero {
    color: #fff;
    background:
        radial-gradient(circle at 90% 18%, rgba(255,255,255,.16), transparent 24%),
        linear-gradient(115deg, #183f68 0%, #0b6241 100%);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 12px 28px rgba(17, 56, 89, .18);
    padding: 16px 18px;
}
.sc-hero::before {
    background: linear-gradient(90deg, rgba(255,255,255,.95), #f3db91 50%, rgba(255,255,255,.95)) !important;
    background-size: 240% 100% !important;
    animation: scSheen 5.2s ease-in-out infinite;
}
.sc-hero::after {
    content: "";
    right: -60px;
    top: -85px;
    width: 210px;
    height: 210px;
    border: 30px solid rgba(255,255,255,.07);
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    z-index: 0;
    animation: scOrbit 12s linear infinite;
}
@keyframes scOrbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.sc-hero .sc-icon {
    background: linear-gradient(145deg, #f3db91, #d9b656);
    color: #173b63;
    border: none;
    box-shadow: 0 7px 16px rgba(0,0,0,.13);
}
.sc-hero .sc-label { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.30); color: #fff8df; }
.sc-hero .sc-label::before { background: #f3db91; box-shadow: 0 0 0 0 rgba(243,219,145,0); }
.sc-hero .sc-title { color: #fff; font-size: 17px; }
.sc-hero .sc-body { color: #eaf3ee; font-size: 12px; max-width: 90%; }
.sc-hero .sc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.sc-hero .sc-btn {
    background: #fff;
    color: #173b63;
    border-color: #fff;
    box-shadow: 0 6px 15px rgba(0,0,0,.10);
}
.sc-hero .sc-btn:hover { background: rgba(255,255,255,.92); border-color: #fff; color: #102f50; }
.sc-hero .sc-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

/* =========================================================
   Template 3 — STATS (big number + label)
   ========================================================= */
.sc-stats {
    background:
        radial-gradient(circle at 100% 0%, rgba(var(--accent-rgb),.10), transparent 38%),
        #ffffff;
    border: 1px solid rgba(var(--accent-rgb),.22);
}
.sc-stats::before { display: none; }
.sc-stats::after { display: none; }
.sc-stats .sc-stats-row { display: flex; align-items: center; justify-content: space-between; min-height: 86px; }
.sc-stats .sc-stats-label { color: #4d5c68; font-size: 12px; font-weight: 800; }
.sc-stats .sc-stats-value { color: var(--accent); font-size: 30px; line-height: 1; font-weight: 900; }
.sc-stats .sc-stats-unit { color: var(--muted); font-size: 11px; font-weight: 600; }
.sc-stats .sc-stats-foot { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--accent-border); }

/* =========================================================
   Template 4 — LINKLIST (bulleted icons + link list)
   ========================================================= */
.sc-linklist .sc-list { list-style: none; padding: 0; margin: 0; }
.sc-linklist .sc-list li { margin: 0; }
.sc-linklist .sc-list a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px;
    color: var(--accent-deep);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.sc-linklist .sc-list a:hover {
    background: #fff;
    transform: translateX(3px);
    box-shadow: 0 6px 14px rgba(var(--accent-rgb), .12);
}
.sc-linklist .sc-list .sc-list-icon {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--accent);
    background: #fff;
    border: 1px solid var(--accent-border);
    border-radius: 6px;
    font-size: 13px;
}

/* =========================================================
   Template 5 — NOTICE (amber strip with left border)
   ========================================================= */
.sc-notice {
    background: #fff8e7;
    border: 1px solid #ebd69f;
    border-left: 5px solid var(--accent);
    color: #5b420b;
}
.sc-notice::before { display: none; }
.sc-notice::after { display: none; }
.sc-notice .sc-icon {
    background: #f8e8b8;
    color: #74520d;
    border-color: #ead89e;
}
.sc-notice .sc-label { background: #fdeec5; border-color: #ead89e; color: #74520d; }
.sc-notice .sc-title { color: #5b420b; }
.sc-notice .sc-body { color: #725e2f; }
.sc-notice .sc-btn { background: var(--accent); border-color: var(--accent); }
.sc-notice .sc-notice-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* =========================================================
   Template 6 — COMPACT (tiny single-stat tile)
   ========================================================= */
.sc-compact {
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(21, 38, 32, .04);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.sc-compact::before { display: none; }
.sc-compact::after { display: none; }
.sc-compact .sc-compact-row { display: flex; align-items: center; gap: 10px; }
.sc-compact .sc-icon { width: 32px; height: 32px; flex: 0 0 32px; font-size: 14px; }
.sc-compact .sc-compact-value { color: var(--accent); font-size: 16px; font-weight: 900; line-height: 1.2; }
.sc-compact .sc-compact-label { color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.3; margin-top: 2px; }

/* =========================================================
   Template 7 — COURT (full breakdown card w/ total pill)
   ========================================================= */
.sc-court {
    background:
        radial-gradient(circle at 100% 0%, rgba(var(--accent-rgb),.06), transparent 30%),
        #fff;
    border: 1px solid rgba(var(--accent-rgb),.20);
}
.sc-court .sc-court-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--accent);
    position: relative;
}
.sc-court .sc-court-head::after {
    content: "";
    position: absolute;
    left: 0; bottom: -3px;
    width: 48px; height: 3px;
    background: var(--accent);
    border-radius: 999px;
    opacity: .8;
}
.sc-court .sc-court-title { color: var(--accent); font-size: 16px; font-weight: 850; margin: 0; }
.sc-court .sc-court-pill {
    display: inline-flex; align-items: center;
    padding: 4px 9px;
    color: #fff;
    background: var(--accent);
    border-radius: 999px;
    font-size: 10px; line-height: 1; font-weight: 850;
    box-shadow: 0 3px 8px rgba(var(--accent-rgb), .16);
}
.sc-court .sc-court-list { padding-left: 18px; margin: 0; }
.sc-court .sc-court-list li { margin-bottom: 5px; color: #4e5c68; font-size: 12.5px; line-height: 1.4; }
.sc-court .sc-court-list li::marker { color: var(--accent); font-weight: 800; }

/* =========================================================
   Template 8 — JUDGE_TOTAL (big white number on dark)
   ========================================================= */
.sc-judge_total {
    color: #fff;
    background:
        radial-gradient(circle at 90% 10%, rgba(255,255,255,.14), transparent 28%),
        linear-gradient(125deg, #173b63 0%, #0b6241 100%);
    border: 1px solid rgba(23,59,99,.20);
    box-shadow: 0 10px 24px rgba(17, 56, 89, .20);
}
.sc-judge_total::before {
    background: linear-gradient(90deg, #f3db91, #d9b656) !important;
    height: 4px;
}
.sc-judge_total::after { display: none; }
.sc-judge_total .sc-judge-row { display: flex; align-items: center; gap: 14px; min-height: 86px; }
.sc-judge_total .sc-icon {
    width: 50px; height: 50px; flex: 0 0 50px;
    background: linear-gradient(145deg, #f3db91, #d9b656);
    color: #173b63;
    border: none;
    box-shadow: 0 6px 14px rgba(0,0,0,.12);
    font-size: 22px;
}
.sc-judge_total .sc-judge-label {
    color: #e9f2ee;
    font-size: 10px; font-weight: 800;
    letter-spacing: .5px; text-transform: uppercase;
}
.sc-judge_total .sc-judge-value { color: #fff; font-size: 30px; line-height: 1; font-weight: 900; }
.sc-judge_total .sc-judge-unit  { color: #d6e6dd; font-size: 11px; font-weight: 600; }
.sc-judge_total .sc-actions { margin-top: 8px; }
.sc-judge_total .sc-btn {
    background: #fff; color: #173b63; border-color: #fff;
}

/* =========================================================
   Template 9 — DASHBOARD (navy→green with white CTA)
   ========================================================= */
.sc-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    color: #fff;
    background:
        radial-gradient(circle at 90% 18%, rgba(255,255,255,.13), transparent 24%),
        linear-gradient(112deg, #173b63 0%, #0b6241 100%);
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 11px 28px rgba(17, 56, 89, .16);
}
.sc-dashboard::before {
    background: linear-gradient(90deg, #f3db91, #d9b656) !important;
}
.sc-dashboard::after {
    right: -65px; top: -95px;
    width: 240px; height: 240px;
    border-radius: 50%;
    border: 36px solid rgba(255,255,255,.06);
    background: transparent;
    box-shadow: none;
    animation: scOrbit 14s linear infinite;
}
.sc-dashboard .sc-dashboard-tag {
    display: inline-block;
    margin-bottom: 4px;
    padding: 3px 9px;
    color: #173b63;
    background: #f3dc94;
    border-radius: 4px;
    font-size: 9.5px; font-weight: 800;
    letter-spacing: .5px; text-transform: uppercase;
}
.sc-dashboard .sc-title { color: #fff; font-size: 17px; margin-bottom: 4px; }
.sc-dashboard .sc-body { color: #eaf1f6; font-size: 12px; max-width: 760px; }
.sc-dashboard .sc-actions { display: flex; align-items: center; gap: 10px; }
.sc-dashboard .sc-btn {
    min-width: 150px;
    background: #fff;
    color: #173b63;
    border-color: #fff;
}
.sc-dashboard .sc-btn:hover {
    background: rgba(255,255,255,.92);
    color: #102f50;
}

/* =========================================================
   Template 10 — FEATURE (gold-amber highlighted feature)
   ========================================================= */
.sc-feature {
    background: linear-gradient(145deg, #ffffff 0%, #fffdf6 100%);
    border: 1px solid #e4d8b2;
    box-shadow: 0 8px 22px rgba(168,120,16,.10);
}
.sc-feature::before {
    background: linear-gradient(90deg, #b98519, #d9ad43, #fff 50%, #d9ad43, #b98519) !important;
    background-size: 240% 100% !important;
}
.sc-feature .sc-icon { background: #fff7dc; color: #8a6312; border-color: #ead89c; }
.sc-feature .sc-label { background: #fff4cf; color: #71530f; border-color: #e8cf83; }
.sc-feature .sc-btn { background: #8b6517; border-color: #8b6517; box-shadow: 0 3px 8px rgba(139,101,23,.14); }
.sc-feature .sc-btn:hover { background: #6e4f10; border-color: #6e4f10; }

/* =========================================================
   Accessibility — respect reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    .sc-card, .sc-card::before, .sc-card::after,
    .sc-icon, .sc-label::before, .sc-btn::before,
    .sc-hero::after, .sc-dashboard::after {
        animation: none !important;
        transition: none !important;
    }
    .sc-card { opacity: 1; transform: none; }
    .sc-card:hover { transform: translateY(-2px); }
}

/* Stagger delays for multiple cards in a row */
.sc-card:nth-child(1) { --sc-delay: .08s; }
.sc-card:nth-child(2) { --sc-delay: .15s; }
.sc-card:nth-child(3) { --sc-delay: .22s; }
.sc-card:nth-child(4) { --sc-delay: .29s; }
.sc-card:nth-child(5) { --sc-delay: .36s; }
.sc-card:nth-child(6) { --sc-delay: .43s; }
.sc-card:nth-child(7) { --sc-delay: .50s; }
.sc-card:nth-child(8) { --sc-delay: .57s; }
.sc-card:nth-child(9) { --sc-delay: .64s; }
.sc-card:nth-child(10) { --sc-delay: .71s; }
