/**
 * Quizify Pro Modern Styles
 */

/* Main container with improved aesthetics */
.quizify-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 25px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    animation: quizify-fade-in 0.5s ease-out;
}

/* Fade-in animation */
@keyframes quizify-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Quiz title with elegant styling */
.quizify-title {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    position: relative;
    animation: quizify-slide-in 0.6s ease-out;
}

.quizify-title:after {
    content: '';
    position: absolute;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #8e44ad);
    bottom: -2px;
    left: 0;
    border-radius: 3px;
}

@keyframes quizify-slide-in {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Quiz description with enhanced readability */
.quizify-description {
    margin-bottom: 25px;
    color: #505965;
    font-size: 17px;
    line-height: 1.6;
    animation: quizify-fade-in 0.7s ease-out;
    animation-delay: 0.2s;
    animation-fill-mode: both;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

/* Enhanced loading indicator with animation */
.quizify-loading {
    text-align: center;
    padding: 40px;
    color: #34495e;
    font-size: 18px;
    font-weight: 500;
    position: relative;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.quizify-loading:before {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    margin-bottom: 15px;
    animation: quizify-spin 1s linear infinite;
    display: inline-block;
}

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

/* Modern start screen with animations */
.quizify-start-screen {
    text-align: center;
    padding: 30px;
    animation: quizify-fade-in 0.8s ease-out;
    position: relative;
    overflow: hidden;
}

.quizify-start-screen:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #8e44ad);
    z-index: 1;
    animation: quizify-slide-right 1.2s ease-out;
}

/* Difficulty section styling */
.quizify-difficulty-section {
    margin: 20px 0 35px;
    padding: 25px;
    background-color: #f9fbfd;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    animation: quizify-fade-in 0.8s ease-out;
    animation-delay: 0.3s;
    animation-fill-mode: both;
}

.quizify-difficulty-title {
    font-size: 20px;
    color: #34495e;
    margin-bottom: 15px;
    font-weight: 600;
}

.quizify-difficulty-label {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.quizify-difficulty-label i {
    margin-right: 5px;
}

.quizify-difficulty-meter {
    height: 20px;
    background-color: #f0f2f5;
    border-radius: 50px;
    overflow: hidden;
    position: relative;
    margin: 25px 0 40px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quizify-difficulty-bar {
    height: 100%;
    border-radius: 50px;
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quizify-difficulty-bar:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 15px 15px;
    border-radius: 50px;
    animation: quizify-progress-animation 1s linear infinite;
    overflow: hidden;
}

.quizify-difficulty-markers {
    position: relative;
    margin-top: 5px;
    height: 30px;
}

.quizify-difficulty-marker {
    position: absolute;
    transform: translateX(-50%);
    font-size: 12px;
    color: #7f8c8d;
    top: 5px;
    font-weight: 600;
}

@keyframes quizify-slide-right {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(0);
    }
}

.quizify-instructions {
    margin-bottom: 30px;
    padding: 22px;
    background-color: #f9fbfd;
    border-radius: 12px;
    text-align: left;
    color: #505965;
    font-size: 17px;
    line-height: 1.6;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #3498db;
    animation: quizify-fade-in 0.8s ease-out;
    animation-delay: 0.2s;
    animation-fill-mode: both;
    position: relative;
}

.quizify-instructions:after {
    content: '💡';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 22px;
    opacity: 0.6;
}

.quizify-info {
    margin-bottom: 35px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    font-size: 16px;
    color: #5d6c7b;
    animation: quizify-fade-in 0.8s ease-out;
    animation-delay: 0.4s;
    animation-fill-mode: both;
}

.quizify-info-item {
    background-color: #f8f9fa;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaecef;
}

.quizify-info-item span {
    font-weight: 600;
    color: #34495e;
    margin-left: 5px;
}

.quizify-start-button {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 16px 36px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
    position: relative;
    overflow: hidden;
    animation: quizify-fade-in 0.8s ease-out;
    animation-delay: 0.6s;
    animation-fill-mode: both;
    z-index: 1;
}

.quizify-start-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #2ecc71, #27ae60);
    transition: transform 0.6s;
    transform: scaleX(0);
    transform-origin: right;
    z-index: -1;
}

.quizify-start-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(46, 204, 113, 0.6);
    animation: quizify-micro-pop 0.5s ease-in-out;
}

.quizify-start-button:hover:before {
    transform: scaleX(1);
    transform-origin: left;
}

.quizify-start-button:active {
    transform: translateY(1px);
    box-shadow: 0 3px 10px rgba(46, 204, 113, 0.4);
}

/* Question display with modern styling */
.quizify-question {
    margin-bottom: 30px;
    animation: quizify-fade-in 0.5s ease-out;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quizify-question:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.quizify-question-header {
    margin-bottom: 25px;
}

.quizify-question-text {
    font-size: 22px;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 20px;
    line-height: 1.5;
    position: relative;
    padding-left: 15px;
    border-left: 4px solid #3498db;
}

.quizify-question-image {
    margin: 20px 0;
    text-align: center;
    overflow: hidden;
    border-radius: 8px;
}

.quizify-question-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    transition: transform 0.5s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.quizify-question-image img:hover {
    transform: scale(1.02);
}

/* Options with modern interactive styling */
.quizify-options {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quizify-option {
    margin-bottom: 5px;
    padding: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0;
    background-color: #fff;
    position: relative;
    overflow: hidden;
    animation: quizify-fade-in 0.5s ease-out;
    animation-fill-mode: both;
}

.quizify-option:nth-child(1) { animation-delay: 0.1s; }
.quizify-option:nth-child(2) { animation-delay: 0.2s; }
.quizify-option:nth-child(3) { animation-delay: 0.3s; }
.quizify-option:nth-child(4) { animation-delay: 0.4s; }
.quizify-option:nth-child(5) { animation-delay: 0.5s; }

.quizify-option:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #3498db, #8e44ad);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quizify-option:hover {
    background-color: #f8f9fa;
    border-color: #bdc3c7;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    animation: quizify-micro-pop 0.4s ease-in-out;
}

.quizify-option:hover:before {
    opacity: 1;
}

.quizify-option input[type="radio"],
.quizify-option input[type="checkbox"] {
    margin-right: 12px;
    transform: scale(1.2);
    accent-color: #3498db;
    transition: all 0.2s ease;
}

.quizify-option input[type="radio"]:checked + label,
.quizify-option input[type="checkbox"]:checked + label {
    color: #2980b9;
    font-weight: 600;
}

.quizify-option label {
    font-size: 17px;
    color: #34495e;
    cursor: pointer;
    transition: color 0.3s ease;
    display: inline-block;
    vertical-align: middle;
    padding-right: 20px; /* Space for option images */
}

.quizify-option-image {
    margin-top: 15px;
    margin-left: 30px;
    transition: all 0.3s ease;
    position: relative;
}

.quizify-option-image:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(52, 152, 219, 0.05);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
}

.quizify-option-image:hover:after {
    opacity: 1;
}

.quizify-option-image img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quizify-option-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

/* Text inputs */
.quizify-option input[type="text"],
.quizify-option textarea {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 5px;
}

.quizify-option textarea {
    min-height: 100px;
}

/* Modern navigation controls */
.quizify-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eef2f7;
}

