/**
 * Poll Detail Modal CSS - Based on issue-detail-modal styling
 */

/* Modal Base */
.poll-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: var(--space-lg, 1.5rem);
}

.poll-detail-modal.show {
    display: flex;
    opacity: 1;
}

.poll-detail-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.poll-detail-content {
    position: relative;
    width: 95%;
    max-width: 1200px;
    max-height: 95vh;
    margin: auto;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(40px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Modal Header */
.poll-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: var(--space-xl, 1.5rem);
    border-bottom: 1px solid var(--border-color);
    background: var(--gradient-glass, linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%));
    backdrop-filter: blur(var(--blur-amount, 12px));
    position: relative;
    flex-shrink: 0;
    color: white;
}

.poll-detail-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.poll-detail-header-left {
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg, 1rem);
    flex: 1;
    min-width: 0;
    padding-right: 60px;
    flex-direction: column;
}

.poll-type-large {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9rem;
    font-weight: 600;
    padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.poll-type-large .type-icon {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poll-type-large .type-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.poll-title-large {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    color: white;
}

.poll-detail-close {
    position: absolute;
    top: var(--space-xl, 1.5rem);
    right: var(--space-xl, 1.5rem);
    background: none;
    border: none;
    color: var(--text-secondary, #9d9da1);
    cursor: pointer;
    padding: var(--space-sm, 0.5rem);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.poll-detail-close:hover {
    background: var(--gradient-danger, linear-gradient(135deg, #ef4444 0%, #dc2626 100%));
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Modal Body */
.poll-detail-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.poll-detail-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.poll-detail-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: var(--space-xl);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.poll-meta-section,
.poll-voting-info-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 1px solid var(--border-color);
}

.poll-meta-section h3,
.poll-voting-info-section h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-lg) 0;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.meta-item:last-child {
    margin-bottom: 0;
}

.meta-item label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-indicator.status-active {
    background: rgba(0, 122, 204, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 122, 204, 0.3);
}

.status-indicator.status-expired {
    background: rgba(255, 193, 7, 0.15);
    color: var(--accent-secondary);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-indicator.status-inactive {
    background: rgba(108, 117, 125, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(108, 117, 125, 0.3);
}

.status-indicator.status-scheduled {
    background: rgba(23, 162, 184, 0.15);
    color: var(--accent-info);
    border: 1px solid rgba(23, 162, 184, 0.3);
}

/* Poll Type Badge */
.poll-type-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
    max-width: fit-content;
}

.poll-type-badge .type-icon {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poll-type-badge .type-icon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

/* Voting Rules */
.voting-rules {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.rule-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-quaternary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.rule-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.rule-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Content Area */
.poll-detail-content-area {
    flex: 1;
    padding: var(--space-xl);
    /* Make inner sections manage scrolling (like mobile) */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    /* Allow flex children to shrink correctly for nested scroll areas */
    min-height: 0;
}

.poll-description-section,
.poll-issues-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid var(--border-color);
}

.poll-description-section h3,
.poll-issues-section h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-lg) 0;
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border-color);
}

.description-content {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.description-content p {
    margin: 0 0 var(--space-md) 0;
}

.description-content p:last-child {
    margin-bottom: 0;
}

/* Voting Notice */
.poll-voting-notice {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.notice-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    color: var(--accent-secondary);
}

.notice-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Poll Issues Grid */
.poll-issues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, min(350px, 1fr)));
    gap: var(--space-md);
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: var(--space-xs);
    padding-bottom: calc(var(--space-xl) + var(--space-lg));
    flex: 1;
    min-height: 0; /* Allow grid to shrink when notices/headers take space */
}


/* Custom scrollbar for poll issues grid */
.poll-issues-grid::-webkit-scrollbar {
    width: 6px;
}

.poll-issues-grid::-webkit-scrollbar-track {
    background: var(--bg-quaternary);
    border-radius: 3px;
}

.poll-issues-grid::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.poll-issues-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Poll Issue Cards */
.poll-issue-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Compact Poll Issue Cards */
.poll-issue-card.compact-card {
    padding: var(--space-md);
    min-height: 120px;
    height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
}

.poll-issue-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-width: 0; /* Allow text truncation */
}

.poll-issue-vote-section {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 10; /* Ensure vote buttons are above overlay */
}

.compact-card .poll-issue-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.poll-issue-votes {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.poll-issue-votes .vote-icon {
    font-size: 0.75rem;
}

.poll-issue-votes .vote-count {
    font-weight: 500;
}

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

.poll-issue-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-primary);
}

