/* Materials Adaptor Results Section Styling */
#materials-result {
    margin: 2rem auto;
    position: relative;
    overflow: hidden;
}

#materials-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(0, 85, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#materials-result>* {
    position: relative;
    z-index: 1;
}

form#materials-adaptor-form,
.checkbox-text {
    color: #fff;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="checkbox"] {
    vertical-align: middle;
}

.material-sec {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(8, 8, 8, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.material-sec:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 85, 255, 0.3);
}

.material-sec:last-child {
    margin-bottom: 0;
}

.material-sec h3 {
    color: #ffffff;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(0, 85, 255, 0.3);
    position: relative;
}

.material-sec h3::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #0055ff 0%, rgba(0, 85, 255, 0) 100%);
    border-radius: 2px;
}

.material-sec.overview-section {
    background: linear-gradient(135deg, rgba(0, 85, 255, 0.15) 0%, rgba(8, 8, 8, 0.8) 100%);
    border-color: rgba(0, 85, 255, 0.2);
}

.material-sec.overview-section h3 {
    color: #ffffff;
    font-size: 24px;
}

.material-sec.adapted-text-section {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(8, 8, 8, 0.8) 100%);
    border-color: rgba(34, 197, 94, 0.2);
}

.material-sec.adapted-text-section .text-content {
    background: rgba(34, 197, 94, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid rgba(34, 197, 94, 0.3);
    font-size: 17px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
}

.material-sec p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.material-sec p:last-child {
    margin-bottom: 0;
}

.material-sec p strong {
    color: #ffffff;
    font-weight: 600;
}

.material-sec ul,
.material-sec ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.material-sec ol {
    counter-reset: question-counter;
}

.material-sec li {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.material-sec li:last-child {
    margin-bottom: 0;
}

.material-sec.overview-section li::before {
    content: '📊';
    font-size: 16px;
    position: absolute;
    left: 0;
    top: 0;
}

.material-sec.adapted-text-section li::before {
    content: '📝';
    font-size: 16px;
    position: absolute;
    left: 0;
    top: 0;
}

.material-sec.vocabulary-section li::before {
    content: '📚';
    font-size: 16px;
    position: absolute;
    left: 0;
    top: 0;
}

.material-sec.questions-section ol li {
    counter-increment: question-counter;
    padding-left: 2rem;
}

.material-sec.questions-section ol li::before {
    content: counter(question-counter);
    background: rgba(0, 85, 255, 0.2);
    color: #0055ff;
    font-weight: 600;
    font-size: 14px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 0;
    top: 2px;
    border: 1px solid rgba(0, 85, 255, 0.3);
}

.material-sec.notes-section li::before {
    content: '💡';
    font-size: 16px;
    position: absolute;
    left: 0;
    top: 0;
}

.question-type {
    background: rgba(168, 85, 247, 0.2);
    color: rgba(168, 85, 247, 0.9);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 0.5rem;
}

.suggested-answer {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 8px;
    border-left: 3px solid rgba(34, 197, 94, 0.3);
}

.suggested-answer small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.suggested-answer strong {
    color: rgba(34, 197, 94, 0.9);
}

.vocabulary-definitions li {
    background: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 3px solid rgba(59, 130, 246, 0.3);
}

.vocabulary-definitions li strong {
    color: rgba(59, 130, 246, 0.9);
    font-size: 17px;
}

.vocabulary-definitions li em {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    display: block;
    margin-top: 0.25rem;
}

.word-count-display {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.5rem;
    text-align: right;
}

.word-count-display.near-limit {
    color: rgba(251, 191, 36, 0.8);
}

.word-count-display.over-limit {
    color: rgba(239, 68, 68, 0.8);
    font-weight: 600;
}

@media screen and (max-width: 768px) {
    #materials-result {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }

    .material-sec {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .material-sec h3 {
        font-size: 20px;
    }

    .material-sec.overview-section h3 {
        font-size: 22px;
    }

    .material-sec p,
    .material-sec li {
        font-size: 15px;
    }

    .material-sec li {
        padding-left: 1.25rem;
    }

    .material-sec.questions-section ol li {
        padding-left: 1.75rem;
    }

    .material-sec.adapted-text-section .text-content {
        padding: 1rem;
        font-size: 16px;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#materials-result[style*="block"] .material-sec {
    animation: slideInUp 0.6s ease forwards;
}

#materials-result[style*="block"] .material-sec:nth-child(1) {
    animation-delay: 0.1s;
}

#materials-result[style*="block"] .material-sec:nth-child(2) {
    animation-delay: 0.2s;
}

#materials-result[style*="block"] .material-sec:nth-child(3) {
    animation-delay: 0.3s;
}

#materials-result[style*="block"] .material-sec:nth-child(4) {
    animation-delay: 0.4s;
}

#materials-result[style*="block"] .material-sec:nth-child(5) {
    animation-delay: 0.5s;
}

#materials-result[style*="block"] .material-sec:nth-child(6) {
    animation-delay: 0.6s;
}

#materials-result.loading {
    opacity: 0.7;
}

#materials-result.loading .material-sec {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}