/**
 * Sanathan Prediction V2 — Dark theme widget
 * Shortcode: [sas_prediction_v2]
 *
 * All classes prefixed .sas-pv2- to avoid collisions with theme/other plugins.
 * CSS custom properties are scoped to .sas-pv2-wrap so they don't bleed globally.
 */

/* ── Reset + root vars ────────────────────────────────────────────────────── */
.sas-pv2-wrap *,
.sas-pv2-wrap *::before,
.sas-pv2-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.sas-pv2-wrap {
    --pv2-bg:      #0f1117;
    --pv2-bg2:     #171b26;
    --pv2-bg3:     #1e2333;
    --pv2-bg4:     #252a3a;
    --pv2-border:  rgba(255,255,255,0.08);
    --pv2-border2: rgba(255,255,255,0.14);
    --pv2-text:    #e8eaf0;
    --pv2-text2:   #9aa0b4;
    --pv2-text3:   #6b7280;
    --pv2-accent:  #7c6af5;
    --pv2-accent2: #9b8ff7;
    --pv2-gold:    #f0c040;
    --pv2-gold2:   rgba(240,192,64,0.15);
    --pv2-radius:  12px;
    --pv2-radius-sm: 8px;

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    color: var(--pv2-text);
    background: var(--pv2-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--pv2-border);
    max-width: 100%;
    position: relative;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── Top bar ──────────────────────────────────────────────────────────────── */
.sas-pv2-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--pv2-bg2);
    border-bottom: 1px solid var(--pv2-border);
}

.sas-pv2-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sas-pv2-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.3px;
}

.sas-pv2-lang-btn {
    font-size: 11px;
    color: var(--pv2-text2);
    background: var(--pv2-bg3);
    border: 1px solid var(--pv2-border);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
}

/* ── Zodiac row ───────────────────────────────────────────────────────────── */
.sas-pv2-zodiac-row {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 12px 16px;
    background: var(--pv2-bg2);
    border-bottom: 1px solid var(--pv2-border);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sas-pv2-zodiac-row::-webkit-scrollbar {
    display: none;
}

.sas-pv2-zsign {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 9px;
    border-radius: 10px;
    cursor: pointer;
    border: 1.5px solid transparent;
    min-width: 48px;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
    outline: none;
}

.sas-pv2-zsign.active {
    background: var(--pv2-accent);
    border-color: var(--pv2-accent2);
}

.sas-pv2-zsign:not(.active):hover,
.sas-pv2-zsign:not(.active):focus {
    background: var(--pv2-bg3);
    border-color: var(--pv2-border2);
}

.sas-pv2-zsym {
    font-size: 17px;
    line-height: 1;
}

.sas-pv2-zname {
    font-size: 8px;
    color: var(--pv2-text2);
    text-align: center;
    white-space: nowrap;
    font-weight: 500;
}

.sas-pv2-zsign.active .sas-pv2-zname {
    color: #fff;
}

/* ── Content area ─────────────────────────────────────────────────────────── */
.sas-pv2-content {
    padding: 14px 16px;
}

/* ── Cycle tabs ───────────────────────────────────────────────────────────── */
.sas-pv2-tabs {
    display: flex;
    gap: 2px;
    background: var(--pv2-bg3);
    border: 1px solid var(--pv2-border);
    border-radius: var(--pv2-radius-sm);
    padding: 3px;
    margin-bottom: 14px;
    width: fit-content;
}

.sas-pv2-tab {
    padding: 5px 16px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    color: var(--pv2-text2);
    cursor: pointer;
    border: none;
    background: transparent;
    transition: background 0.15s, color 0.15s;
    letter-spacing: 0.02em;
    font-family: inherit;
    outline: none;
}

.sas-pv2-tab.active {
    background: var(--pv2-accent);
    color: #fff;
}

.sas-pv2-tab:not(.active):hover,
.sas-pv2-tab:not(.active):focus {
    color: var(--pv2-text);
}

/* ── Loading spinner ──────────────────────────────────────────────────────── */
.sas-pv2-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 16px;
    color: var(--pv2-text3);
    font-size: 12px;
}

