/* ================================================================
   LifeStyleMod – Polls Pages (v5.8)
   ----------------------------------------------------------------
   شامل:
   ▸ Poll View (pv-*)
   ▸ Polls List (pl-*)
   
   ⚠️ بدون backdrop-filter — بدون رنگ hardcode
   ================================================================ */


/* ═════════════════════════════════════════════════════════════════
   بخش ۱ — POLL VIEW (.pv-*)
   ═════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   1.1 CONTAINER
   ═══════════════════════════════════════════════════════════ */
.pv-container {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--s-5) var(--s-4) var(--s-8);
    position: relative;
    z-index: var(--z-base);
}

/* ═══════════════════════════════════════════════════════════
   1.2 BACK LINK (بالا — با کلاس pv-back-link روی <a>)
   ═══════════════════════════════════════════════════════════ */
a.pv-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--c-text-muted);
    text-decoration: none;
    font-size: var(--fs-sm);
    padding: 8px 16px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
    margin-bottom: var(--s-5);
}

a.pv-back-link:hover {
    color: var(--c-text);
    background: var(--c-surface-2);
    border-color: var(--c-border-hover);
}

/* ═══════════════════════════════════════════════════════════
   1.3 BACK LINK (پایین — با کلاس pv-back-link روی <div>)
   ═══════════════════════════════════════════════════════════ */
.pv-back-link {
    text-align: center;
    margin-top: var(--s-5);
    font-size: var(--fs-sm);
}

.pv-back-link a {
    color: var(--c-text-muted);
    text-decoration: none;
    transition: color var(--t-fast);
}

.pv-back-link a:hover {
    color: var(--c-primary-light);
}

/* ═══════════════════════════════════════════════════════════
   1.4 GLASS CARD
   ═══════════════════════════════════════════════════════════ */
.pv-glass-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    padding: var(--s-7);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.pv-glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--g-rainbow-line);
    opacity: 0.5;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   1.5 SHARE BUTTON
   ═══════════════════════════════════════════════════════════ */
.pv-share-btn {
    position: absolute;
    top: var(--s-4);
    left: var(--s-4);
    padding: 7px 16px;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    color: var(--c-text-soft);
    font-size: var(--fs-xs);
    font-family: inherit;
    font-weight: var(--fw-semi);
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast),
                border-color var(--t-fast), transform var(--t-fast);
    white-space: nowrap;
    z-index: 2;
}

.pv-share-btn:hover {
    background: var(--c-primary);
    color: var(--c-text-on-primary);
    border-color: var(--c-primary);
    transform: translate3d(0, -1px, 0);
}

/* ═══════════════════════════════════════════════════════════
   1.6 HEADER
   ═══════════════════════════════════════════════════════════ */
.pv-header {
    text-align: center;
    margin-bottom: var(--s-6);
    padding-top: var(--s-4);
}

.pv-icon {
    font-size: 52px;
    line-height: 1;
    display: inline-block;
    margin-bottom: var(--s-3);
}

.pv-question {
    font-size: clamp(20px, 4vw, 28px);
    font-weight: var(--fw-black);
    color: var(--c-text);
    margin: 0 0 var(--s-3);
    line-height: 1.4;
    letter-spacing: var(--ls-tight);
}

.pv-expiry {
    color: var(--c-warning);
    font-size: var(--fs-sm);
    margin-bottom: var(--s-3);
    font-variant-numeric: tabular-nums;
}

.pv-total-votes {
    display: inline-block;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    padding: 5px 16px;
    color: var(--c-text-soft);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
}

/* ═══════════════════════════════════════════════════════════
   1.7 LOGIN ALERT
   ═══════════════════════════════════════════════════════════ */
.pv-login-alert {
    text-align: center;
    padding: var(--s-4);
    background: var(--c-warning-bg);
    border: 1px solid var(--c-warning-border);
    border-radius: var(--r-md);
    color: var(--c-warning);
    font-size: var(--fs-sm);
    margin-bottom: var(--s-5);
    line-height: 1.7;
}

.pv-login-alert a {
    color: var(--c-primary-light);
    font-weight: var(--fw-bold);
    text-decoration: none;
}

.pv-login-alert a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════
   1.8 ALREADY VOTED
   ═══════════════════════════════════════════════════════════ */
.pv-already-voted {
    text-align: center;
    padding: var(--s-3) var(--s-4);
    background: var(--c-success-bg);
    border: 1px solid var(--c-success-border);
    border-radius: var(--r-md);
    color: var(--c-success);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    margin-bottom: var(--s-5);
}

/* ═══════════════════════════════════════════════════════════
   1.9 RESULT ITEMS
   ═══════════════════════════════════════════════════════════ */
.pv-result-item {
    margin-bottom: var(--s-4);
    padding: var(--s-3);
    border-radius: var(--r-md);
    transition: background var(--t-fast);
}