.poll-issue-header {
    display: none;
}

.issue-id-badge {
    background: var(--accent-primary);
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Space Grotesk', 'Courier New', monospace;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.issue-type {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--bg-quaternary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    font-size: 0.7rem;
}

.issue-type .type-icon {
    font-size: 0.8rem;
}

.issue-type .type-text {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.poll-issue-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-md) 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.poll-issue-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: var(--space-lg);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.poll-issue-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
    margin-bottom: var(--space-md);
}

.issue-vote-count {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--bg-quaternary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.issue-vote-count .vote-icon {
    font-size: 0.85rem;
}

.issue-vote-count .vote-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.poll-issue-actions {
    display: flex;
    justify-content: center;
}

/* Poll Vote Buttons */
.poll-vote-button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 120px;
    justify-content: center;
    position: relative;
    z-index: 11; /* Ensure buttons are above overlay and vote section */
}

.poll-vote-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.poll-vote-button.voted {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.poll-vote-button.disabled {
    background: rgba(108, 117, 125, 0.3);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.7;
}

.poll-vote-button.disabled:hover {
    transform: none;
    box-shadow: none;
}

.poll-vote-button.resolved {
    background: rgba(108, 117, 125, 0.2);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

.poll-vote-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.vote-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Error and Empty States */
.poll-no-issues,
.poll-issues-error {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-secondary);
    grid-column: 1 / -1;
}

.no-issues-icon,
.error-icon {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
    opacity: 0.6;
}

.poll-no-issues h3,
.poll-issues-error h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 0 0 var(--space-md) 0;
}

.poll-no-issues p,
.poll-issues-error p {
    font-size: 1rem;
    line-height: 1.5;
    max-width: 400px;
    margin: 0 auto var(--space-lg);
}

.retry-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Poll Card Clickable Enhancements */
.clickable-poll-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* Poll Issue Card Overlay for View Details */
.poll-issue-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 122, 204, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    border-radius: var(--radius-lg);
    z-index: 5; /* Below vote buttons but above card content */
    pointer-events: none; /* Allow clicks to pass through to vote buttons */
}

.clickable-poll-issue-card:hover .poll-issue-card-overlay {
    opacity: 1;
    pointer-events: auto; /* Enable clicks on overlay when visible */
}

.poll-issue-card-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    color: white;
    text-align: center;
    position: relative;
    z-index: 6;
}

.poll-issue-card-action .action-icon {
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

.poll-issue-card-action .action-text {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.poll-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 122, 204, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    border-radius: var(--radius-lg);
}

.clickable-poll-card:hover .poll-card-overlay {
    opacity: 1;
}

.poll-card-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    color: white;
    text-align: center;
}

.poll-card-action .action-icon {
    font-size: 2rem;
    animation: bounce 2s infinite;
}

.poll-card-action .action-text {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-10px);
    }
    70% {
        transform: translateY(-5px);
    }
    90% {
        transform: translateY(-2px);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .poll-detail-main {
        flex-direction: column;
    }

    .poll-detail-sidebar {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        flex-direction: row;
        overflow-x: auto;
        gap: var(--space-lg);
    }

    .poll-meta-section,
    .poll-voting-info-section {
        min-width: 250px;
        flex-shrink: 0;
    }
}

