/* AudioSub Quiz Styles */

.audiosub-quiz-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    color: #9CA3AF;
}

/* Quiz Header */
.audiosub-quiz-header {
    position: relative;
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.audiosub-quiz-header .btn-home {
    position: absolute;
    left: 0;
    top: 0;
    padding: 8px 16px;
    font-size: 14px;
}

.audiosub-quiz-header .quiz-title {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 15px;
}

.audiosub-quiz-header .quiz-description {
    font-size: 16px;
    color: #9CA3AF;
    margin-bottom: 20px;
}

.audiosub-quiz-header .quiz-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.quiz-info .question-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: #9CA3AF;
}

/* Progress Bar */
.audiosub-quiz-progress {
    margin-bottom: 40px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #3A3A3C;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: #E5E7EB;
    transition: width 0.4s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #9CA3AF;
    font-weight: 500;
}

/* Questions Container */
.audiosub-quiz-questions {
    min-height: 300px;
}

.quiz-question {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.quiz-question.active {
    display: block;
}

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

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

.question-number {
    display: inline-block;
    background: #7C55FA;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
}

.question-text {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 10px;
    line-height: 1.5;
}

.question-type-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #1C1C1E;
    color: #9CA3AF;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
}

/* Answer Options */
.question-answers {
    margin-top: 30px;
}

/* Multiple Choice Options */
.answer-option {
    background: #1C1C1E;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.answer-option:hover {
    border-color: #7C55FA;
    background: #1c1c1e;
}

.answer-option input[type="radio"],
.answer-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #7C55FA;
}

.answer-option label {
    flex: 1;
    cursor: pointer;
    margin: 0;
    font-size: 16px;
    color: #ffffff;
}

.answer-option.selected {
    border-color: #7C55FA;
    background: #7C55FA;
}

.answer-option.selected label {
    font-weight: 600;
    color: #ffffff;
}

/* Open Answer */
.answer-textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 1px solid #3A3A3C;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
    background-color: #1C1C1E;
    color: #ffffff;
}

.answer-textarea:focus {
    outline: none;
    border-color: #7C55FA;
    background: #1C1C1E;
}

/* Navigation Buttons */
.audiosub-quiz-navigation {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.quiz-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 33px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #4B5563;
    color: white;
}

.quiz-btn:disabled {
    background: #4B5563;
    cursor: not-allowed;
    opacity: 0.5;
}

.quiz-btn:hover:not(:disabled) {
    background: #7C55FA;
}

.quiz-btn.quiz-btn-success {
    background: #4B5563;
    color: white;
}

.quiz-btn.quiz-btn-success:hover:not(:disabled) {
    background: #2ecc71;
}

/* Results */
.audiosub-quiz-results {
    text-align: center;
    padding: 40px 20px;
}

.results-header {
    margin-bottom: 40px;
}

.results-icon {
    width: 80px;
    height: 80px;
    background: #2ecc71;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.results-icon .dashicons {
    font-size: 50px;
    color: white;
    width: 50px;
    height: 50px;
}

.results-header h2 {
    font-size: 32px;
    color: #ffffff;
    margin: 0;
}

.results-summary {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.result-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 30px;
    min-width: 150px;
}

.result-value {
    font-size: 48px;
    font-weight: 700;
    color: #7C55FA;
    margin-bottom: 10px;
}

