/* Simple Voting Public Styles */

.sv-voting-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.sv-poll-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.sv-poll-title {
    margin: 0 0 10px;
    font-size: 24px;
    color: #333;
}

.sv-poll-description {
    margin: 0 0 10px;
    color: #666;
    font-size: 14px;
}

.sv-poll-info {
    margin: 0;
    color: #888;
    font-size: 13px;
}

/* Countdown Timer */
.sv-countdown-wrapper {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.sv-countdown-wrapper[data-status="not_started"] {
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border-color: #ffc107;
}

.sv-countdown-wrapper[data-status="ended"] {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-color: #dc3545;
}

.sv-countdown-label {
    margin: 0 0 15px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sv-countdown-wrapper[data-status="not_started"] .sv-countdown-label {
    color: #856404;
}

.sv-countdown-wrapper[data-status="ended"] .sv-countdown-label {
    color: #721c24;
    margin-bottom: 0;
}

.sv-countdown-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.sv-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.sv-countdown-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #007cba;
    line-height: 1;
    background: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sv-countdown-wrapper[data-status="not_started"] .sv-countdown-value {
    color: #856404;
}

.sv-countdown-unit {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sv-countdown-separator {
    font-size: 28px;
    font-weight: 700;
    color: #adb5bd;
    margin: 0 5px;
    align-self: flex-start;
    margin-top: 10px;
}

@media (max-width: 500px) {
    .sv-countdown-item {
        min-width: 50px;
    }

    .sv-countdown-value {
        font-size: 24px;
        padding: 8px 10px;
    }

    .sv-countdown-separator {
        font-size: 20px;
        margin: 0 2px;
    }

    .sv-countdown-unit {
        font-size: 9px;
    }
}

/* Voting disabled state */
.sv-voting-disabled .sv-voter-section {
    opacity: 0.5;
    pointer-events: none;
}

.sv-voting-disabled .sv-options-grid {
    opacity: 0.6;
}

.sv-voting-disabled .sv-vote-btn {
    background: #6c757d !important;
    cursor: not-allowed;
}

/* Voter info form */
.sv-voter-section {
    margin-bottom: 30px;
}

.sv-voter-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 600px) {
    .sv-voter-info {
        grid-template-columns: 1fr;
    }
}

.sv-form-group {
    display: flex;
    flex-direction: column;
}

.sv-form-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.sv-form-group label .required {
    color: #dc3545;
}

.sv-input {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sv-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Options Grid - Card Layout */
.sv-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

@media (max-width: 500px) {
    .sv-options-grid {
        grid-template-columns: 1fr;
    }
}

/* Option Card */
.sv-option-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sv-option-card:hover {
    border-color: #007cba;
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.15);
}

.sv-card-image {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
    background: #f5f5f5;
}

.sv-card-image img {
    width: 100%;
    height: auto;
    display: block;
}

.sv-card-content {
    padding: 15px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    box-sizing: border-box;
}

.sv-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.sv-vote-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #007cba, #00a0d2);
    color: #fff;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
    margin-top: auto;
}

.sv-vote-btn:hover {
    background: linear-gradient(135deg, #005a87, #007cba);
}

.sv-vote-btn:active {
    transform: scale(0.98);
}

.sv-vote-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Text-only options styling */
.sv-options-text .sv-option-card {
    flex-direction: row;
    align-items: center;
}

.sv-options-text .sv-card-content {
    flex: 1;
    justify-content: flex-start;
    padding: 20px;
}

.sv-options-text .sv-vote-btn {
    width: auto;
    padding: 14px 30px;
    border-radius: 0 12px 12px 0;
}

/* Image Zoom Button */
.sv-zoom-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 5;
}

.sv-zoom-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}

