/* TU Poll - Modern Card-Based Design */

:root {
    --poll-primary: #52B5CA;
    --poll-primary-hover: #449EAD;
    --poll-bg: #ffffff;
    --poll-border: #E5E7EB;
    --poll-text: #1F2937;
    --poll-text-muted: #6B7280;
    --poll-success: #10B981;
    --poll-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --poll-radius: 12px;
    --poll-transition: 0.3s ease;
}

/* Container */
.tu-poll {
    max-width: 500px;
    margin: 24px auto;
    background: var(--poll-bg);
    border-radius: var(--poll-radius);
    box-shadow: var(--poll-shadow);
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Question */
.tu-poll__question {
    font-size: 18px;
    font-weight: 600;
    color: var(--poll-text);
    margin: 0 0 20px 0;
    line-height: 1.4;
}

/* Voting View */
.tu-poll__voting {
    display: block;
}

.tu-poll__results {
    display: none;
}

.tu-poll--show-results .tu-poll__voting {
    display: none;
}

.tu-poll--show-results .tu-poll__results {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Options */
.tu-poll__options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.tu-poll__option {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border: 2px solid var(--poll-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--poll-transition);
    background: var(--poll-bg);
}

.tu-poll__option:hover {
    border-color: var(--poll-primary);
    background: rgba(79, 70, 229, 0.04);
}

.tu-poll__option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tu-poll__option-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--poll-border);
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all var(--poll-transition);
    position: relative;
}

.tu-poll__option-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 10px;
    height: 10px;
    background: var(--poll-primary);
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.tu-poll__option input[type="radio"]:checked + .tu-poll__option-radio {
    border-color: var(--poll-primary);
}

.tu-poll__option input[type="radio"]:checked + .tu-poll__option-radio::after {
    transform: translate(-50%, -50%) scale(1);
}

.tu-poll__option--selected {
    border-color: var(--poll-primary);
    background: rgba(79, 70, 229, 0.04);
}

.tu-poll__option-text {
    font-size: 15px;
    color: var(--poll-text);
    font-weight: 500;
}

/* Vote Button */
.tu-poll__vote-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--poll-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--poll-transition);
}

.tu-poll__vote-btn:hover {
    background: var(--poll-primary-hover);
    transform: translateY(-1px);
}

.tu-poll__vote-btn:active {
    transform: translateY(0);
}

/* View Results Link */
.tu-poll__view-results {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    background: none;
    border: none;
    color: var(--poll-text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: color var(--poll-transition);
}

.tu-poll__view-results:hover {
    color: var(--poll-primary);
}

/* Results View */
.tu-poll__results-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.tu-poll__result-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tu-poll__result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tu-poll__result-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--poll-text);
}

.tu-poll__result-item--winner .tu-poll__result-text {
    color: var(--poll-success);
}

.tu-poll__result-percent {
    font-size: 15px;
    font-weight: 600;
    color: var(--poll-text);
}

.tu-poll__result-item--winner .tu-poll__result-percent {
    color: var(--poll-success);
}

/* Progress Bar */
.tu-poll__progress-bar {
    height: 8px;
    background: var(--poll-border);
    border-radius: 4px;
    overflow: hidden;
}

.tu-poll__progress {
    height: 100%;
    background: var(--poll-primary);
    border-radius: 4px;
    width: 0;
    transition: width 0.6s ease-out;
}

.tu-poll__result-item--winner .tu-poll__progress {
    background: var(--poll-success);
}

.tu-poll--animate .tu-poll__progress {
    width: calc(var(--percent) * 1%);
}

.tu-poll__result-votes {
    font-size: 13px;
    color: var(--poll-text-muted);
}

/* Total */
.tu-poll__total {
    text-align: center;
    font-size: 14px;
    color: var(--poll-text-muted);
    padding: 12px 0;
    border-top: 1px solid var(--poll-border);
}

/* Back to Vote Button (shown when viewing results without voting) */
.tu-poll__back-to-vote {
    width: 100%;
    margin-top: 16px;
    padding: 14px 24px;
    background: var(--poll-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--poll-transition);
}

.tu-poll__back-to-vote:hover {
    background: var(--poll-primary-hover);
    transform: translateY(-1px);
}

/* Closed Poll Notice */
.tu-poll__closed-notice {
    text-align: center;
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--poll-border);
    color: var(--poll-text-muted);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 540px) {
    .tu-poll {
        margin: 16px;
        padding: 20px;
    }

    .tu-poll__question {
        font-size: 16px;
    }

    .tu-poll__option {
        padding: 12px 14px;
    }

    .tu-poll__option-text {
        font-size: 14px;
    }
}