.result-label {
    font-size: 16px;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.results-details {
    max-width: 600px;
    margin: 40px auto;
    text-align: left;
}

.result-question {
    background: #1C1C1E;
    border: 1px solid #3A3A3C;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.result-question.correct {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.result-question.incorrect {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.result-question-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.result-question-icon {
    font-size: 24px;
}

.result-question.correct .result-question-icon {
    color: #2ecc71;
}

.result-question.incorrect .result-question-icon {
    color: #e74c3c;
}

.result-question-text {
    flex: 1;
    font-weight: 600;
    color: #ffffff;
}

.result-answer {
    margin-top: 10px;
    padding-left: 34px;
}

.result-answer-label {
    font-size: 14px;
    color: #9CA3AF;
    margin-bottom: 5px;
}

.result-answer-value {
    color: #ffffff;
}

.result-answer.user-answer {
    margin-bottom: 8px;
}

.result-answer.correct-answer {
    color: #2ecc71;
    font-weight: 600;
}

.results-actions {
    margin-top: 40px;
}

.quiz-btn-retry {
    padding: 15px 40px;
    font-size: 18px;
    background: #4B5563;
    color: white;
    border: none;
    border-radius: 33px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.quiz-btn-retry:hover {
    background: #7C55FA;
}

/* Error Messages */
.audiosub-quiz-error-container {
    padding: 20px;
}

.error-message {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    padding: 20px;
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
    text-align: center;
}

/* Loading State - Dynamic Messages */
.audiosub-quiz-loading {
    text-align: center;
    padding: 80px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    margin: 20px 0;
    animation: pulse 3s ease-in-out infinite;
}

.audiosub-quiz-loading .loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #7C55FA;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spinGradient 2s linear infinite;
    margin: 0 auto 30px;
    box-shadow: 0 0 20px rgba(124, 85, 250, 0.3);
}

.audiosub-quiz-loading .loading-message {
    font-size: 18px;
    color: #E5E7EB;
    margin: 0;
    font-weight: 500;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.4;
    transition: opacity 0.3s ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    .audiosub-quiz-container {
        padding: 15px;
    }

    .audiosub-quiz-header {
        padding-top: 50px;
    }

    .audiosub-quiz-header .btn-home {
        position: relative;
        left: auto;
        top: auto;
        display: block;
        margin: 0 auto 15px;
        width: fit-content;
    }

    .audiosub-quiz-header .quiz-title {
        font-size: 24px;
    }

    .question-text {
        font-size: 18px;
    }

    .audiosub-quiz-navigation {
        flex-direction: column;
    }

    .quiz-btn {
        width: 100%;
        justify-content: center;
    }

    .results-summary {
        flex-direction: column;
        align-items: center;
    }

    .result-card {
        width: 100%;
        max-width: 250px;
    }
}

/* Animation for correct/incorrect feedback */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.5s;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 0.5s;
}

/* Audio Configuration Card */
.audio-configuration-card {
    background: linear-gradient(135deg, rgba(124, 85, 250, 0.15), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(124, 85, 250, 0.3);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

.config-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.config-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.config-header p {
    color: #9CA3AF;
    font-size: 1rem;
    margin: 0;
}

.config-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.config-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.config-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.config-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.config-label {
    font-weight: 500;
    color: #D1D5DB;
    flex: 1;
    margin-right: 1rem;
}

.config-value {
    color: #ffffff;
    font-weight: 600;
    text-align: right;
    flex: 1;
    word-break: break-word;
}

.config-cta {
    text-align: center;
    padding: 2rem 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.config-cta p {
    margin-bottom: 1rem;
    color: #9CA3AF;
}

.config-cta p:first-child {
    font-size: 1.1rem;
    color: #ffffff;
}

.btn-transfer-audio {
    background: linear-gradient(135deg, #7C55FA, #A855F7);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(124, 85, 250, 0.4);
}

.btn-transfer-audio:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 85, 250, 0.6);
    background: linear-gradient(135deg, #8B5CF6, #A855F7);
}

.btn-transfer-audio:active {
    transform: translateY(0);
}

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

/* Enhanced loading spinner with gradient */
@keyframes spinGradient {
    0% { 
        transform: rotate(0deg);
        border-top-color: #7C55FA;
    }
    25% { 
        border-top-color: #A855F7;
    }
    50% { 
        border-top-color: #8B5CF6;
    }
    75% { 
        border-top-color: #9333EA;
    }
    100% { 
        transform: rotate(360deg);
        border-top-color: #7C55FA;
    }
}

/* Loading pulse effect */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}



/* Responsive design for config card */
@media (max-width: 768px) {
    .config-sections {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .config-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .config-label {
        margin-right: 0;
    }
    
    .config-value {
        text-align: left;
    }
    
    .audio-configuration-card {
        padding: 1.5rem;
    }

    .audiosub-quiz-loading {
        padding: 60px 15px;
    }
    
    .audiosub-quiz-loading .loading-message {
        font-size: 16px;
    }
}