.pv-result-item.pv-voted-option {
    background: var(--c-success-bg);
    border: 1px solid var(--c-success-border);
}

.pv-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-3);
    margin-bottom: var(--s-2);
    font-size: var(--fs-sm);
    color: var(--c-text-soft);
    flex-wrap: wrap;
}

.pv-result-header span:first-child {
    font-weight: var(--fw-semi);
    color: var(--c-text);
}

.pv-result-percent {
    color: var(--c-text-muted);
    font-size: var(--fs-xs);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pv-progress-bg {
    width: 100%;
    height: 10px;
    background: var(--c-bg-alt);
    border-radius: var(--r-full);
    overflow: hidden;
    position: relative;
}

.pv-progress-fill {
    height: 100%;
    background: var(--g-primary);
    border-radius: var(--r-full);
    transition: width var(--t-slow);
    will-change: width;
}

.pv-voted-option .pv-progress-fill {
    background: linear-gradient(135deg, var(--c-success) 0%, var(--c-success) 100%);
}

/* ═══════════════════════════════════════════════════════════
   1.10 VOTE FORM
   ═══════════════════════════════════════════════════════════ */
.pv-option-list {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    margin-bottom: var(--s-5);
}

.pv-option-label {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    background: var(--c-bg-alt);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast);
}

.pv-option-label:hover {
    background: var(--c-surface-2);
    border-color: var(--c-border-hover);
}

.pv-option-label:has(input:checked) {
    background: rgba(109, 159, 201, 0.10);
    border-color: var(--c-primary);
}

.pv-option-radio {
    width: 18px;
    height: 18px;
    accent-color: var(--c-primary);
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
}

.pv-option-text {
    color: var(--c-text-soft);
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    flex: 1;
}

.pv-option-label:has(input:checked) .pv-option-text {
    color: var(--c-text);
    font-weight: var(--fw-semi);
}

/* ═══════════════════════════════════════════════════════════
   1.11 SUBMIT VOTE BUTTON
   ═══════════════════════════════════════════════════════════ */
.pv-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 24px;
    background: var(--c-primary);
    color: var(--c-text-on-primary);
    border: none;
    border-radius: var(--r-md);
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    font-family: inherit;
    cursor: pointer;
    transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}

.pv-submit-btn:hover:not(:disabled) {
    background: var(--c-primary-hover);
    transform: translate3d(0, -1px, 0);
    box-shadow: var(--shadow-md);
}

.pv-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ═══════════════════════════════════════════════════════════
   1.12 VOTE MESSAGE
   ═══════════════════════════════════════════════════════════ */
.pv-vote-message {
    margin-top: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    text-align: center;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    color: var(--c-text-soft);
}

.pv-vote-message .msg-error {
    color: var(--c-danger);
}

.pv-vote-message .msg-success {
    color: var(--c-success);
}

/* ═══════════════════════════════════════════════════════════
   1.13 POLL VIEW – RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .pv-container {
        padding: var(--s-3) var(--s-3) var(--s-6);
    }

    .pv-glass-card {
        padding: var(--s-5) var(--s-4);
        border-radius: var(--r-lg);
    }

    .pv-share-btn {
        top: var(--s-3);
        left: var(--s-3);
        padding: 6px 12px;
        font-size: 11px;
    }

    .pv-header {
        padding-top: var(--s-5);
    }

    .pv-icon {
        font-size: 42px;
    }

    .pv-option-label {
        padding: var(--s-3);
    }
}

@media (max-width: 480px) {
    .pv-question {
        font-size: var(--fs-lg);
    }

    .pv-share-btn {
        position: static;
        display: block;
        margin: 0 auto var(--s-4);
    }
}


/* ═════════════════════════════════════════════════════════════════
   بخش ۲ — POLLS LIST (.pl-*)
   ═════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   2.1 CONTAINER
   ═══════════════════════════════════════════════════════════ */
.pl-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--s-5) var(--s-4) var(--s-8);
    position: relative;
    z-index: var(--z-base);
}

/* ═══════════════════════════════════════════════════════════
   2.2 HERO
   ═══════════════════════════════════════════════════════════ */
.pl-page-hero {
    text-align: center;
    margin-bottom: var(--s-6);
    padding: var(--s-5) var(--s-3);
}

.pl-page-icon {
    font-size: 56px;
    line-height: 1;
    display: inline-block;
    margin-bottom: var(--s-3);
}

.pl-page-hero h1 {
    font-size: clamp(24px, 5vw, 34px);
    font-weight: var(--fw-black);
    color: var(--c-text);
    margin-bottom: var(--s-3);
    letter-spacing: var(--ls-tight);
}