@media (max-width: 768px) {
    .poll-detail-modal {
        padding: var(--space-md, 1rem);
    }

    .poll-detail-content {
        width: 100%;
        max-height: 95vh;
        border-radius: var(--radius-lg, 12px);
        margin: 0;
    }

    .poll-detail-main {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .poll-detail-header {
        padding: var(--space-lg, 1rem);
    }

    .poll-detail-header-left {
        gap: var(--space-md, 0.75rem);
        text-align: left;
        padding-right: 50px;
    }

    .poll-title-large {
        font-size: 1.4rem;
        line-height: 1.3;
        margin: 0 0 var(--space-xs, 0.25rem) 0;
        text-align: left;
    }

    .poll-detail-close {
        top: var(--space-lg, 1rem);
        right: var(--space-lg, 1rem);
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }

    .poll-detail-sidebar {
        display: none; /* Hide sidebar completely on mobile */
    }

    .poll-detail-content-area {
        flex: 1;
        padding: var(--space-lg);
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: var(--space-lg);
    }

    .poll-description-section {
        flex-shrink: 0;
        max-height: 25vh;
        overflow-y: auto;
        margin-bottom: 0;
    }

    .poll-issues-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow-y: auto;
    }

    .poll-issues-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
        flex: 1;
        overflow-y: auto;
        padding-right: var(--space-xs);
        padding-bottom: var(--space-md);
        max-height: none;
        min-height: 300px;
    }

    .poll-issue-card {
        padding: var(--space-lg);
        /* Maintain full desktop card appearance on mobile */
        height: auto;
        min-height: auto;
        min-height: 280px; /* Ensure minimum height for vote button visibility */
    }

    /* Mobile compact card adjustments */
    .poll-issue-card.compact-card {
        padding: var(--space-md);
        min-height: 100px;
        flex-direction: row;
        align-items: center;
    }

    /* Hide poll issue header and description on mobile - show only title/summary */
    .poll-issue-header {
        display: none;
    }

    .poll-issue-description {
        display: none;
    }

    .poll-vote-button {
        min-width: 110px;
        padding: var(--space-md) var(--space-lg);
        font-size: 0.9rem;
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
        min-height: 44px; /* Ensure touch-friendly size */
    }

    .poll-issue-actions {
        margin-top: var(--space-md);
        padding-top: var(--space-sm);
        border-top: 1px solid var(--border-color);
        display: flex;
        justify-content: center;
        width: 100%;
        flex-shrink: 0; /* Prevent vote button area from shrinking */
        min-height: 60px; /* Ensure minimum space for vote buttons */
    }
}

