/* ========================================
   FORUM4 POLLS - FRONTEND STYLES
   Polymarket-inspired Design v2.3 OPTIMIZED
   Mobile-First App-Like Design + INSTANT MODALS
   ======================================== */

:root {
    --f4-bg-primary: #0f1419;
    --f4-bg-secondary: #1e2936;
    --f4-bg-tertiary: #2d3748;
    --f4-text-primary: #ffffff;
    --f4-text-secondary: #a0aec0;
    --f4-text-tertiary: #718096;
    --f4-accent: #667eea;
    --f4-accent-hover: #5a67d8;
    --f4-border: #2d3748;
    --f4-green: #10b981;
    --f4-red: #ef4444;
    --f4-yellow: #f59e0b;
    --f4-blue: #3b82f6;
}

html {
    box-sizing: border-box;
}

html *,
html *::before,
html *::after {
    box-sizing: inherit;
}

body {
    background: var(--f4-bg-primary);
    color: var(--f4-text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   CONTAINER
   ======================================== */

.forum4-polls-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ========================================
   HEADER
   ======================================== */

.forum4-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--f4-border);
}

.forum4-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--f4-text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.forum4-logo:hover {
    color: var(--f4-accent);
}

.forum4-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.forum4-points {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--f4-bg-secondary);
    border-radius: 20px;
    font-weight: 600;
}

.forum4-points-icon {
    font-size: 18px;
}

/* ========================================
   FILTERS SECTION
   ======================================== */

.forum4-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.forum4-filters-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--f4-text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.forum4-clear-filters {
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 20px;
    color: var(--f4-red);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.forum4-clear-filters:hover {
    background: var(--f4-red);
    color: white;
    transform: translateY(-2px);
}

.forum4-filter-section {
    margin-bottom: 20px;
}

.forum4-filter-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--f4-text-secondary);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.forum4-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--f4-accent) var(--f4-bg-secondary);
}

.forum4-filters-horizontal {
    flex-wrap: nowrap;
}

.forum4-filters::-webkit-scrollbar {
    height: 6px;
}

.forum4-filters::-webkit-scrollbar-track {
    background: var(--f4-bg-secondary);
    border-radius: 3px;
}

.forum4-filters::-webkit-scrollbar-thumb {
    background: var(--f4-accent);
    border-radius: 3px;
}

.forum4-filter-btn {
    padding: 10px 18px;
    background: var(--f4-bg-secondary);
    border: 2px solid var(--f4-border);
    border-radius: 24px;
    color: var(--f4-text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    will-change: transform;
    position: relative;
    overflow: visible;
}

.forum4-filter-btn:hover {
    background: var(--f4-bg-tertiary);
    color: var(--f4-text-primary);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    border-color: var(--f4-accent);
    z-index: 5;
}

.forum4-filter-btn.active {
    background: var(--f4-accent);
    color: white;
    border-color: var(--f4-accent);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.forum4-filter-btn.active:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.5);
}

.forum4-filter-emoji {
    font-size: 16px;
}

.forum4-filter-check {
    margin-left: 4px;
    font-weight: 700;
}

/* Filter highlight animation */
.forum4-filter-btn.filter-highlight {
    animation: filterHighlight 1s ease;
}

@keyframes filterHighlight {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 8px 24px rgba(102, 126, 234, 0.8);
    }
}

/* Active Filters Display */
.forum4-active-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px;
    background: var(--f4-bg-secondary);
    border-radius: 12px;
    margin-bottom: 20px;
}

.forum4-active-filters-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--f4-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forum4-active-filter-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--f4-accent);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.forum4-remove-filter {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.forum4-remove-filter:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Results Count */
.forum4-results-count {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--f4-bg-secondary);
    border-radius: 12px;
    margin-bottom: 24px;
}

.forum4-results-icon {
    font-size: 18px;
}

.forum4-results-text {
    font-size: 14px;
    color: var(--f4-text-secondary);
    font-weight: 600;
}

.forum4-results-text strong {
    color: var(--f4-accent);
}

/* ========================================
   POLLS GRID
   ======================================== */

.forum4-polls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* ========================================
   POLL CARD - APP-LIKE DESIGN
   ======================================== */

.forum4-poll-card {
    background: var(--f4-bg-secondary);
    border: 1px solid var(--f4-border);
    border-radius: 20px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    will-change: transform;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.forum4-poll-card:hover {
    border-color: var(--f4-accent);
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.25);
}

