/* Add these CSS variables at the top of your frontend.css file */
:root {
    --poll-bg-color: #ffffff;
    --poll-text-color: #222222;
    --poll-border-color: #f0f0f0;
    --poll-option-bg: #fcfcfc;
    --poll-option-hover-bg: #f7f9fc;
    --poll-option-border: #eaeaea;
    --poll-header-border: #f5f5f5;
    --poll-total-border: #f5f5f5;
    --poll-link-color: #0a0a0a;
    --poll-link-hover-color: #1d7a84;
    --poll-progress-bg: #f0f0f5;
    --poll-percentage-color: #ffffff;
    --poll-icon-color: #d0d5dd;
    --poll-icon-hover-color: #2597a4;
}

/* WP Poll OmniStack Frontend Styles */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700&display=swap');

/* Dark mode media query */

.os-poll.dark-mode-enabled {
    --poll-bg-color: var(--dark-mode-bg, #222222);
    --poll-text-color: var(--dark-mode-text, #ffffff);
    --poll-border-color: #333333;
    --poll-option-bg: var(--dark-mode-option-bg, #333333);
    --poll-option-hover-bg: var(--dark-mode-option-hover, #444444);
    --poll-option-border: #444444;
    --poll-header-border: #333333;
    --poll-total-border: #333333;
    --poll-link-color: var(--dark-mode-link, #ffffff);
    --poll-link-hover-color: var(--dark-mode-link-hover, #2597a4);
    --poll-progress-bg: var(--dark-mode-progress-bg, #444444);
    --poll-percentage-color: var(--dark-mode-percentage-color, #ffffff);
    --poll-icon-color: var(--dark-mode-icon-color, #ffffff);
    --poll-icon-hover-color: var(--dark-mode-icon-hover-color, #2597a4);
    }


.os-poll {
    margin: 24px 0;
    padding: 15px!important;
    background: var(--poll-bg-color);
    color: var(--poll-text-color);
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    font-family: 'Manrope', sans-serif;
    max-width: 600px;
    border: 1px solid var(--poll-border-color);
}

.os-poll .poll-header {
    margin-bottom: 22px;
    border-bottom: 1px solid var(--poll-header-border);
    padding-bottom: 16px;
}

.os-poll .poll-title {
    margin: 0 0 5px 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--poll-text-color);
    font-family: 'Manrope', sans-serif;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.os-poll .poll-description {
    margin: 0;
    color: var(--poll-text-color);
    opacity: 0.8;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 400;
}

/* Options Styles */
.poll-option {
    margin-bottom: 14px;
}

.poll-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 14px;
    border-radius: 10px;
    transition: all 0.2s ease;
    border: 1px solid var(--poll-option-border);
    background-color: var(--poll-option-bg);
}

.poll-option label:hover {
    background-color: var(--poll-option-hover-bg);
    border-color: var(--poll-option-border);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.poll-option input[type="radio"] {
    margin-right: 14px;
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #d0d5dd;
    border-radius: 50%;
    outline: none;
    position: relative;
    padding: 10px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.poll-option input[type="radio"]:checked {
    border-color: #2597a4;
    border-width: 2px;
}

.poll-option input[type="radio"]:checked:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-color: #2597a4;
    border-radius: 50%;
}

.poll-option input[type="radio"]:hover {
    border-color: #a9ced5;
}

.poll-option span {
    font-size: 16px;
    font-weight: 500;
    color: var(--poll-text-color);
}

/* Action Buttons */
.poll-actions {
    margin-top: 24px;
    display: flex;
    align-items: center;
}

.vote-button {
    padding: 12px 24px;
    background-color: #0a0a0a; /* Default, can be overridden */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Manrope', sans-serif;
    box-shadow: 0 2px 5px rgba(37, 151, 164, 0.2);
}

.vote-button:hover {
    background-color: #1d7a84; /* Default, can be overridden */
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 151, 164, 0.3);
}

.vote-button:active {
    transform: translateY(0);
}

/* Action Buttons */
.view-results-link,
.back-to-vote-link {
    color: var(--poll-link-color);
    text-decoration: none;
    font-size: 14px;
    margin-left: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid transparent;
}

.view-results-link .dashicons,
.back-to-vote-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    color: var(--poll-icon-color);
    transition: all 0.3s ease;
}

.view-results-link:hover,
.back-to-vote-link:hover {
    color: var(--poll-link-hover-color);
    text-decoration: none;
    border-bottom-color: var(--poll-link-hover-color);
}

.view-results-link:hover .dashicons,
.back-to-vote-link:hover .dashicons {
    color: var(--poll-icon-hover-color);
}

/* Results styles */
.poll-results {
    margin-top: 20px;
}

.poll-result-item {
    margin-bottom: 18px;
}

.poll-option-text {
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.vote-count {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* Results styles */
.poll-bar-container {
    background-color: var(--poll-progress-bg);
    height: 24px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.poll-bar {
    height: 100%;
    border-radius: 12px;
    position: relative;
    transition: width 1s ease-in-out;
}

/* Animation styles */
.poll-bar[data-animation="fade"] {
    transition: width 1s ease-in-out, opacity 1s;
    opacity: 0.9;
}

.poll-bar[data-animation="fade"]:hover {
    opacity: 1;
}

.poll-bar[data-animation="slide"] {
    transition: width 1.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.poll-bar[data-animation="pulse"] {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.8;
    }
}

.poll-bar[data-animation="bounce"] {
    animation: bounce-animation 1s 1;
}

@keyframes bounce-animation {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-1px);
    }
}

.poll-percentage {
    position: absolute;
    right: 12px;
    top: 0;
    line-height: 24px;
    color: var(--poll-percentage-color);
    font-weight: 700;
    font-size: 12px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.poll-total {
    margin-top: 16px;
    font-size: 14px;
    color: var(--poll-text-color);
    opacity: 0.8;
    font-weight: 500;
    text-align: right;
    padding-top: 10px;
    border-top: 1px solid var(--poll-total-border);
}

/* Responsive styles */
@media screen and (max-width: 600px) {
    .os-poll {
        margin: 20px 0;
        border-radius: 12px;
    }
    
    .os-poll .poll-title {
        font-size: 20px;
    }
    
    .poll-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .vote-button {
        margin-bottom: 12px;
        width: 100%;
    }
    
    .view-results-link,
    .back-to-vote-link {
        margin-left: 0;
    }
}

/* Custom checkboxes for admin */
.os-checkbox-container {
    display: flex;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    align-items: center;
}

.os-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.os-checkmark {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    height: 18px;
    width: 18px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.os-checkbox-container:hover input ~ .os-checkmark {
    border-color: #ccc;
    background-color: #f9f9f9;
}

.os-checkbox-container input:checked ~ .os-checkmark {
    background-color: #2597a4;
    border-color: #2597a4;
}

.os-checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.os-checkbox-container input:checked ~ .os-checkmark:after {
    display: block;
}

.os-checkbox-container .os-checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}