.sas-pv2-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--pv2-border2);
    border-top-color: var(--pv2-accent);
    border-radius: 50%;
    animation: sas-pv2-spin 0.8s linear infinite;
}

@keyframes sas-pv2-spin {
    to { transform: rotate(360deg); }
}

/* ── No-data state ────────────────────────────────────────────────────────── */
.sas-pv2-nodata {
    text-align: center;
    padding: 48px 24px;
    color: var(--pv2-text2);
    line-height: 1.7;
}

.sas-pv2-nodata small {
    display: block;
    margin-top: 8px;
    color: var(--pv2-text3);
    font-size: 11px;
}

/* ── Lucky bar ────────────────────────────────────────────────────────────── */
.sas-pv2-lucky-bar {
    display: flex;
    background: var(--pv2-bg3);
    border: 1px solid var(--pv2-border);
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
}

.sas-pv2-lucky-item {
    flex: 1;
    padding: 10px 14px;
    border-right: 1px solid var(--pv2-border);
    min-width: 0;
}

.sas-pv2-lucky-item:last-child {
    border-right: none;
}

.sas-pv2-lucky-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--pv2-text3);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 3px;
    white-space: nowrap;
}

.sas-pv2-lucky-val {
    font-size: 13px;
    font-weight: 600;
    color: var(--pv2-gold);
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sas-pv2-lucky-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Overall ring row ─────────────────────────────────────────────────────── */
.sas-pv2-overall-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--pv2-bg3);
    border: 1px solid var(--pv2-border);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
}

.sas-pv2-ring-wrap {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.sas-pv2-ring-wrap svg {
    transform: rotate(-90deg);
    overflow: visible;
}

.sas-pv2-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.sas-pv2-ring-num {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.sas-pv2-ring-pct {
    font-size: 8px;
    color: var(--pv2-text3);
    line-height: 1;
}

.sas-pv2-overall-info h3 {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.sas-pv2-overall-info p {
    font-size: 11.5px;
    color: var(--pv2-text2);
    line-height: 1.55;
}

/* ── Cards grid ───────────────────────────────────────────────────────────── */
.sas-pv2-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sas-pv2-card {
    background: var(--pv2-bg2);
    border: 1px solid var(--pv2-border);
    border-radius: var(--pv2-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s;
}

.sas-pv2-card:hover {
    border-color: var(--pv2-border2);
}

.sas-pv2-full {
    grid-column: 1 / -1;
}

/* Card head */
.sas-pv2-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 0;
}

.sas-pv2-card-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--pv2-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.sas-pv2-card-meta {
    flex: 1;
    min-width: 0;
}

.sas-pv2-card-name {
    font-size: 10px;
    font-weight: 700;
    color: var(--pv2-text);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Score bar */
.sas-pv2-bar-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.sas-pv2-bar-bg {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
}

.sas-pv2-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}

.sas-pv2-bar-pct {
    font-size: 10px;
    font-weight: 700;
    min-width: 28px;
    text-align: right;
    flex-shrink: 0;
}

/* Card body */
.sas-pv2-card-body {
    padding: 8px 12px 6px;
    flex: 1;
}

.sas-pv2-card-body p {
    font-size: 11.5px;
    color: var(--pv2-text2);
    line-height: 1.55;
}

/* Chips */
.sas-pv2-chips {
    display: flex;
    gap: 4px;
    padding: 0 12px 6px;
    flex-wrap: wrap;
}

.sas-pv2-chip {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* Extras */
.sas-pv2-extras {
    display: flex;
    gap: 5px;
    padding: 0 12px 10px;
    flex-wrap: wrap;
}

.sas-pv2-extra {
    background: var(--pv2-bg4);
    border: 1px solid var(--pv2-border);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 10px;
    color: var(--pv2-text2);
    white-space: nowrap;
}

.sas-pv2-extra b {
    color: var(--pv2-text);
    font-weight: 600;
}

/* Guruji button */
.sas-pv2-guruji-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-top: 1px solid var(--pv2-border);
    background: linear-gradient(90deg, rgba(124,106,245,0.25), rgba(124,106,245,0.12));
    cursor: pointer;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--pv2-accent2);
    letter-spacing: 0.04em;
    font-family: inherit;
    transition: background 0.15s;
    text-align: center;
    outline: none;
    margin-top: auto;
}

.sas-pv2-guruji-btn:hover,
.sas-pv2-guruji-btn:focus {
    background: linear-gradient(90deg, rgba(124,106,245,0.4), rgba(124,106,245,0.22));
}

.sas-pv2-gbtn-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--pv2-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Guruji modal overlay ─────────────────────────────────────────────────── */
.sas-pv2-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0,0,0,0.65);
    padding: 0;
    animation: sas-pv2-fade-in 0.2s ease;
}

