/**
 * Poll Styles
 *
 * @package OutputLag
 * @since 1.0.0
 */

/* Olag's Weekly Poll Widget */
.olag-weekly-poll-widget {
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(138, 43, 226, 0.2);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
    position: relative;
    transition: all 0.3s ease;
}

.olag-weekly-poll-widget:hover {
    border-color: rgba(138, 43, 226, 0.4);
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.15);
}

/* Widget Header with Olag */
.poll-widget-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(138, 43, 226, 0.05);
    position: relative;
    overflow: hidden;
}

.poll-widget-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(138, 43, 226, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(30, 144, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    opacity: 0.5;
}

.poll-header-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    position: relative;
    z-index: 1;
}

/* Olag Avatar in Poll */
.poll-olag-avatar {
    flex-shrink: 0;
    position: relative;
}

.poll-olag-character {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid rgba(138, 43, 226, 0.5);
    box-shadow: 
        0 4px 16px rgba(138, 43, 226, 0.3),
        inset 0 0 20px rgba(138, 43, 226, 0.2);
    transition: all 0.3s ease;
    animation: olagFloat 3s ease-in-out infinite;
}

@keyframes olagFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.poll-status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(10, 10, 10, 0.9);
    padding: 2px;
    border-radius: 50%;
}

.poll-status-dot {
    display: block;
    width: 10px;
    height: 10px;
    background: var(--color-primary-green);
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

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

.poll-header-text {
    flex: 1;
}

.poll-widget-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #E8E8E8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.poll-widget-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: #A8A8A8;
}

.poll-widget {
    padding: 2rem;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
}

.poll-question {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #E8E8E8;
    text-align: center;
    line-height: 1.5;
    position: relative;
    padding: 0 1rem;
}

.poll-question::before,
.poll-question::after {
    content: '"';
    position: absolute;
    font-size: 2rem;
    color: rgba(138, 43, 226, 0.3);
    font-family: Georgia, serif;
}

.poll-question::before {
    top: -0.5rem;
    left: -0.5rem;
}

.poll-question::after {
    bottom: -0.5rem;
    right: -0.5rem;
}

.poll-ended-notice {
    text-align: center;
    color: var(--color-primary-accent);
    font-weight: 500;
    margin-bottom: var(--spacing-md);
}

/* Poll Form */
.poll-form {
    margin: 0;
}

.poll-options {
    margin-bottom: var(--spacing-lg);
}

.poll-option {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.poll-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(138, 43, 226, 0.15), transparent);
    transition: left 0.4s ease;
}

.poll-option:hover::before {
    left: 100%;
}

.poll-option:hover {
    background: rgba(138, 43, 226, 0.08);
    border-color: rgba(138, 43, 226, 0.4);
    transform: translateX(4px);
    box-shadow: 
        0 0 20px rgba(138, 43, 226, 0.2),
        inset 0 0 20px rgba(138, 43, 226, 0.05);
}

.poll-option.selected {
    background: rgba(138, 43, 226, 0.1);
    border-color: rgba(138, 43, 226, 0.5);
}

.poll-option-input {
    margin-right: var(--spacing-md);
    width: 22px;
    height: 22px;
    accent-color: var(--color-primary-accent);
    cursor: pointer;
    flex-shrink: 0;
}

.poll-option-input[type="radio"] {
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.poll-option-input[type="radio"]:checked {
    border-color: var(--color-primary-accent);
    background: var(--color-primary-accent);
}

.poll-option-input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.poll-option-input[type="checkbox"] {
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 6px;
    position: relative;
    transition: all 0.3s ease;
}

.poll-option-input[type="checkbox"]:checked {
    border-color: var(--color-primary-accent);
    background: var(--color-primary-accent);
}

.poll-option-input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.poll-option-label {
    flex: 1;
    color: var(--color-text-primary);
    font-size: var(--font-size-base);
    font-weight: 500;
    user-select: none;
}

/* Poll Buttons */
.poll-form-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.poll-submit-btn,
.poll-view-results-btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.poll-submit-btn {
    background: linear-gradient(135deg, #8A2BE2 0%, #1E90FF 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
    min-width: 120px;
}

.poll-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.poll-submit-btn:hover::before {
    transform: translateX(0);
}

.poll-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.4);
}

.poll-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.poll-view-results-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #A8A8A8;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.poll-view-results-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #E8E8E8;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Poll Results */
.poll-results {
    margin: var(--spacing-lg) 0;
}

.poll-result-item {
    margin-bottom: 1rem;
}

.poll-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.poll-result-option {
    font-weight: 500;
    color: #E8E8E8;
    font-size: 0.9375rem;
}

.poll-result-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.poll-result-percentage {
    font-weight: 700;
    color: #E8E8E8;
    min-width: 45px;
    text-align: right;
}

.poll-result-votes {
    color: #666;
    font-size: 0.8125rem;
}

.poll-result-bar {
    height: 24px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.poll-result-fill {
    height: 100%;
    background: linear-gradient(135deg, #8A2BE2 0%, #1E90FF 100%);
    border-radius: 12px;
    position: relative;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.75rem;
}

.poll-result-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: shimmer 3s infinite;
}

/* Winning option highlight */
.poll-result-item:first-child .poll-result-fill {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.poll-result-item:first-child .poll-result-percentage {
    color: #FFD700;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.poll-result-item:first-child .poll-result-option::after {
    content: '👑';
    margin-left: 0.5rem;
    font-size: 1rem;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Poll Messages */
.poll-message {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.poll-success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--color-primary-green);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.poll-error {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

/* Poll Meta */
.poll-total-votes {
    text-align: center;
    margin-top: var(--spacing-lg);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.poll-end-date {
    text-align: center;
    margin-top: var(--spacing-md);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.poll-login-notice {
    text-align: center;
    margin: var(--spacing-md) 0;
    color: var(--color-text-secondary);
}

.poll-login-notice a {
    color: var(--color-primary-blue);
    text-decoration: none;
}

.poll-login-notice a:hover {
    color: var(--color-primary-accent);
    text-decoration: underline;
}

/* No Poll Message */
.no-poll {
    text-align: center;
    color: var(--color-text-secondary);
    padding: var(--spacing-xl) 0;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .poll-widget {
        padding: var(--spacing-lg);
    }
    
    .poll-question {
        font-size: var(--font-size-lg);
    }
    
    .poll-submit-btn,
    .poll-view-results-btn {
        display: block;
        width: 100%;
        margin-bottom: var(--spacing-sm);
    }
}