/* Smart Quiz Engine - Professional Design v2.0 */
.sqe-quiz {
    max-width: 800px;
    width: 100%;
    margin: 40px auto;
    padding: 0;
    background: linear-gradient(145deg, #0a1628 0%, #0d1b33 100%);
    border-radius: 24px;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 
                0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

/* Header Section */
.sqe-header {
    text-align: center;
    padding: 40px 40px 30px;
    background: linear-gradient(180deg, rgba(30, 64, 175, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sqe-header h2 {
    margin: 0 0 24px 0;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sqe-progress {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
}

.sqe-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1e40af);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.sqe-count {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Question Body */
.sqe-body {
    padding: 30px 40px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.sqe-question {
    animation: fadeInUp 0.5s ease;
}

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

.sqe-text {
    font-size: 28px;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 24px;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: -0.3px;
}

/* Blanks */
.sqe-blank {
    display: inline-block;
    min-width: 120px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    margin: 0 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.sqe-blank.filled {
    background: rgba(59, 130, 246, 0.15);
    border: 2px solid #3b82f6;
    color: #60a5fa;
    font-weight: 600;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    animation: fillIn 0.3s ease;
}

@keyframes fillIn {
    0% {
        transform: scale(0.9);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Choice Buttons */
.sqe-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    max-width: 700px;
    margin: 0 auto;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.sqe-choices.hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0;
}

.sqe-choice {
    padding: 16px 28px !important;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%) !important;
    color: #ffffff !important;
    border: 2px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 14px !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
    position: relative;
    overflow: hidden;
}

.sqe-choice::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.sqe-choice:hover:not(:disabled)::before {
    left: 100%;
}

.sqe-choice:hover:not(:disabled) {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.5) !important;
    border-color: rgba(96, 165, 250, 0.5) !important;
}

.sqe-choice:active:not(:disabled) {
    transform: translateY(-1px) !important;
}

.sqe-choice:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
}

/* Multiple Choice Selected State */
.sqe-choice.selected {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%) !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5) !important;
}

/* Feedback Messages */
.sqe-feedback {
    margin-top: 20px;
    padding: 20px 24px;
    border-radius: 16px;
    text-align: center;
    font-weight: 600;
    font-size: 18px;
    animation: slideIn 0.4s ease;
    backdrop-filter: blur(10px);
}

.sqe-feedback-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.sqe-feedback button.sqe-next {
    margin-top: 4px;
}

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

.sqe-feedback.ok {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 2px solid rgba(34, 197, 94, 0.4);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.2);
}

.sqe-question.wrong .sqe-feedback {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 2px solid rgba(239, 68, 68, 0.4);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.2);
}

/* Explanation Box */
.sqe-explanation {
    margin-top: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    text-align: left;
    font-size: 15px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    animation: fadeIn 0.5s ease 0.2s both;
    backdrop-filter: blur(10px);
}

.sqe-explanation::before {
    content: "💡";
    display: block;
    font-size: 20px;
    margin-bottom: 8px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Footer with Action Button - HIDDEN (button moved to feedback) */
.sqe-footer {
    display: none !important;
}

.sqe-next, .sqe-retry {
    padding: 14px 36px !important;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%)!important;
    color: #fff!important;
    border: none!important;
    border-radius: 30px!important;
    font-size: 16px !important;
    font-weight: 700!important;
    cursor: pointer!important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1)!important;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4)!important;
    letter-spacing: 0.3px!important;
    display: inline-block;
}

.sqe-next:hover, .sqe-retry:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.5);
}

.sqe-next:active, .sqe-retry:active {
    transform: translateY(0);
}

/* Results Screen */
.sqe-results {
    text-align: center;
    padding: 60px 40px;
    animation: fadeInUp 0.6s ease;
}

.sqe-results h3 {
    font-size: 36px;
    margin-bottom: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sqe-score {
    font-size: 72px;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 30px 0;
    letter-spacing: -2px;
    text-shadow: 0 0 60px rgba(59, 130, 246, 0.5);
}

/* Success Screen - Passed Quiz */
.sqe-success {
    padding: 20px 0;
    animation: fadeInUp 0.6s ease;
}

.sqe-success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 40px rgba(34, 197, 94, 0.4);
    animation: successPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sqe-success-icon svg {
    width: 50px;
    height: 50px;
    color: white;
    stroke-width: 3;
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.sqe-success-title {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #bbf7d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sqe-success-score {
    font-size: 24px;
    font-weight: 700;
    color: #4ade80;
    margin-bottom: 8px;
}

.sqe-success-message {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 32px;
}

.sqe-success-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 36px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff !important;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 30px rgba(34, 197, 94, 0.4);
}

.sqe-success-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(34, 197, 94, 0.5);
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.sqe-success-btn svg {
    width: 22px;
    height: 22px;
    transition: transform 0.3s ease;
}

.sqe-success-btn:hover svg {
    transform: translateX(4px);
}

.sqe-success-next-title {
    margin-top: 16px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.sqe-success-time {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 24px;
}

/* Responsive Design - Compact & Natural */
@media (max-width: 768px) {
    .sqe-quiz {
        margin: 20px auto;
        border-radius: 16px;
        width: 96%;
        max-width: 96%;
    }
    
    .sqe-header {
        padding: 20px 20px 16px;
    }
    
    .sqe-header h2 {
        font-size: 20px;
        margin-bottom: 14px;
    }
    
    .sqe-progress {
        height: 6px;
        margin-bottom: 8px;
    }
    
    .sqe-count {
        font-size: 12px;
    }
    
    .sqe-body {
        padding: 16px;
    }
    
    .sqe-text {
        font-size: 18px;
        line-height: 1.4;
        margin-bottom: 16px;
    }
    
    .sqe-blank {
        min-width: 70px;
        padding: 6px 10px;
        margin: 2px 3px;
        font-size: 14px;
        border-radius: 8px;
    }
    
    .sqe-choices {
        gap: 8px;
    }
    
    .sqe-choice {
        min-width: 100px;
        padding: 11px 16px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
    }
    
    .sqe-feedback {
        margin-top: 14px;
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .sqe-explanation {
        margin-top: 10px;
        padding: 12px;
        font-size: 13px;
        line-height: 1.5;
    }
    
    .sqe-explanation::before {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    .sqe-next, .sqe-retry {
        padding: 12px 28px !important;
        font-size: 14px !important;
        border-radius: 25px !important;
    }
    
    .sqe-results {
        padding: 24px 16px;
    }
    
    .sqe-results h3 {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .sqe-score {
        font-size: 44px;
        margin: 16px 0;
    }
    
    /* Success screen mobile */
    .sqe-success-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 16px;
    }
    
    .sqe-success-icon svg {
        width: 35px;
        height: 35px;
    }
    
    .sqe-success-title {
        font-size: 28px;
    }
    
    .sqe-success-score {
        font-size: 18px;
    }
    
    .sqe-success-message {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .sqe-success-btn {
        padding: 14px 24px;
        font-size: 15px;
        border-radius: 12px;
        gap: 8px;
    }
    
    .sqe-success-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .sqe-success-next-title {
        font-size: 13px;
        margin-top: 12px;
    }
}