@keyframes sas-pv2-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.sas-pv2-modal {
    background: var(--pv2-bg2);
    border-radius: 14px 14px 0 0;
    width: 100%;
    max-width: 560px;
    border-top: 2px solid var(--pv2-accent);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: sas-pv2-slide-up 0.25s ease;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 13px;
    color: var(--pv2-text);
}

@keyframes sas-pv2-slide-up {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Modal head */
.sas-pv2-modal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--pv2-border);
    flex-shrink: 0;
}

.sas-pv2-guru-av {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--pv2-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    border: 1.5px solid var(--pv2-accent2);
    flex-shrink: 0;
}

.sas-pv2-guru-info {
    flex: 1;
    min-width: 0;
}

.sas-pv2-guru-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.sas-pv2-guru-sub {
    font-size: 10px;
    color: var(--pv2-text3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sas-pv2-ctx-pill {
    margin-left: auto;
    background: var(--pv2-gold2);
    border: 1px solid rgba(240,192,64,0.3);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    color: var(--pv2-gold);
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}

.sas-pv2-modal-close {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--pv2-text2);
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 4px;
    flex-shrink: 0;
    outline: none;
    transition: color 0.15s;
    font-family: inherit;
}

.sas-pv2-modal-close:hover {
    color: #fff;
}

/* Messages thread */
.sas-pv2-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 180px;
    max-height: 260px;
    scrollbar-width: thin;
    scrollbar-color: var(--pv2-border) transparent;
}

.sas-pv2-msgs::-webkit-scrollbar {
    width: 4px;
}

.sas-pv2-msgs::-webkit-scrollbar-thumb {
    background: var(--pv2-border2);
    border-radius: 2px;
}

.sas-pv2-msg {
    max-width: 88%;
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 12px;
    line-height: 1.55;
}

/* Guruji message */
.sas-pv2-msg-g {
    background: var(--pv2-bg3);
    border: 1px solid var(--pv2-border);
    align-self: flex-start;
    border-bottom-left-radius: 3px;
    color: var(--pv2-text);
}

.sas-pv2-mlabel {
    font-size: 8.5px;
    font-weight: 700;
    color: var(--pv2-accent2);
    letter-spacing: 0.06em;
    margin-bottom: 3px;
    text-transform: uppercase;
}

/* User message */
.sas-pv2-msg-u {
    background: var(--pv2-accent);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}

/* Registration gate message */
.sas-pv2-msg-reg {
    background: var(--pv2-bg3);
    border: 1px solid rgba(240,192,64,0.25);
    border-radius: 12px;
    padding: 12px;
    max-width: 100%;
    align-self: stretch;
}

.sas-pv2-msg-reg h4 {
    font-size: 11px;
    font-weight: 600;
    color: var(--pv2-gold);
    margin-bottom: 5px;
}