@media (max-width: 480px) {
    .poll-detail-modal {
        padding: var(--space-sm, 0.5rem);
        align-items: flex-start;
        padding-top: var(--space-lg, 1.5rem);
    }

    .poll-detail-content {
        max-height: 95vh;
        border-radius: var(--radius-md, 8px);
    }

    .poll-detail-header {
        padding: var(--space-md, 0.75rem);
    }

    .poll-detail-header-left {
        padding-right: 45px;
    }

    .poll-title-large {
        font-size: var(--font-base, 1rem);
    }

    .poll-detail-close {
        top: var(--space-md, 0.75rem);
        right: var(--space-md, 0.75rem);
        width: 32px;
        height: 32px;
        font-size: 1.125rem;
    }

    .poll-detail-sidebar {
        display: none; /* Hide sidebar completely on small mobile */
    }

    .poll-detail-content-area {
        flex: 1;
        padding: var(--space-md);
        gap: var(--space-lg);
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .poll-description-section {
        flex-shrink: 0;
        max-height: 22vh;
        overflow-y: auto;
        margin-bottom: 0;
    }

    .poll-issues-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow-y: auto;
    }

    .poll-meta-section,
    .poll-voting-info-section,
    .poll-description-section,
    .poll-issues-section {
        padding: var(--space-md);
    }

    .poll-issues-grid {
        gap: var(--space-sm);
        flex: 1;
        overflow-y: auto;
        padding-right: var(--space-xs);
        padding-bottom: var(--space-md);
        grid-template-columns: 1fr;
        max-height: none;
        min-height: 200px;
    }

    .poll-issue-card {
        padding: var(--space-md);
        /* Maintain full desktop card appearance on small mobile */
        height: auto;
        min-height: auto;
        min-height: 260px; /* Ensure minimum height for vote button visibility on small screens */
    }

    /* Hide poll issue header and description on small mobile - show only title/summary */
    .poll-issue-header {
        display: none;
    }

    .poll-issue-description {
        display: none;
    }

    .poll-vote-button {
        min-width: 100px;
        padding: var(--space-sm) var(--space-md);
        font-size: 0.85rem;
        width: 100%;
        max-width: 180px;
        margin: 0 auto;
        min-height: 42px; /* Ensure touch-friendly size on small screens */
    }

    .poll-issue-actions {
        margin-top: var(--space-sm);
        padding-top: var(--space-sm);
        border-top: 1px solid var(--border-color);
        display: flex;
        justify-content: center;
        width: 100%;
        flex-shrink: 0; /* Prevent vote button area from shrinking */
        min-height: 56px; /* Ensure minimum space for vote buttons on small screens */
    }
}

/* Light theme support */
[data-theme="light"] .poll-detail-content {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .poll-detail-sidebar {
    background: #f8f9fa;
}

[data-theme="light"] .poll-meta-section,
[data-theme="light"] .poll-voting-info-section,
[data-theme="light"] .poll-description-section,
[data-theme="light"] .poll-issues-section {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .poll-issue-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .poll-issue-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Fix title color in light theme */
[data-theme="light"] .poll-title-large {
    color: var(--text-primary, #0f172a);
}

/* Desktop layout: ensure issues section flexes and grid scrolls */
.poll-issues-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}


/* Prevent description from shrinking on desktop */
.poll-description-section {
    flex-shrink: 0;
    max-height: 25vh; /* Keep description small; scroll if longer */
    overflow-y: auto;
}


/* Results Summary (Finished Polls) */
.poll-results-summary {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.12), rgba(40, 167, 69, 0.06));
    border: 1px solid rgba(40, 167, 69, 0.35);
    border-radius: var(--radius-lg);
    padding: var(--space-sm);
    color: var(--text-primary);
}

.poll-results-summary-inner {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Winner styling */
/* clickable-poll-issue-card is already positioned relative above, this ensures badges anchor correctly */
.poll-issue-card.winner {
    border-color: var(--accent-primary);
    box-shadow: 0 6px 20px rgba(0, 122, 204, 0.35);
}

.winner-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--gradient-primary);
    color: #ffffff;
    border-radius: 999px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 12; /* Above overlay (5) and vote buttons (11) */
    pointer-events: none; /* Do not block clicks */
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.winner-badge .badge-icon {
    font-size: 0.9rem;
}

/* Share Button Styles for Poll Modal */
.share-poll-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs, 0.25rem);
    padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md, 8px);
    color: var(--accent-tertiary, #10b981);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-height: 36px;
    height: 36px;
    line-height: 1;
    text-decoration: none;
    font-family: inherit;
    box-sizing: border-box;
    vertical-align: top;
    width: 100%;
    justify-content: center;
}

.share-poll-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.share-poll-btn:focus {
    outline: 2px solid var(--accent-tertiary, #10b981);
    outline-offset: 2px;
}

.share-poll-btn:active {
    transform: translateY(0);
}

.share-poll-btn.share-copied {
    background: rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.6);
    color: var(--accent-success, #059669);
}

.share-poll-btn .share-icon {
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-poll-btn .share-text {
    font-weight: 600;
}

/* Enhanced Statistics Section for Finished Polls */
.poll-statistics-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    max-height: 60vh;
    overflow-y: auto;
}

.poll-statistics-section h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-lg) 0;
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border-color);
}