.forum4-poll-card.voted {
    border-color: var(--f4-green);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.forum4-poll-card.featured {
    border-color: var(--f4-yellow);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
    background: linear-gradient(135deg, var(--f4-bg-secondary) 0%, rgba(245, 158, 11, 0.05) 100%);
}

.forum4-poll-card.expired {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Featured Badge - Smaller & Subtle */
.forum4-featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ========================================
   LABELS - ANIMATED & GLOWING
   ======================================== */

.forum4-poll-labels {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.forum4-label {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    
    /* Dynamic glow shadow based on label background */
    box-shadow: 
        0 2px 8px currentColor,
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    
    /* Subtle floating animation */
    animation: labelFloat 3s ease-in-out infinite;
}

/* Shimmer effect overlay */
.forum4-label::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    transform: rotate(45deg);
    animation: labelShimmer 3s ease-in-out infinite;
}

/* Hover effect */
.forum4-label:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 4px 16px currentColor,
        0 0 0 2px rgba(255, 255, 255, 0.3) inset;
}

/* Animated labels - extra pulse */
.forum4-label.animated {
    animation: labelFloat 3s ease-in-out infinite, labelPulse 2s ease-in-out infinite;
}

/* Floating animation */
@keyframes labelFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

/* Shimmer animation */
@keyframes labelShimmer {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

/* Pulse animation for "animated" class labels */
@keyframes labelPulse {
    0%, 100% {
        box-shadow: 
            0 2px 8px currentColor,
            0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    }
    50% {
        box-shadow: 
            0 4px 16px currentColor,
            0 0 20px currentColor,
            0 0 0 2px rgba(255, 255, 255, 0.4) inset;
    }
}

/* Different animation delays for natural feel */
.forum4-label:nth-child(1) { animation-delay: 0s; }
.forum4-label:nth-child(2) { animation-delay: 0.2s; }
.forum4-label:nth-child(3) { animation-delay: 0.4s; }
.forum4-label:nth-child(4) { animation-delay: 0.6s; }
.forum4-label:nth-child(5) { animation-delay: 0.8s; }

/* Poll Header - New Structure */
.forum4-poll-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}

.forum4-poll-title-section {
    flex: 1;
    display: flex;
    gap: 12px;
}

.forum4-poll-thumbnail {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.forum4-poll-content {
    flex: 1;
    min-width: 0;
}

.forum4-poll-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--f4-text-primary);
    margin: 0 0 10px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Stats Below Title */
.forum4-poll-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.forum4-poll-stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--f4-text-secondary);
    font-weight: 600;
}

.forum4-poll-stat-item .stat-icon {
    font-size: 14px;
}

.forum4-poll-stat-item .stat-value {
    color: var(--f4-accent);
    font-weight: 700;
}

.forum4-poll-stat-item.forum4-poll-countdown.urgent {
    color: var(--f4-red);
}

.forum4-poll-stat-item.forum4-poll-countdown.urgent .stat-value {
    color: var(--f4-red);
    animation: urgentBlink 1.5s ease-in-out infinite;
}

@keyframes urgentBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Meta Links Below Stats */
.forum4-poll-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.forum4-meta-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 14px;
    color: var(--f4-accent);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    will-change: transform;
    border: 1px solid rgba(102, 126, 234, 0.2);
    cursor: pointer;
    font-family: inherit;
}