.quizify-prev-button,
.quizify-next-button,
.quizify-submit-button {
    padding: 12px 25px;
    font-size: 16px;
    border-radius: 50px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.quizify-prev-button:after,
.quizify-next-button:after,
.quizify-submit-button:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.quizify-prev-button:hover:after,
.quizify-next-button:hover:after,
.quizify-submit-button:hover:after {
    animation: quizify-ripple 0.6s ease-out;
}

@keyframes quizify-ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

.quizify-prev-button {
    background-color: #ecf0f1;
    color: #34495e;
}

.quizify-prev-button:hover {
    background-color: #dfe6e9;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.08);
    animation: quizify-micro-wiggle 0.5s ease-in-out;
}

.quizify-next-button {
    background-color: #3498db;
    color: white;
}

.quizify-next-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(52, 152, 219, 0.3);
    animation: quizify-micro-bounce 0.5s ease-in-out;
}

.quizify-submit-button {
    background-color: #27ae60;
    color: white;
}

.quizify-submit-button:hover {
    background-color: #219653;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(39, 174, 96, 0.3);
    animation: quizify-micro-pop 0.5s ease-in-out;
}

.quizify-question-counter {
    font-size: 15px;
    color: #7f8c8d;
    font-weight: 600;
    background-color: #f8f9fa;
    padding: 8px 15px;
    border-radius: 50px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.quizify-prev-button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Enhanced progress bar */
.quizify-progress-container {
    background-color: #eef2f7;
    border-radius: 50px;
    height: 10px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.quizify-progress-bar {
    background: linear-gradient(to right, #3498db, #27ae60);
    height: 100%;
    border-radius: 50px;
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quizify-progress-bar:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 15px 15px;
    border-radius: 50px;
    animation: quizify-progress-animation 1s linear infinite;
    overflow: hidden;
}

@keyframes quizify-progress-animation {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 15px 0;
    }
}

/* Micro-animations for interactive elements */
@keyframes quizify-micro-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes quizify-micro-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-2px); }
}