.poll-statistics-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* Statistics Overview */
.statistics-overview {
    background: linear-gradient(135deg, rgba(0, 122, 204, 0.1), rgba(0, 122, 204, 0.05));
    border: 1px solid rgba(0, 122, 204, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.statistics-overview.no-votes {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.1), rgba(108, 117, 125, 0.05));
    border-color: rgba(108, 117, 125, 0.2);
    text-align: center;
}

.overview-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.overview-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.overview-info h4 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs) 0;
}

.overview-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.total-votes {
    font-weight: 600;
    color: var(--text-primary);
}

.poll-status {
    background: rgba(108, 117, 125, 0.15);
    color: var(--text-secondary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Statistics Results */
.statistics-results h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-lg) 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.results-breakdown {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Option Statistics */
.option-statistics {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all 0.3s ease;
}

.option-statistics.winner-option {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
    border-color: rgba(40, 167, 69, 0.3);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.option-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.option-rank {
    background: var(--gradient-primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}

.winner-option .option-rank {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.option-info {
    flex: 1;
    min-width: 0;
}

.option-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs) 0;
    line-height: 1.3;
    word-wrap: break-word;
}

.option-votes {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9rem;
}

.vote-count {
    color: var(--text-secondary);
    font-weight: 500;
}

.vote-percentage {
    background: var(--accent-primary);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 45px;
    text-align: center;
}

.winner-option .vote-percentage {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.winner-indicator {
    font-size: 1.5rem;
    flex-shrink: 0;
    opacity: 0.8;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-quaternary);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.8s ease-out;
    border-radius: 3px;
}

.progress-fill.winner-progress {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
}

/* Statistics Summary */
.statistics-summary h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-lg) 0;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
}

.summary-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
    transition: transform 0.2s ease;
}

.summary-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.summary-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
}

.summary-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-display);
}

/* Error and Empty States */
.no-statistics,
.statistics-error {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-secondary);
    font-size: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

/* Responsive Design for Statistics */
@media (max-width: 768px) {
    .poll-statistics-section {
        padding: var(--space-lg);
        max-height: 50vh;
    }

    .overview-header {
        flex-direction: column;
        text-align: center;
        gap: var(--space-sm);
    }

    .overview-meta {
        justify-content: center;
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .option-header {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .poll-statistics-section {
        padding: var(--space-md);
        max-height: 45vh;
    }

    .option-statistics {
        padding: var(--space-md);
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .option-rank {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .option-title {
        font-size: 0.9rem;
    }

    .vote-percentage {
        min-width: 40px;
        font-size: 0.75rem;
    }
}

/* Clickable Option Statistics Containers */
.clickable-option-statistics {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.clickable-option-statistics:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 122, 204, 0.2);
    border-color: var(--accent-primary);
}

.clickable-option-statistics.winner-option:hover {
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.25);
    border-color: rgba(40, 167, 69, 0.5);
}

.clickable-option-statistics:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.15);
}

/* Add a subtle visual hint for clickable containers */
.clickable-option-statistics::after {
    content: '📄';
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.clickable-option-statistics:hover::after {
    opacity: 0.6;
}

/* Enable overlay for statistics cards */
.clickable-option-statistics:hover .poll-issue-card-overlay {
    opacity: 1;
}

/* Responsive adjustments for clickable statistics */
@media (max-width: 768px) {
    .clickable-option-statistics:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 122, 204, 0.15);
    }

    .clickable-option-statistics.winner-option:hover {
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
    }
}

@media (max-width: 480px) {
    .clickable-option-statistics::after {
        display: none; /* Hide icon on small screens to save space */
    }

    .clickable-option-statistics:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 122, 204, 0.1);
    }

    .clickable-option-statistics.winner-option:hover {
        box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
    }
}