.forum4-meta-link:hover {
    background: var(--f4-accent);
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.forum4-external-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 14px;
    color: var(--f4-blue);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    will-change: transform;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.forum4-external-link:hover {
    background: var(--f4-blue);
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ========================================
   CHANCE CIRCLE - REDESIGNED & INLINE
   ======================================== */

.forum4-poll-chance {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(102, 126, 234, 0.05);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 14px;
    margin-bottom: 16px;
}

.forum4-chance-circle {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.forum4-chance-circle svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.forum4-chance-circle circle {
    fill: none;
    stroke-width: 7;
    transition: stroke-dasharray 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.forum4-chance-circle .circle-bg {
    stroke: var(--f4-bg-tertiary);
}

.forum4-chance-circle .circle-progress {
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px rgba(102, 126, 234, 0.5));
    animation: pulseGlow 2s ease-in-out infinite;
}

.forum4-chance-circle[data-winning="yes"] .circle-progress {
    stroke: url(#gradient-green);
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.6));
}

.forum4-chance-circle[data-winning="no"] .circle-progress {
    stroke: url(#gradient-red);
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.forum4-chance-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 700;
    color: var(--f4-text-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.forum4-chance-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.forum4-chance-label {
    font-size: 11px;
    color: var(--f4-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.forum4-chance-winning {
    font-size: 14px;
    font-weight: 700;
    color: var(--f4-text-primary);
}

.forum4-chance-winning .winning-option {
    color: var(--f4-accent);
}

.forum4-chance-winning[data-winning="yes"] .winning-option {
    color: var(--f4-green);
}

.forum4-chance-winning[data-winning="no"] .winning-option {
    color: var(--f4-red);
}

/* Vote CTA */
.forum4-vote-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 14px;
    margin-bottom: 16px;
    max-width: fit-content;
    transition: all 0.3s ease;
}

.forum4-vote-cta.voted {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
}

.forum4-vote-icon {
    font-size: 24px;
    line-height: 1;
}

.forum4-vote-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.forum4-vote-text strong {
    font-size: 14px;
    color: var(--f4-text-primary);
    font-weight: 700;
}

/* Fade out animation for Vote CTA */
.forum4-vote-cta.fade-out {
    animation: fadeOutSlide 0.4s ease forwards;
}

@keyframes fadeOutSlide {
    from {
        opacity: 1;
        transform: translateY(0);
        max-height: 60px;
        margin-bottom: 16px;
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* ========================================
   POLL OPTIONS
   ======================================== */

.forum4-poll-options-wrapper {
    position: relative;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.forum4-poll-options-wrapper.forum4-collapsed {
    max-height: 210px;
}

.forum4-poll-options-wrapper.forum4-collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--f4-bg-secondary));
    pointer-events: none;
    z-index: 1;
}

.forum4-poll-options-wrapper.forum4-expanded::after {
    display: none;
}

.forum4-poll-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.forum4-poll-option {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--f4-bg-tertiary);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    will-change: transform;
}

.forum4-poll-option:hover {
    border-color: var(--f4-accent);
    transform: translateX(4px);
}

.forum4-poll-option.forum4-my-vote {
    border-color: var(--f4-green);
    background: rgba(16, 185, 129, 0.08);
}

.forum4-option-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.2), rgba(102, 126, 234, 0.05));
    transition: width 0.5s ease;
    z-index: 0;
}

.forum4-option-text {
    position: relative;
    z-index: 1;
    font-weight: 600;
    color: var(--f4-text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.forum4-option-percentage {
    position: relative;
    z-index: 1;
    font-size: 18px;
    font-weight: 700;
    color: var(--f4-accent);
}

.forum4-my-vote-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--f4-green);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   SHOW MORE BUTTON
   ======================================== */

.forum4-show-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    margin-top: 12px;
    background: var(--f4-bg-tertiary);
    border: 2px solid var(--f4-border);
    border-radius: 12px;
    color: var(--f4-text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    will-change: transform;
}

.forum4-show-more-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--f4-accent);
    color: var(--f4-accent);
    transform: translateY(-2px);
}

.forum4-show-more-icon {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.forum4-show-more-btn.forum4-expanded .forum4-show-more-icon {
    transform: rotate(180deg);
}

.forum4-options-count-badge {
    background: var(--f4-accent);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

/* ========================================
   SHARE BUTTON
   ======================================== */

.forum4-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px auto 0; 
    gap: 8px;
    width: 50%;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid var(--f4-accent);
    border-radius: 12px;
    color: var(--f4-accent);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    position: relative;
    overflow: hidden;
}

.forum4-share-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.forum4-share-btn:hover::before {
    width: 300px;
    height: 300px;
}

.forum4-share-btn:hover {
    background: linear-gradient(135deg, var(--f4-accent) 0%, #764ba2 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    border-color: var(--f4-accent);
}

.forum4-share-btn:active {
    transform: translateY(-1px);
}

.forum4-share-icon {
    font-size: 20px;
    line-height: 1;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.forum4-share-btn:hover .forum4-share-icon {
    transform: rotate(15deg) scale(1.1);
}

.forum4-share-text {
    position: relative;
    z-index: 1;
}

.forum4-share-btn.forum4-share-copied {
    background: linear-gradient(135deg, var(--f4-green) 0%, #059669 100%);
    color: white;
    border-color: var(--f4-green);
    animation: shareCopied 0.6s ease;
}

@keyframes shareCopied {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.forum4-share-btn.forum4-share-copied .forum4-share-icon {
    animation: shareIconBounce 0.6s ease;
}

@keyframes shareIconBounce {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-10deg); }
    75% { transform: scale(1.2) rotate(10deg); }
}

/* ========================================
   MODAL OVERLAYS - INSTANT ANIMATIONS
   ======================================== */

/* ========================================
   MODAL OVERLAYS - FASTER TRANSITIONS
   ======================================== */

.forum4-login-prompt-overlay,
.forum4-already-voted-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.1s ease; /* SUPER FAST - 100ms */
}

.forum4-login-prompt-overlay.forum4-modal-show,
.forum4-already-voted-overlay.forum4-modal-show {
    opacity: 1;
}

.forum4-login-prompt,
.forum4-already-voted-modal {
    background: var(--f4-bg-secondary);
    border: 2px solid var(--f4-accent);
    border-radius: 24px;
    padding: 50px 40px 40px; /* Extra top padding for close button */
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: scale(0.95);
    transition: transform 0.1s ease; /* SUPER FAST - 100ms */
}

.forum4-modal-show .forum4-login-prompt,
.forum4-modal-show .forum4-already-voted-modal {
    transform: scale(1);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .forum4-login-prompt,
    .forum4-already-voted-modal {
        padding: 56px 20px 32px; /* More top padding for bigger button */
        width: 95%;
    }
}



.forum4-login-prompt-icon,
.forum4-modal-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.forum4-login-prompt h3,
.forum4-already-voted-modal h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--f4-text-primary);
    margin: 0 0 12px 0;
}

.forum4-login-prompt p,
.forum4-already-voted-modal p {
    font-size: 16px;
    color: var(--f4-text-secondary);
    margin: 0 0 32px 0;
    line-height: 1.6;
}

/* Close buttons - BIGGER touch targets */
/* ========================================
   MODAL CLOSE BUTTONS - INSTANT & BIGGER
   ======================================== */

.forum4-login-prompt-close,
.forum4-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 12px 20px;
    background: var(--f4-bg-tertiary);
    border: 2px solid var(--f4-border);
    border-radius: 12px;
    color: var(--f4-text-primary);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease; /* FAST - 150ms */
    min-width: 100px;
    min-height: 48px; /* Better touch target */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 10000;
    /* Prevent text selection */
    user-select: none;
    -webkit-user-select: none;
    /* Better tap on mobile */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.forum4-login-prompt-close:hover,
.forum4-modal-close:hover {
    background: var(--f4-red);
    border-color: var(--f4-red);
    color: white;
    transform: scale(1.05);
}

.forum4-login-prompt-close:active,
.forum4-modal-close:active {
    transform: scale(0.95);
    transition: all 0.05s ease; /* INSTANT feedback */
}

/* Mobile - even bigger */
@media (max-width: 768px) {
    .forum4-login-prompt-close,
    .forum4-modal-close {
        min-height: 52px; /* Bigger on mobile */
        font-size: 16px;
        padding: 14px 24px;
        top: 12px;
        right: 12px;
    }
}

/* High contrast for accessibility */
@media (prefers-contrast: high) {
    .forum4-login-prompt-close,
    .forum4-modal-close {
        border-width: 3px;
    }
}


.forum4-login-prompt-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.forum4-login-prompt-btn {
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    will-change: transform;
}

.forum4-login-prompt-btn.primary {
    background: linear-gradient(135deg, var(--f4-accent), #764ba2);
    color: white;
    border: none;
}

.forum4-login-prompt-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.forum4-login-prompt-btn.secondary {
    background: transparent;
    color: var(--f4-text-secondary);
    border: 2px solid var(--f4-border);
}

.forum4-login-prompt-btn.secondary:hover {
    border-color: var(--f4-accent);
    color: var(--f4-accent);
}

/* ========================================
   NOTIFICATIONS
   ======================================== */

.forum4-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--f4-bg-secondary);
    border: 2px solid;
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
}