.sv-zoom-text {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sv-zoom-btn:hover .sv-zoom-text {
    opacity: 1;
}

/* Messages */
.sv-message {
    margin-top: 15px;
    margin-bottom: 20px;
    padding: 12px 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.sv-message.sv-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.sv-message.sv-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Success message */
.sv-success-message {
    text-align: center;
    padding: 40px 20px;
}

.sv-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
    border-radius: 50%;
    font-size: 40px;
    line-height: 80px;
}

.sv-success-message h4 {
    margin: 0 0 10px;
    font-size: 22px;
    color: #333;
}

.sv-success-message p {
    margin: 0 0 20px;
    color: #666;
}

.sv-continue-btn {
    display: inline-block;
    padding: 12px 30px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.sv-continue-btn:hover {
    background: #005a87;
}

/* Error message for shortcode */
.sv-error {
    padding: 15px 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    text-align: center;
}

/* Confirmation Modal */
.sv-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sv-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.sv-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    z-index: 1;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sv-modal-title {
    margin: 0 0 10px;
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

.sv-modal-option-name {
    margin: 0 0 5px;
    font-size: 24px;
    font-weight: 700;
    color: #007cba;
}

.sv-modal-category {
    margin: 0 0 20px;
    font-size: 14px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sv-modal-remaining {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 25px;
}

.sv-modal-remaining span {
    display: block;
    font-size: 13px;
    color: #666;
}

.sv-remaining-count {
    display: block;
    font-size: 28px;
    color: #007cba;
    margin: 5px 0;
}

/* Vote Quantity Buttons */
.sv-vote-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.sv-vote-qty-btn {
    flex: 1;
    min-width: 80px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #007cba, #00a0d2);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.sv-vote-qty-btn:hover {
    background: linear-gradient(135deg, #005a87, #007cba);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

.sv-vote-qty-btn:active {
    transform: translateY(0);
}

.sv-vote-qty-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Cancel Button */
.sv-modal-cancel {
    display: block;
    width: 100%;
    padding: 12px;
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sv-modal-cancel:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

body.sv-modal-open {
    overflow: hidden;
}

/* Lightbox Modal */
.sv-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sv-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.sv-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 1;
    text-align: center;
}

.sv-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    background: transparent;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    aspect-ratio: 1 / 1;
}

.sv-lightbox-close:hover {
    background: #fff;
    color: #000;
}

.sv-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.sv-lightbox-title {
    margin: 15px 0 0;
    color: #fff;
    font-size: 16px;
}

body.sv-lightbox-open {
    overflow: hidden;
}

/* Textarea styling */
textarea.sv-input {
    min-height: 80px;
    resize: vertical;
}

/* Select styling */
select.sv-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

/* Loading state */
.sv-voting-container.sv-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Pagination */
.sv-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding: 20px 0;
    flex-wrap: wrap;
}

.sv-page-btn {
    padding: 10px 20px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
}

.sv-page-btn:hover:not(:disabled) {
    background: #007cba;
    border-color: #007cba;
    color: #fff;
}

.sv-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sv-page-numbers {
    display: flex;
    gap: 5px;
}

.sv-page-num {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
}

.sv-page-num:hover {
    background: #e0e0e0;
}

.sv-page-num.active {
    background: #007cba;
    border-color: #007cba;
    color: #fff;
}

.sv-page-info {
    margin-left: 15px;
    font-size: 14px;
    color: #666;
}

/* Hidden option for pagination */
.sv-option-card.sv-option-hidden {
    display: none;
}

@media (max-width: 600px) {
    .sv-pagination {
        flex-direction: column;
        gap: 15px;
    }

    .sv-page-numbers {
        order: -1;
    }

    .sv-page-info {
        margin-left: 0;
    }
}

/* Results Display - Frontend */
.sv-results-frontend {
    max-width: 800px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.sv-results-frontend .sv-results-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.sv-results-title {
    margin: 0 0 10px;
    font-size: 24px;
    color: #333;
}

.sv-results-description {
    margin: 0 0 10px;
    color: #666;
    font-size: 14px;
}

.sv-results-total {
    margin: 0;
    font-size: 16px;
    color: #007cba;
}

.sv-results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sv-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.2s;
}

.sv-result-item:hover {
    background: #e9ecef;
}

.sv-result-winner {
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border: 2px solid #ffc107;
}

.sv-result-winner:hover {
    background: linear-gradient(135deg, #ffeeba, #ffe066);
}

.sv-result-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.sv-rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #7a5c00;
}

.sv-rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #4a4a4a;
}

.sv-rank-3 {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: #fff;
}

.sv-result-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.sv-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sv-result-content {
    flex: 1;
    min-width: 0;
}

.sv-result-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.sv-result-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.sv-result-stats {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.sv-result-votes {
    color: #007cba;
    font-weight: 600;
}

.sv-result-percentage {
    color: #666;
}

.sv-result-bar-wrapper {
    width: 100%;
    height: 8px;
    background: #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}

.sv-result-bar {
    height: 100%;
    background: linear-gradient(90deg, #007cba, #00a0d2);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.sv-result-winner .sv-result-bar {
    background: linear-gradient(90deg, #ffc107, #ffca2c);
}

.sv-results-shortcode-hint {
    margin: 20px 0 0;
    text-align: center;
    color: #999;
}

.sv-results-shortcode-hint code {
    background: #f1f1f1;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Results with images layout */
.sv-results-with-images .sv-result-item {
    padding: 20px;
}

@media (max-width: 600px) {
    .sv-results-frontend {
        padding: 20px;
        margin: 10px;
    }

    .sv-result-item {
        flex-wrap: wrap;
    }

    .sv-result-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .sv-result-image {
        width: 50px;
        height: 50px;
    }
}
