/* Global Font */
.dlta-polls-modal,
.dlta-polls-modal *,
.dlta-polls-shortcode,
.dlta-polls-shortcode *,
.dlta-front-poll-item,
.dlta-front-poll-item * {
    font-family: 'bodyfont', sans-serif;
}

/* Block body scroll when modal is open */
body.dlta-polls-modal-open {
    overflow: hidden;
}

/* Polls Modal Styles */
.dlta-polls-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    animation: dlta-polls-fade-in 0.4s ease-out;
}

.dlta-polls-modal {
    background: #ffffff;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
    animation: dlta-polls-slide-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: none;
}

.dlta-polls-modal-header {
    padding: 30px 30px 20px 30px;
    background: #ffffff;
    color: #2c3e50;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border: none;
    position: relative;
}

.dlta-polls-modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-family: 'bodyfont', sans-serif;
    font-weight: 600;
    font-size: 20px;
    line-height: 1.5;
    padding-right: 0;
}

.dlta-polls-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #94a3b8;
    flex-shrink: 0;
}

.dlta-polls-modal-close:hover {
    background: #f1f5f9;
    color: #64748b;
    transform: scale(1.1);
}

.dlta-polls-modal-close svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.dlta-polls-modal-body {
    padding: 0 30px 30px 30px;
}

/* Question Image */
.dlta-polls-question-image {
    text-align: center;
    margin-bottom: 30px;
}

.dlta-polls-question-image img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
}