.forum4-notification.forum4-notification-show {
    transform: translateX(0);
    opacity: 1;
}

.forum4-notification-success {
    border-color: var(--f4-green);
}

.forum4-notification-error {
    border-color: var(--f4-red);
}

.forum4-notification-icon {
    font-size: 24px;
}

.forum4-notification-message {
    font-size: 14px;
    font-weight: 600;
    color: var(--f4-text-primary);
}

/* Vote Success Enhanced */
.forum4-notification-vote {
    min-width: 350px;
    max-width: 450px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, var(--f4-bg-secondary) 100%);
    border: 2px solid var(--f4-green);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.3);
}

.forum4-notification-vote .forum4-notification-icon {
    font-size: 36px;
    animation: celebrationBounce 0.6s ease-in-out;
}

@keyframes celebrationBounce {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-10deg); }
    50% { transform: scale(1.1) rotate(10deg); }
    75% { transform: scale(1.2) rotate(-5deg); }
}

.forum4-notification-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.forum4-notification-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--f4-text-primary);
    letter-spacing: 0.3px;
}

.forum4-notification-message strong {
    color: var(--f4-green);
    font-weight: 700;
    font-size: 16px;
}

/* ========================================
   EMPTY STATE & LOADING
   ======================================== */

.forum4-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.forum4-empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.forum4-empty-state h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--f4-text-primary);
    margin: 0 0 12px 0;
}