.sas-pv2-msg-reg p {
    font-size: 11px;
    color: var(--pv2-text2);
    line-height: 1.5;
}

.sas-pv2-reg-btns {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.sas-pv2-rbtn {
    flex: 1;
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    outline: none;
    border: 1px solid;
    transition: opacity 0.15s;
}

.sas-pv2-rbtn:hover {
    opacity: 0.88;
}

.sas-pv2-rbtn-p {
    background: var(--pv2-accent);
    color: #fff;
    border-color: var(--pv2-accent);
}

.sas-pv2-rbtn-s {
    background: transparent;
    color: var(--pv2-text2);
    border-color: var(--pv2-border2);
}

/* Suggested question dots */
.sas-pv2-qdots {
    padding: 0 16px 8px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.sas-pv2-qdot {
    background: transparent;
    border: 1px solid var(--pv2-border2);
    border-radius: 14px;
    padding: 4px 10px;
    font-size: 10.5px;
    color: var(--pv2-text2);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    outline: none;
    text-align: left;
}

.sas-pv2-qdot:hover,
.sas-pv2-qdot:focus {
    background: var(--pv2-bg3);
    border-color: var(--pv2-accent);
    color: var(--pv2-accent2);
}

/* Typing animation */
.sas-pv2-typing {
    display: flex;
    gap: 3px;
    align-items: center;
    padding: 3px 0;
}

.sas-pv2-tdot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--pv2-accent2);
    animation: sas-pv2-tdot 1.2s infinite;
}

.sas-pv2-tdot:nth-child(2) { animation-delay: 0.2s; }
.sas-pv2-tdot:nth-child(3) { animation-delay: 0.4s; }

@keyframes sas-pv2-tdot {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30%            { opacity: 1;   transform: translateY(-3px); }
}

/* Input row */
.sas-pv2-input-row {
    display: flex;
    gap: 7px;
    padding: 10px 16px 14px;
    border-top: 1px solid var(--pv2-border);
    flex-shrink: 0;
}

.sas-pv2-ginput {
    flex: 1;
    background: var(--pv2-bg3);
    border: 1px solid var(--pv2-border2);
    border-radius: var(--pv2-radius-sm);
    padding: 8px 12px;
    font-size: 12px;
    color: var(--pv2-text);
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.sas-pv2-ginput:focus {
    border-color: var(--pv2-accent);
}

.sas-pv2-ginput::placeholder {
    color: var(--pv2-text3);
}

.sas-pv2-gsend {
    background: var(--pv2-accent);
    color: #fff;
    border: none;
    border-radius: var(--pv2-radius-sm);
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.02em;
    transition: opacity 0.15s;
    white-space: nowrap;
    outline: none;
}

.sas-pv2-gsend:hover,
.sas-pv2-gsend:focus {
    opacity: 0.88;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .sas-pv2-grid {
        grid-template-columns: 1fr;
    }

    .sas-pv2-full {
        grid-column: 1;
    }

    .sas-pv2-lucky-bar {
        flex-wrap: wrap;
    }

    .sas-pv2-lucky-item {
        flex: 1 1 48%;
        border-right: none;
        border-bottom: 1px solid var(--pv2-border);
    }

    .sas-pv2-lucky-item:nth-child(odd) {
        border-right: 1px solid var(--pv2-border);
    }

    .sas-pv2-lucky-item:nth-last-child(-n+2) {
        border-bottom: none;
    }

    .sas-pv2-modal {
        max-height: 95vh;
    }

    .sas-pv2-tabs {
        width: 100%;
        justify-content: stretch;
    }

    .sas-pv2-tab {
        flex: 1;
        padding: 5px 8px;
    }
}

@media (max-width: 360px) {
    .sas-pv2-topbar {
        padding: 12px 14px;
    }

    .sas-pv2-content {
        padding: 12px 12px;
    }

    .sas-pv2-card-body p {
        font-size: 11px;
    }
}