.pl-page-hero p {
    color: var(--c-text-muted);
    font-size: var(--fs-base);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ═══════════════════════════════════════════════════════════
   2.3 FILTERS
   ═══════════════════════════════════════════════════════════ */
.pl-filters {
    display: flex;
    justify-content: center;
    margin-bottom: var(--s-5);
    flex-wrap: wrap;
    gap: var(--s-3);
}

.pl-filter-group {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
}

.pl-filter-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: var(--r-sm);
    color: var(--c-text-muted);
    font-size: var(--fs-sm);
    font-family: inherit;
    font-weight: var(--fw-semi);
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
    white-space: nowrap;
}

.pl-filter-btn:hover {
    color: var(--c-text);
    background: var(--c-surface-hover);
}

.pl-filter-btn.active {
    background: var(--c-primary);
    color: var(--c-text-on-primary);
}

/* ═══════════════════════════════════════════════════════════
   2.4 RESULTS COUNT
   ═══════════════════════════════════════════════════════════ */
.pl-results-count {
    text-align: center;
    color: var(--c-text-muted);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    margin-bottom: var(--s-5);
    padding: var(--s-2) var(--s-4);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    display: table;
    margin-inline: auto;
}

/* ═══════════════════════════════════════════════════════════
   2.5 POLLS GRID
   ═══════════════════════════════════════════════════════════ */
.pl-polls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--s-4);
    margin-bottom: var(--s-6);
}

/* ═══════════════════════════════════════════════════════════
   2.6 POLL CARD
   ═══════════════════════════════════════════════════════════ */
.pl-poll-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-4);
    transition: transform var(--t-base), box-shadow var(--t-base),
                border-color var(--t-base);
    position: relative;
    overflow: hidden;
}

.pl-poll-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--g-rainbow-line);
    opacity: 0.4;
    pointer-events: none;
    transition: opacity var(--t-base);
}

.pl-poll-card:hover {
    transform: translate3d(0, -3px, 0);
    box-shadow: var(--shadow-md);
    border-color: var(--c-border-hover);
}

.pl-poll-card:hover::before {
    opacity: 0.7;
}

.pl-poll-body {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.pl-poll-question {
    font-size: var(--fs-md);
    font-weight: var(--fw-semi);
    color: var(--c-text);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pl-poll-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-3);
    font-size: var(--fs-xs);
    color: var(--c-text-muted);
    padding-top: var(--s-2);
    border-top: 1px solid var(--c-border-soft);
}

.pl-poll-vote-count {
    font-variant-numeric: tabular-nums;
    font-weight: var(--fw-semi);
    color: var(--c-text-soft);
}

/* ═══════════════════════════════════════════════════════════
   2.7 STATUS BADGES
   ═══════════════════════════════════════════════════════════ */
.pl-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 3px 12px;
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    border: 1px solid transparent;
    white-space: nowrap;
}

.pl-badge-active {
    background: var(--c-success-bg);
    color: var(--c-success);
    border-color: var(--c-success-border);
}

.pl-badge-expired {
    background: var(--c-surface-2);
    color: var(--c-text-muted);
    border-color: var(--c-border);
}

/* ═══════════════════════════════════════════════════════════
   2.8 NO RESULTS
   ═══════════════════════════════════════════════════════════ */
.pl-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--s-8) var(--s-5);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-3);
    color: var(--c-text-muted);
}

.pl-no-results .icon {
    font-size: 56px;
    line-height: 1;
    opacity: 0.6;
    display: block;
}

.pl-no-results h3 {
    color: var(--c-text);
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    margin: 0;
}

.pl-no-results p {
    font-size: var(--fs-sm);
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════
   2.9 PAGINATION
   ═══════════════════════════════════════════════════════════ */
.pl-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: var(--s-6);
    flex-wrap: wrap;
}

.pl-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: var(--r-sm);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    color: var(--c-text-muted);
    font-size: var(--fs-sm);
    font-family: inherit;
    font-weight: var(--fw-semi);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--t-fast), background var(--t-fast),
                border-color var(--t-fast), transform var(--t-fast);
}

.pl-page-btn:hover:not(:disabled) {
    color: var(--c-text);
    border-color: var(--c-border-hover);
    background: var(--c-surface-2);
}

.pl-page-btn.active {
    background: var(--c-primary);
    color: var(--c-text-on-primary);
    border-color: var(--c-primary);
}

.pl-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════
   2.10 POLLS LIST – RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .pl-container {
        padding: var(--s-3) var(--s-3) var(--s-6);
    }

    .pl-page-icon {
        font-size: 48px;
    }

    .pl-polls-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: var(--s-3);
    }
}

@media (max-width: 480px) {
    .pl-polls-grid {
        grid-template-columns: 1fr;
    }

    .pl-filter-btn {
        padding: 7px 12px;
        font-size: var(--fs-xs);
    }

    .pl-poll-card {
        padding: var(--s-3);
    }

    .pl-poll-question {
        font-size: var(--fs-base);
    }
}