/**
 * ATH Polls - Main Frontend Styles
 */

/* Container */
.ath-polls-container {
    margin: 30px auto;
    padding: 25px;
    border: none;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background-color: #292c35;
    transition: all 0.3s ease;
    width: 60%;
    max-width: 800px;
    position: relative;
}

/* Make the polls responsive */
@media (max-width: 768px) {
    .ath-polls-container {
        width: 95%;
        padding: 20px;
        margin: 20px auto;
    }
}

.ath-polls-container:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

/* Poll image */
.ath-polls-image,
.ath-polls-video {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.ath-polls-image img,
.ath-polls-video video {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}

/* Question */
.ath-polls-question h3 {
    font-size: 22px;
    margin: 0 0 25px 0;
    padding: 0;
    font-weight: 600;
    line-height: 1.4;
    color: inherit !important;
}

/* Options */
.ath-polls-option {
    margin-bottom: 15px;
    padding: 12px 15px;
    transition: background-color 0.3s, transform 0.2s;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
}

.ath-polls-option:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Alignment-specific margin styling */
/* For left alignment in LTR mode */
[dir="ltr"] .ath-polls-container[style*="text-align: left"] .ath-polls-option label,
html:not([dir="rtl"]) .ath-polls-container[style*="text-align: left"] .ath-polls-option label {
    margin-left: 12px;
    margin-right: 0;
}

/* For right alignment in RTL mode */
[dir="rtl"] .ath-polls-container[style*="text-align: right"] .ath-polls-option label,
html[dir="rtl"] .ath-polls-container[style*="text-align: right"] .ath-polls-option label {
    margin-left: 0;
    margin-right: 12px;
}

/* Centered alignment should have equal margins */
.ath-polls-container[style*="text-align: center"] .ath-polls-option label {
    margin-left: auto;
    margin-right: auto;
}

/* Default option label styling */
.ath-polls-option label {
    display: inline-block;
    cursor: pointer;
    font-size: 18px;
    flex: 1;
    /* No default margins here */
}

.ath-polls-option input[type="radio"],
.ath-polls-option input[type="checkbox"] {
    vertical-align: middle;
    margin-top: -2px;
    width: 20px;
    height: 20px;
    accent-color: #4C8BF5;
}

/* Text response */
.ath-polls-option-text textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 16px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    min-height: 100px;
}

.ath-polls-option-text textarea:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    outline: none;
}

/* Rating scale */
.ath-polls-rating {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.ath-polls-rating-option {
    text-align: center;
}

.ath-polls-rating-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ath-polls-rating-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 18px;
    margin: 0;
}

.ath-polls-rating-option input[type="radio"]:checked + label {
    background-color: #4C8BF5;
    color: #fff;
    border-color: #4C8BF5;
    transform: scale(1.1);
}