.forum4-empty-state p {
    font-size: 16px;
    color: var(--f4-text-secondary);
    margin: 0;
}

.forum4-loading {
    text-align: center;
    padding: 40px;
}

.forum4-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--f4-border);
    border-top-color: var(--f4-accent);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   RESPONSIVE - MOBILE APP-LIKE
   ======================================== */

@media (max-width: 768px) {
    .forum4-polls-container {
        padding: 16px 12px 80px 12px;
    }
    
    .forum4-polls-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .forum4-poll-card {
        border-radius: 16px;
        padding: 16px;
    }
    
    .forum4-featured-badge {
        top: 10px;
        right: 10px;
        font-size: 9px;
        padding: 3px 8px;
        border-radius: 6px;
    }
    
    .forum4-poll-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .forum4-poll-title {
        font-size: 16px;
    }
    
    .forum4-poll-chance {
        margin-left: 0;
        margin-top: 8px;
        align-self: flex-end;
    }
    
    .forum4-chance-circle {
        width: 56px;
        height: 56px;
    }
    
    .forum4-chance-percentage {
        font-size: 16px;
    }
    
    .forum4-filter-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .forum4-vote-cta {
        width: 100%;
        max-width: 100%;
        justify-content: flex-start;
    }
    
    .forum4-poll-stat-item {
        font-size: 12px;
    }
    
    .forum4-poll-options-wrapper.forum4-collapsed {
        max-height: 180px;
    }
    
    .forum4-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .forum4-user-info {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .forum4-login-prompt,
    .forum4-already-voted-modal {
        padding: 32px 20px;
        width: 95%;
    }
    
    .forum4-login-prompt-close,
    .forum4-modal-close {
        top: 12px;
        right: 12px;
        padding: 10px 18px;
        font-size: 13px;
        min-height: 48px; /* Bigger on mobile */
    }
    
    .forum4-login-prompt-actions {
        flex-direction: column;
    }
    
    .forum4-login-prompt-btn {
        width: 100%;
    }
    
    .forum4-poll-labels {
        gap: 6px;
    }
    
    .forum4-label {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    /* Reduce animations on mobile */
    .forum4-label::before {
        animation-duration: 4s;
    }
    
    .forum4-filters {
        gap: 8px;
    }
    
    .forum4-notification {
        left: 12px;
        right: 12px;
        transform: translateY(-100px);
    }
    
    .forum4-notification.forum4-notification-show {
        transform: translateY(0);
    }
    
    .forum4-notification-vote {
        min-width: auto;
        max-width: 90%;
        padding: 18px 20px;
    }
    
    .forum4-share-btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .forum4-share-icon {
        font-size: 18px;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .forum4-label,
    .forum4-label::before,
    .forum4-label.animated {
        animation: none !important;
    }
    
    .forum4-label:hover {
        transform: none;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* iOS Safe Area Support */
@supports (padding: max(0px)) {
    .forum4-polls-container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(40px, env(safe-area-inset-bottom));
    }
}

/* Dark scrollbar */
.forum4-polls-container::-webkit-scrollbar {
    width: 10px;
}

.forum4-polls-container::-webkit-scrollbar-track {
    background: var(--f4-bg-primary);
}

.forum4-polls-container::-webkit-scrollbar-thumb {
    background: var(--f4-accent);
    border-radius: 5px;
}

.forum4-polls-container::-webkit-scrollbar-thumb:hover {
    background: var(--f4-accent-hover);
}

/**
 * ========================================
 * INSTANT VOTING FEEDBACK
 * ========================================
 */

/* Voting Loading State */
.forum4-poll-option.voting-loading {
    position: relative;
    opacity: 0.8;
    cursor: wait !important;
}

.forum4-poll-option.voting-disabled {
    opacity: 0.5;
    pointer-events: none !important;
}

/* Vote Spinner (inside percentage) */
.vote-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Voted State - Instant Highlight */
.forum4-poll-option.forum4-my-vote {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
    border-color: #10b981 !important;
    animation: voteSuccess 0.5s ease;
}

@keyframes voteSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* My Vote Badge Animation */
.forum4-my-vote-badge {
    animation: badgeSlideIn 0.3s ease;
}

@keyframes badgeSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Vote CTA Fade Out */
.forum4-vote-cta.fade-out {
    animation: fadeOut 0.4s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