@keyframes quizify-micro-wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

@keyframes quizify-micro-highlight {
    0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(52, 152, 219, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
}

@keyframes quizify-micro-slide-right {
    from { 
        transform: translateX(15px);
        opacity: 0;
    }
    to { 
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes quizify-micro-slide-left {
    from { 
        transform: translateX(-15px);
        opacity: 0;
    }
    to { 
        transform: translateX(0);
        opacity: 1;
    }
}

/* Enhanced Timer Display */
.quizify-timer {
    text-align: center;
    margin: 25px auto 15px;
    font-size: 16px;
    color: #7f8c8d;
    max-width: 200px;
    padding: 10px;
    border-radius: 50px;
    background-color: #f8f9fa;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    animation: quizify-fade-in 0.8s ease-out;
    transition: all 0.3s ease;
}

.quizify-timer:before {
    content: '⏱️';
    margin-right: 8px;
    vertical-align: middle;
    font-size: 18px;
    opacity: 0.7;
}

.quizify-timer:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    animation: quizify-micro-pop 0.4s ease-in-out;
}

.quizify-timer-display {
    font-weight: 700;
    color: #34495e;
    position: relative;
    display: inline-block;
    padding: 0 5px;
}

/* Pulse animation for last 30 seconds */
@keyframes quizify-timer-pulse {
    0% {
        color: #34495e;
    }
    50% {
        color: #e74c3c;
    }
    100% {
        color: #34495e;
    }
}

.quizify-timer.warning .quizify-timer-display {
    animation: quizify-timer-pulse 1s infinite;
    color: #e74c3c;
}

/* Last 10 seconds critical warning */
.quizify-timer.critical {
    background-color: rgba(231, 76, 60, 0.1);
}

.quizify-timer.critical .quizify-timer-display {
    color: #e74c3c;
    animation: quizify-timer-pulse 0.5s infinite;
}

/* Results screen with enhanced visuals */
.quizify-results {
    padding: 25px;
    animation: quizify-fade-in 0.6s ease-out;
}

.quizify-results-header {
    text-align: center;
    margin-bottom: 30px;
    animation: quizify-scale-in 0.5s ease-out;
}

@keyframes quizify-scale-in {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.quizify-results-title {
    font-size: 32px;
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.quizify-results-title:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #8e44ad);
    border-radius: 3px;
}

.quizify-results-summary {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 35px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    animation: quizify-slide-up 0.8s ease-out;
}

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

.quizify-results-summary.passed {
    border-top: 5px solid #27ae60;
}

.quizify-results-summary.failed {
    border-top: 5px solid #e74c3c;
}

.quizify-results-score {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #2c3e50;
    position: relative;
    display: inline-block;
}

.quizify-results-score:before {
    content: '';
    position: absolute;
    width: 120%;
    height: 120%;
    top: -10%;
    left: -10%;
    background: rgba(52, 152, 219, 0.05);
    border-radius: 50%;
    z-index: -1;
}

.quizify-score-label {
    font-weight: 600;
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
    color: #7f8c8d;
}

.quizify-results-difficulty {
    font-size: 18px;
    font-weight: 600;
    margin: 15px 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: 50px;
    background-color: rgba(236, 240, 241, 0.5);
    animation: quizify-fade-in 0.6s ease-out;
    animation-delay: 0.4s;
    animation-fill-mode: both;
}

.quizify-difficulty-value {
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.quizify-difficulty-value i {
    margin-right: 5px;
}

.quizify-results-status {
    font-size: 24px;
    font-weight: 700;
    margin-top: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    display: inline-block;
    position: relative;
    animation: quizify-pulse 2s infinite;
}

@keyframes quizify-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

.quizify-results-status.passed {
    color: #27ae60;
    background-color: rgba(39, 174, 96, 0.1);
    border: 2px solid rgba(39, 174, 96, 0.2);
}

.quizify-results-status.failed {
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
    border: 2px solid rgba(231, 76, 60, 0.2);
}

.quizify-detailed-results {
    margin-bottom: 40px;
    animation: quizify-fade-in 1s ease-out;
    animation-fill-mode: both;
    animation-delay: 0.3s;
}

.quizify-detailed-results h3 {
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #eef2f7;
    font-size: 22px;
    color: #34495e;
    position: relative;
}

.quizify-detailed-results h3:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #3498db, #8e44ad);
}

.quizify-result-item {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: quizify-fade-in 0.5s ease-out;
    animation-fill-mode: both;
}

.quizify-result-item:nth-child(odd) {
    animation-delay: 0.2s;
}

.quizify-result-item:nth-child(even) {
    animation-delay: 0.4s;
}

.quizify-result-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    animation: quizify-micro-highlight 1s ease-in-out;
}

.quizify-result-item.correct {
    background-color: #fff;
    border-left: 5px solid #27ae60;
    animation: quizify-correct-answer-appear 0.6s ease-out;
}

.quizify-result-item.incorrect {
    background-color: #fff;
    border-left: 5px solid #e74c3c;
    animation: quizify-incorrect-answer-appear 0.6s ease-out;
}

@keyframes quizify-correct-answer-appear {
    0% { background-color: rgba(39, 174, 96, 0.2); }
    50% { background-color: rgba(39, 174, 96, 0.1); }
    100% { background-color: #fff; }
}

@keyframes quizify-incorrect-answer-appear {
    0% { background-color: rgba(231, 76, 60, 0.2); }
    50% { background-color: rgba(231, 76, 60, 0.1); }
    100% { background-color: #fff; }
}

.quizify-result-question {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #34495e;
    line-height: 1.5;
}

.quizify-result-status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quizify-result-item.correct .quizify-result-status {
    background-color: #27ae60;
    color: white;
}

.quizify-result-item.incorrect .quizify-result-status {
    background-color: #e74c3c;
    color: white;
}

.quizify-result-details {
    margin-top: 15px;
    font-size: 16px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.quizify-result-your-answer,
.quizify-result-correct-answer {
    margin-bottom: 10px;
    line-height: 1.6;
    position: relative;
    padding-left: 25px;
}

.quizify-result-your-answer:before,
.quizify-result-correct-answer:before {
    font-family: sans-serif;
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
}

.quizify-result-your-answer:before {
    content: '↪';
    color: #3498db;
    animation: quizify-micro-slide-right 0.5s ease-out;
}

.quizify-result-correct-answer:before {
    content: '✓';
    color: #27ae60;
    animation: quizify-micro-bounce 0.5s ease-out;
}

/* Animation for correct answers - subtle glow effect */
.quizify-result-item.correct .quizify-result-correct-answer {
    position: relative;
}

.quizify-result-item.correct .quizify-result-correct-answer:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(39, 174, 96, 0.1);
    border-radius: 4px;
    opacity: 0;
    animation: quizify-micro-highlight 2s ease-in-out infinite;
    z-index: -1;
}

.quizify-result-label {
    font-weight: 700;
    margin-right: 8px;
    color: #2c3e50;
}

.quizify-results-actions {
    text-align: center;
    margin-top: 40px;
    animation: quizify-fade-in 1.2s ease-out;
    animation-fill-mode: both;
    animation-delay: 0.5s;
}

.quizify-retake-button {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.quizify-retake-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #2980b9, #3498db);
    transition: transform 0.6s;
    transform: scaleX(0);
    transform-origin: right;
    z-index: -1;
}

.quizify-retake-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(52, 152, 219, 0.6);
    animation: quizify-micro-bounce 0.5s ease-in-out;
}

.quizify-retake-button:hover:before {
    transform: scaleX(1);
    transform-origin: left;
}

/* Error messages */
.quizify-error {
    background-color: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 4px solid #c62828;
}

/* Time-up alert animation */
@keyframes quizify-time-up-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(231, 76, 60, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

.quizify-time-up-alert {
    animation: quizify-time-up-pulse 1s infinite, quizify-fade-in 0.3s ease-out;
}

/* Enhanced celebration animations for passing */
@keyframes confetti-fall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes confetti-sway {
    0% {
        transform: translateX(0px);
    }
    33% {
        transform: translateX(30px);
    }
    66% {
        transform: translateX(-30px);
    }
    100% {
        transform: translateX(0px);
    }
}

.quizify-confetti {
    position: absolute;
    z-index: 1000;
    width: var(--size, 10px);
    height: var(--size, 10px);
    background-color: var(--color);
    border-radius: var(--radius, 2px);
    animation: 
        confetti-fall var(--fall-duration, 3s) var(--fall-delay, 0s) linear forwards,
        confetti-sway var(--sway-duration, 2s) var(--sway-delay, 0s) ease-in-out infinite;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    opacity: var(--opacity, 1);
    will-change: transform;
}

/* Star shape confetti */
.quizify-confetti.star {
    clip-path: polygon(
        50% 0%, 
        61% 35%, 
        98% 35%, 
        68% 57%, 
        79% 91%, 
        50% 70%, 
        21% 91%, 
        32% 57%, 
        2% 35%, 
        39% 35%
    );
}

/* Circle confetti */
.quizify-confetti.circle {
    border-radius: 50%;
}

/* Square confetti */
.quizify-confetti.square {
    border-radius: 0px;
}

/* Success animation overlay */
.quizify-success-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

/* Trophy animation for passing */
@keyframes trophy-appear {
    0% {
        transform: scale(0) rotate(-10deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.2) rotate(5deg);
    }
    80% {
        transform: scale(0.9) rotate(-5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.quizify-trophy {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FFD700"><path d="M12 2l3 5h5l-4 6 2 9H6l2-9-4-6h5z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    animation: trophy-appear 1s ease-out 0.5s forwards;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.7));
}

/* Failing animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    20%, 60% {
        transform: translateX(-5px);
    }
    40%, 80% {
        transform: translateX(5px);
    }
}

.shake-animation {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* Responsive styles */
@media (max-width: 768px) {
    .quizify-container {
        padding: 15px;
    }
    
    .quizify-title {
        font-size: 24px;
    }
    
    .quizify-question-text {
        font-size: 18px;
    }
    
    .quizify-navigation {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .quizify-question-counter {
        order: -1;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .quizify-prev-button,
    .quizify-next-button,
    .quizify-submit-button {
        width: 100%;
    }
    
    .quizify-results-summary {
        padding: 15px;
    }
}