.ath-polls-rating-option:hover label {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Submit button */
.ath-polls-submit {
    margin-top: 25px;
    text-align: center;
}

.ath-polls-vote-button {
    padding: 12px 30px;
    background-color: #4C8BF5;
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 150px;
}

.ath-polls-vote-button:hover {
    background-color: #3A78E7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 139, 245, 0.3);
}

.ath-polls-vote-button:disabled {
    background-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Results */
.ath-polls-results {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ath-polls-results h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    color: inherit !important;
}

.ath-polls-result-item {
    margin-bottom: 20px;
}

.ath-polls-results-bar {
    height: 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    margin-bottom: 10px;
    overflow: hidden;
}

.ath-polls-results-fill {
    height: 100%;
    background-color: #4C8BF5;
    background-image: linear-gradient(to right, #4C8BF5, #6A5AE0);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: #fff;
    transition: width 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-width: 30px;
    text-align: right;
    font-size: 0;
    border-radius: 30px;
}

.ath-polls-results-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 16px;
    align-items: center;
    color: inherit;
}

.ath-polls-results-text {
    font-weight: 500;
    color: inherit;
}

.ath-polls-results-percentage {
    font-weight: 600;
    color: #4C8BF5;
    font-size: 16px;
}

/* Total votes */
.ath-polls-total-votes {
    margin-top: 25px;
    font-size: 14px;
    color: inherit;
    opacity: 0.7;
    text-align: center;
}

/* Messages */
.ath-polls-message {
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.2);
    text-align: center;
    font-weight: 500;
}

.ath-polls-message.error {
    background-color: rgba(220, 53, 69, 0.2);
    color: #ff6b6b;
}

.ath-polls-message.success {
    background-color: rgba(40, 167, 69, 0.2);
    color: #51cf66;
}

.ath-polls-message.info {
    background-color: rgba(23, 162, 184, 0.2);
    color: #66d9e8;
}

/* Loading indicator */
.ath-polls-loading {
    text-align: center;
    color: inherit;
    opacity: 0.7;
    margin: 15px 0;
    font-size: 14px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ath-polls-results-container {
    animation: fadeIn 0.5s ease-out;
}

/* Privacy notice */
.ath-polls-privacy-notice {
    margin-top: 25px;
    font-size: 12px;
    color: inherit;
    opacity: 0.5;
    text-align: center;
}

/* RTL support */
[dir="rtl"] .ath-polls-results-fill {
    justify-content: flex-start;
    padding-right: 0;
    padding-left: 10px;
}

[dir="rtl"] .ath-polls-total-votes {
    text-align: center;
}

.ath-polls-results-label.rtl {
    flex-direction: row-reverse;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .ath-polls-container {
        padding: 20px;
        width: 95%;
    }
    
    .ath-polls-question h3 {
        font-size: 18px;
        margin-bottom: 20px;
        color: inherit !important;
    }
    
    .ath-polls-option {
        padding: 10px;
    }
    
    .ath-polls-option label {
        font-size: 15px;
    }
    
    .ath-polls-rating {
        gap: 5px;
    }
    
    .ath-polls-rating-option label {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .ath-polls-vote-button {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 120px;
    }
    
    .ath-polls-results-label,
    .ath-polls-results-percentage {
        font-size: 14px;
    }
}

/* Multiple Polls Navigation */
.ath-polls-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.ath-polls-nav button {
    padding: 8px 16px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.ath-polls-nav button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ath-polls-counter {
    font-size: 16px;
    font-weight: bold;
}

.ath-polls-item {
    margin-bottom: 0;
    padding: 10px 0;
}

/* Multi-polls specific styling */
/* Left alignment in LTR mode */
.ath-polls-multi-container[style*="text-align: left"] .ath-polls-option label,
.ath-polls-multi-container[dir="ltr"][style*="text-align: left"] .ath-polls-option label {
    margin-left: 12px;
    margin-right: 0;
}

/* Right alignment in RTL mode */
.ath-polls-multi-container[dir="rtl"][style*="text-align: right"] .ath-polls-option label {
    margin-left: 0;
    margin-right: 12px;
}

/* Center alignment for both RTL and LTR */
.ath-polls-multi-container[style*="text-align: center"] .ath-polls-option label {
    margin-left: auto;
    margin-right: auto;
}

/* Support for alignment classes as well */
.ath-polls-container.alignleft .ath-polls-option label,
.ath-polls-container.align-left .ath-polls-option label,
.ath-polls-container.text-left .ath-polls-option label {
    margin-left: 12px;
    margin-right: 0;
}

[dir="rtl"] .ath-polls-container.alignright .ath-polls-option label,
[dir="rtl"] .ath-polls-container.align-right .ath-polls-option label,
[dir="rtl"] .ath-polls-container.text-right .ath-polls-option label {
    margin-left: 0;
    margin-right: 12px;
}

.ath-polls-container.aligncenter .ath-polls-option label,
.ath-polls-container.align-center .ath-polls-option label,
.ath-polls-container.text-center .ath-polls-option label {
    margin-left: auto;
    margin-right: auto;
} 