/* Voted Message */
.dlta-polls-voted-message {
    background: linear-gradient(135deg, #d84040 0%, #c73535 100%);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 14px;
}

/* Poll Description/Explanation */
.dlta-polls-description {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    padding: 20px;
    margin-top: 25px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.dlta-polls-description.dlta-polls-description-show {
    opacity: 1;
    transform: translateY(0);
}

.dlta-polls-description-immediate {
    background: #fdfdfd;
    border: 2px solid #d1d1d1;
    animation: dlta-polls-description-appear 0.6s ease-out;
}

@keyframes dlta-polls-description-appear {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    50% {
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Confetti Animation */
@keyframes dlta-confetti-fall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: translateY(50vh) rotate(180deg);
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.dlta-polls-description-title {
    font-weight: 700;
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dlta-polls-description-title::before {
    content: "💡";
    font-size: 18px;
}

.dlta-polls-description-text {
    color: #4a5568;
    line-height: 1.6;
    font-size: 15px;
    margin: 0;
}

.dlta-polls-description-image {
    margin-top: 15px;
    text-align: center;
}

.dlta-polls-description-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* Options Container */
.dlta-polls-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Individual Option */
.dlta-polls-option {
    background: #f8fafc;
    border: none;
    border-radius: 15px;
    padding: 18px 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
}

.dlta-polls-option:hover:not(.dlta-polls-option-voted) {
    background: #f1f5f9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.dlta-polls-option-voted {
    cursor: default;
}

.dlta-polls-option-content {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dlta-polls-option-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.dlta-polls-option-radio {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background: #ffffff;
    cursor: pointer;
}

.dlta-polls-option-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s ease;
}

.dlta-polls-option-voted.dlta-polls-option-correct .dlta-polls-option-radio {
    border-color: #10b981;
    background: #ffffff;
}

.dlta-polls-option-voted.dlta-polls-option-correct .dlta-polls-option-radio::after {
    transform: translate(-50%, -50%) scale(1);
    background: #10b981;
}

.dlta-polls-option-voted.dlta-polls-option-incorrect .dlta-polls-option-radio {
    border-color: #ef4444;
    background: #ffffff;
}

.dlta-polls-option-voted.dlta-polls-option-incorrect .dlta-polls-option-radio::after {
    transform: translate(-50%, -50%) scale(1);
    background: #ef4444;
}

.dlta-polls-option-voted.dlta-polls-option-other .dlta-polls-option-radio {
    border-color: #94a3b8;
    background: #ffffff;
}

.dlta-polls-option-voted.dlta-polls-option-other .dlta-polls-option-radio::after {
    transform: translate(-50%, -50%) scale(1);
    background: #94a3b8;
}

.dlta-polls-option-text {
    margin: 0;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    color: #1e293b;
    flex: 1;
}

.dlta-polls-option-percentage {
    font-weight: 700;
    font-size: 16px;
    color: #64748b;
    min-width: 50px;
    text-align: left;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.dlta-polls-option-voted.dlta-polls-option-correct .dlta-polls-option-percentage {
    color: #10b981;
}

.dlta-polls-option-voted.dlta-polls-option-incorrect .dlta-polls-option-percentage {
    color: #ef4444;
}

/* Progress Background Fill */
.dlta-polls-option-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 15px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
    z-index: 1;
    width: 0%;
}

.dlta-polls-option-voted.dlta-polls-option-correct .dlta-polls-option-fill {
    background: rgba(16, 185, 129, 0.1);
}

.dlta-polls-option-voted.dlta-polls-option-incorrect .dlta-polls-option-fill {
    background: rgba(239, 68, 68, 0.1);
}

.dlta-polls-option-voted.dlta-polls-option-other .dlta-polls-option-fill {
    background: rgba(148, 163, 184, 0.1);
}

/* Loader */
.dlta-polls-loader {
    text-align: center;
    padding: 40px 20px;
}

.dlta-polls-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1d1616;
    border-radius: 50%;
    animation: dlta-polls-spin 1s linear infinite;
    margin: 0 auto 20px;
}

.dlta-polls-loader p {
    color: #666666;
    font-size: 16px;
    margin: 0;
}

/* Error Modal */
.dlta-polls-modal-error .dlta-polls-modal-header {
    background: #ffffff;
    color: #dc3545;
}

.dlta-polls-modal-error .dlta-polls-modal-body {
    text-align: center;
    color: #dc3545;
    font-weight: 500;
    padding: 30px;
}

/* No Options */
.dlta-polls-no-options {
    text-align: center;
    color: #666666;
    font-style: italic;
    padding: 40px 20px;
}

/* Animations */
@keyframes dlta-polls-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes dlta-polls-slide-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes dlta-polls-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Voting States */
.dlta-polls-option-voting {
    opacity: 0.7;
    cursor: wait !important;
    position: relative;
}

.dlta-polls-option-voting::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 20px;
    width: 16px;
    height: 16px;
    border: 2px solid #e0e7ff;
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: dlta-polls-spin 0.8s linear infinite;
    transform: translateY(-50%);
}

/* Progressive Loading States */
.dlta-polls-option-selected {
    background: #f5f5f5 !important;
}

.dlta-polls-option-loading .dlta-polls-option-fill {
    background: linear-gradient(90deg, #c9ace7 0%, #b794e0 50%, #a47bd9 100%) !important;
    transition: width 2s ease-out !important;
    animation: dlta-polls-shimmer 1.5s ease-in-out infinite;
}

/* Hide all percentages during loading */
.dlta-polls-option.dlta-polls-option-voted .dlta-polls-option-percentage {
    opacity: 0;
    transition: opacity 0.3s ease;
}

@keyframes dlta-polls-shimmer {
    0% {
        opacity: 0.8;
        background: linear-gradient(90deg, #c9ace7 0%, #b794e0 50%, #a47bd9 100%);
    }
    50% {
        opacity: 1;
        background: linear-gradient(90deg, #b794e0 0%, #a47bd9 50%, #c9ace7 100%);
    }
    100% {
        opacity: 0.8;
        background: linear-gradient(90deg, #c9ace7 0%, #b794e0 50%, #a47bd9 100%);
    }
}

/* Click Feedback Animation */
.dlta-polls-option-clicked {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

@keyframes dlta-polls-spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Load More Button */
.dlta-polls-load-more-container {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
}

.dlta-polls-load-more-btn {
    background: white;
    border: 1px solid #eee;
    border-radius: 15px;
    padding: 12px 30px;
    font-family: 'bodyfont', Tahoma, Arial, sans-serif;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    min-width: 120px;
}

.dlta-polls-load-more-btn:hover {
    background: #f8f9fa;
    border-color: #ddd;
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dlta-polls-load-more-btn:disabled,
.dlta-polls-load-more-btn.dlta-polls-loading {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.dlta-polls-load-more-btn.dlta-polls-error {
    background: #fee;
    border-color: #faa;
    color: #c33;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dlta-polls-modal {
        width: 95%;
        max-height: 90vh;
        border-radius: 20px;
    }
    
    .dlta-polls-modal-header {
        padding: 24px 20px 16px 20px;
        border-radius: 20px 20px 0 0;
    }
    
    .dlta-polls-modal-header h3 {
        font-size: 18px;
        padding-right: 0;
    }
    
    .dlta-polls-modal-body {
        padding: 0 20px 24px 20px;
    }
    
    .dlta-polls-option {
        padding: 16px 18px;
    }
    
    .dlta-polls-option-left {
        gap: 12px;
    }
    
    .dlta-polls-option-text {
        font-size: 15px;
    }
    
    .dlta-polls-option-percentage {
        font-size: 15px;
        min-width: 45px;
    }
    
    .dlta-polls-question-image {
        margin-bottom: 24px;
    }
}

/* Scrollbar Styling */
.dlta-polls-modal {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 transparent;
    overflow-y: auto;
}

.dlta-polls-modal::-webkit-scrollbar {
    width: 6px;
}

.dlta-polls-modal::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 20px;
}

.dlta-polls-modal::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
    border: 1px solid transparent;
    background-clip: content-box;
}

.dlta-polls-modal::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
    background-clip: content-box;
}

/* Polls Shortcode Styles */
.dlta-polls-shortcode {
    margin: 0;
}

.dlta-polls-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.dlta-front-poll-item {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dlta-front-poll-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dlta-front-poll-item[data-category="all"]:hover {
    border-color: #64748b;
}

.dlta-front-poll-item[data-category="grade10"]:hover {
    border-color: #953F3E;
}

.dlta-front-poll-item[data-category="grade11"]:hover {
    border-color: #3C543C;
}

.dlta-front-poll-item[data-category="grade12"]:hover {
    border-color: #41255F;
}

.dlta-poll-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.dlta-quiz-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dlta-quiz-badge-all {
    background: #f1f5f9;
    color: #64748b;
}

.dlta-quiz-badge-grade10 {
    background: #E6C7C6 !important;
    color: #953F3E !important;
}

.dlta-quiz-badge-grade11 {
    background: #BCE2AF !important;
    color: #3C543C !important;
}

.dlta-quiz-badge-grade12 {
    background: #C9ACE7 !important;
    color: #41255F !important;
}

.dlta-poll-attempts {
    font-size: 14px;
    color: #666666;
    font-weight: 500;
}



.dlta-poll-question {
    color: #666666;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* No Polls Message */
.dlta-no-polls {
    text-align: center;
    padding: 60px 20px;
    color: #666666;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px dashed #dee2e6;
}

/* Responsive Design for Shortcode */
@media (max-width: 768px) {
    .dlta-polls-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dlta-front-poll-item {
        padding: 20px;
    }
    

    
    .dlta-poll-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 8px;
        display: flex;
        justify-content: space-between;
    }
}