/* Poll Feature Styles - Dark/Gold Theme */
/* Supports both Flock Feed and Inside Talk */

/* Poll Container */
.poll-container {
    margin: 16px 0;
    padding: 20px;
    max-width: 100%;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(244, 208, 63, 0.05) 100%);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.poll-container:hover {
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.2);
    transform: translateY(-2px);
}

/* Poll Question */
.poll-question {
    font-size: 16px;
    font-weight: 600;
    color: #f9fafb;
    margin-bottom: 16px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.poll-question::before {
    content: "📊";
    font-size: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Light theme - dark text for readability */
.light-theme .poll-question,
.flock-posts-container.light-theme .poll-question,
body.light-theme .poll-question,
.tweet-feed.light-theme .poll-question,
.tweets-container.light-theme .poll-question,
.light-theme .tweet .poll-question,
.light-theme .poll-container .poll-question,
/* Inside Talk light theme - no dark-theme class */
.twitter-feed-enhanced:not(.dark-theme) .poll-question {
    color: #000000 !important;
}

/* Poll Options */
.poll-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

/* Poll Option Button (Before Voting) */
.poll-option {
    position: relative;
    padding: 14px 18px;
    background: rgba(31, 41, 55, 0.6);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    font-weight: 500;
    color: #f9fafb;
    text-align: left;
    overflow: hidden;
    backdrop-filter: blur(5px);
    user-select: none;
}

.poll-option::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.poll-option:active::before {
    width: 300px;
    height: 300px;
}

.poll-option:hover {
    background: rgba(31, 41, 55, 0.9);
    border-color: #d4af37;
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.4), 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.poll-option:active {
    transform: translateX(8px) scale(0.98);
}

/* Voting state */
.poll-option.voting {
    background: rgba(212, 175, 55, 0.2);
    border-color: #d4af37;
    cursor: wait;
    animation: votingPulse 1s ease-in-out infinite;
}

@keyframes votingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.poll-option.voting::after {
    content: "Voting...";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #d4af37;
    font-weight: 600;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Voted success state */
.poll-option.voted-success {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.light-theme .poll-option.voted-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
}

/* Light theme for poll options */
.light-theme .poll-option,
/* Inside Talk light theme - no dark-theme class */
.twitter-feed-enhanced:not(.dark-theme) .poll-option {
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
    border-color: rgba(212, 175, 55, 0.4);
}

.light-theme .poll-option:hover,
/* Inside Talk light theme hover - no dark-theme class */
.twitter-feed-enhanced:not(.dark-theme) .poll-option:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #d4af37;
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.3), 0 0 0 2px rgba(212, 175, 55, 0.15);
}

.light-theme .poll-option.voting,
/* Inside Talk light theme voting - no dark-theme class */
.twitter-feed-enhanced:not(.dark-theme) .poll-option.voting {
    background: rgba(212, 175, 55, 0.15);
    border-color: #d4af37;
}

/* Poll Option Result (After Voting) */
.poll-option-result {
    position: relative;
    padding: 14px 18px;
    background: rgba(31, 41, 55, 0.6);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: #f9fafb;
    overflow: hidden;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.poll-option-result:last-child {
    margin-bottom: 0;
}

/* Light theme for results */
.light-theme .poll-option-result,
/* Inside Talk light theme results - no dark-theme class */
.twitter-feed-enhanced:not(.dark-theme) .poll-option-result {
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
    border-color: rgba(212, 175, 55, 0.4);
}

/* Progress Bar */
.poll-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(212, 175, 55, 0.25) 0%, 
        rgba(244, 208, 63, 0.2) 100%
    );
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

/* Light theme progress bar */
.light-theme .poll-progress-bar {
    background: linear-gradient(90deg, 
        rgba(212, 175, 55, 0.2) 0%, 
        rgba(244, 208, 63, 0.15) 100%
    );
}

/* Winning option highlight */
.poll-option-result.winning .poll-progress-bar {
    background: linear-gradient(90deg, 
        rgba(212, 175, 55, 0.4) 0%, 
        rgba(244, 208, 63, 0.35) 100%
    );
}

.poll-option-result.winning {
    border-color: #d4af37;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

/* User's voted option */
.poll-option-result.user-voted {
    border-color: #d4af37;
    background: rgba(31, 41, 55, 0.9);
}

.light-theme .poll-option-result.user-voted,
/* Inside Talk light theme user-voted - no dark-theme class */
.twitter-feed-enhanced:not(.dark-theme) .poll-option-result.user-voted {
    border-color: #d4af37;
    background: rgba(255, 255, 255, 1);
}

.poll-option-result.user-voted::after {
    content: "✓";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #d4af37;
    font-weight: bold;
    z-index: 2;
}

/* Option Content */
.poll-option-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.poll-option-text {
    flex: 1;
    margin-right: 12px;
}

.poll-option-percentage {
    font-weight: 700;
    font-size: 16px;
    color: #d4af37;
    min-width: 50px;
    text-align: right;
}

.light-theme .poll-option-percentage {
    color: #d4af37;
}

.poll-option-result.winning .poll-option-percentage {
    color: #22c55e;
}

/* Poll Footer */
.poll-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    font-size: 13px;
    color: #9ca3af;
}

.light-theme .poll-footer,
.flock-posts-container.light-theme .poll-footer,
body.light-theme .poll-footer,
/* Inside Talk light theme footer - no dark-theme class */
.twitter-feed-enhanced:not(.dark-theme) .poll-footer {
    border-top-color: rgba(212, 175, 55, 0.4);
    color: #4b5563 !important;
}

.poll-total-votes {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.poll-total-votes::before {
    content: "👥";
    font-size: 14px;
}

.poll-time-remaining {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.poll-time-remaining::before {
    content: "⏱️";
    font-size: 14px;
}

.poll-ended {
    color: #ef4444;
    font-weight: 600;
}

body:not(.light-theme) .poll-ended,
.flock-posts-container:not(.light-theme) .poll-ended {
    color: #f87171;
}

/* Poll Creation UI in Create Post Modal */
.poll-toggle-container {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    margin: 0;
    transition: all 0.3s ease;
}

.poll-toggle-label {
    display: none; /* Hide the label text */
}

/* Poll Icon Button - matches media button style */
.poll-toggle-switch {
    position: relative;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.poll-toggle-switch::before {
    content: "📊";
    font-size: 20px;
    transition: transform 0.2s ease;
}

.poll-toggle-switch:hover {
    background: rgba(212, 175, 55, 0.15);
    transform: scale(1.05);
}

.poll-toggle-switch.active {
    background: rgba(212, 175, 55, 0.2);
}

.poll-toggle-switch.active::before {
    transform: scale(1.1);
}

/* Poll Creation Form */
.poll-creation-form {
    padding: 16px;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 12px;
    margin-bottom: 16px;
    border: 2px dashed rgba(212, 175, 55, 0.3);
    animation: slideDown 0.3s ease;
}

.light-theme .poll-creation-form {
    background: rgba(249, 250, 251, 0.5);
    border-color: rgba(212, 175, 55, 0.4);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.poll-question-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    background: rgba(31, 41, 55, 0.8);
    color: #f9fafb;
}

.light-theme .poll-question-input {
    background: white;
    color: #1f2937;
    border-color: rgba(212, 175, 55, 0.4);
}

.poll-question-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.poll-question-input::placeholder {
    color: #9ca3af;
}

.poll-options-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.poll-option-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.poll-option-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: rgba(31, 41, 55, 0.6);
    color: #f9fafb;
}

.light-theme .poll-option-input {
    background: white;
    color: #1f2937;
    border-color: rgba(212, 175, 55, 0.4);
}

.poll-option-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

.poll-option-input::placeholder {
    color: #9ca3af;
}

.poll-option-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.poll-remove-option {
    width: 28px;
    height: 28px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.poll-remove-option:hover {
    background: #dc2626;
    transform: rotate(90deg);
}

.poll-add-option {
    padding: 10px 16px;
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.poll-add-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.poll-add-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.poll-settings {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
}

.poll-duration-select {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: rgba(31, 41, 55, 0.6);
    color: #f9fafb;
    cursor: pointer;
}

.light-theme .poll-duration-select {
    background: white;
    color: #1f2937;
    border-color: rgba(212, 175, 55, 0.4);
}

.poll-duration-select:focus {
    outline: none;
    border-color: #d4af37;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .poll-container {
        padding: 16px;
        border-radius: 12px;
    }

    .poll-question {
        font-size: 15px;
    }

    .poll-option,
    .poll-option-result {
        padding: 12px 14px;
        font-size: 14px;
    }

    .poll-option-percentage {
        font-size: 15px;
    }

    .poll-footer {
        font-size: 12px;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .poll-creation-form {
        padding: 12px;
    }

    .poll-settings {
        flex-direction: column;
        gap: 10px;
    }
}

/* Accessibility */
.poll-option:focus-visible,
.poll-toggle-switch:focus-visible {
    outline: 3px solid #d4af37;
    outline-offset: 2px;
}

/* Loading State */
.poll-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.poll-loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid rgba(212, 175, 55, 0.2);
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