/*!* ===================================================*/
/*   MOBILE MODAL FOOTER FIX*/
/*   =================================================== *!*/

/*@media (max-width: 768px) {*/

/*    .poll-detail-content {*/
/*        max-height: 90vh;*/
/*        max-height: 90dvh;*/
/*        display: flex;*/
/*        flex-direction: column;*/
/*    }*/

/*    .poll-detail-body {*/
/*        padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px));*/
/*        flex: 1;*/
/*        overflow-y: auto;*/
/*        -webkit-overflow-scrolling: touch;*/
/*    }*/

/*    .poll-detail-main {*/
/*        flex: 1;*/
/*        display: flex;*/
/*        overflow: hidden;*/
/*        min-height: 0;*/
/*    }*/

/*    .poll-content-section {*/
/*        padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));*/
/*        flex: 1;*/
/*        overflow-y: auto;*/
/*        -webkit-overflow-scrolling: touch;*/
/*    }*/

/*    .poll-detail-content-area {*/
/*        display: flex;*/
/*        flex-direction: column;*/
/*        gap: var(--space-sm); !* Reduce gap between sections *!*/
/*        overflow: hidden;*/
/*        min-height: 0;*/
/*        height: 100%; !* Take full available height *!*/
/*    }*/

/*    .poll-issues-section {*/
/*        flex: 1; !* Take remaining space after description *!*/
/*        min-height: 0;*/
/*        display: flex;*/
/*        flex-direction: column;*/
/*        overflow: hidden;*/
/*        order: 1; !* Ensure issues section comes first *!*/
/*    }*/

/*    .poll-description-section {*/
/*        flex: 0 0 auto; !* Fixed size, don't grow *!*/
/*        max-height: 30vh;*/
/*        overflow-y: auto;*/
/*        -webkit-overflow-scrolling: touch;*/
/*        order: 2; !* Move description to bottom *!*/
/*        margin-top: auto; !* Push to bottom of container *!*/
/*    }*/

/*    .poll-issues-grid {*/
/*        flex: 1;*/
/*        min-height: 0;*/
/*        overflow-y: auto;*/
/*        -webkit-overflow-scrolling: touch;*/
/*    }*/

/*    .poll-detail-sidebar {*/
/*        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));*/
/*    }*/

/*    .comment-textarea,*/
/*    .form-input,*/
/*    .form-textarea {*/
/*        font-size: 16px;*/
/*    }*/

/*    .poll-action-btn,*/
/*    .vote-btn,*/
/*    .comment-btn {*/
/*        min-height: 44px;*/
/*        min-width: 44px;*/
/*    }*/
/*}*/

/*@media (max-width: 480px) {*/
/*    .poll-detail-content {*/
/*        max-height: 85vh;*/
/*        max-height: 85dvh;*/
/*    }*/

/*    .poll-detail-body {*/
/*        padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));*/
/*    }*/

/*    .poll-content-section {*/
/*        padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0px));*/
/*    }*/

/*    .poll-description-section {*/
/*        max-height: 25vh;*/
/*    }*/
/*}*/

/*@media (max-width: 768px) and (orientation: landscape) {*/
/*    .poll-detail-body {*/
/*        padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0px));*/
/*    }*/

/*    .poll-detail-content {*/
/*        max-height: 80vh;*/
/*        max-height: 80dvh;*/
/*    }*/

/*    .poll-content-section {*/
/*        padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));*/
/*    }*/
/*}*/

/*@media (max-width: 768px) {*/
/*    .poll-detail-modal {*/
/*        padding-left: max(1rem, env(safe-area-inset-left, 1rem));*/
/*        padding-right: max(1rem, env(safe-area-inset-right, 1rem));*/
/*        padding-top: max(1rem, env(safe-area-inset-top, 1rem));*/
/*    }*/
/*}*/
