@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

.ag-quiz-container {
    font-family: 'Outfit', sans-serif;
    border: none;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    max-width: 1040px;
    margin: 20px auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    color: #2d3436;
    line-height: 1.6;
}

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

.ag-progress-fill {
    transition: width 0.4s ease;
    background: linear-gradient(90deg, #00b894, #55efc4);
    height: 100%;
}

.ag-question-count {
    margin-bottom: 20px;
    font-weight: 600;
    color: #636e72;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 13px;
}

.ag-quiz-container h2 {
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 1.5rem;
}

.ag-btn-start,
.ag-btn-submit,
.ag-btn-restart,
.ag-btn-next,
.ag-btn-prev {
    font-family: 'Outfit', sans-serif;
    background: #6c5ce7;
    color: #fff;
    border: none;
    padding: 12px 28px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
    display: inline-block;
    vertical-align: middle;
}

.ag-btn-prev {
    background: #fab1a0;
    color: #d63031;
    box-shadow: 0 4px 15px rgba(250, 177, 160, 0.3);
    margin-right: 10px;
}

.ag-btn-start:hover,
.ag-btn-submit:hover,
.ag-btn-restart:hover,
.ag-btn-next:hover {
    background: #a29bfe;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

.ag-btn-prev:hover {
    background: #ff7675;
    color: #fff;
}

.ag-answers {
    margin: 25px 0;
}

.ag-answers label {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    padding: 15px 20px;
    background: #f1f2f6;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 400;
}

.ag-answer-image-wrap {
    flex-shrink: 0;
    line-height: 0;
}

.ag-answer-image {
    max-width: 150px;
    max-height: 150px;
    border-radius: 6px;
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ag-answer-text {
    flex-grow: 1;
}

.ag-answers label:hover {
    background: #dfe6e9;
    border-color: #6c5ce7;
}

.ag-answers label.ag-active {
    background: #e0dcfc;
    border-color: #6c5ce7;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.1);
}

.ag-answers input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.2);
    accent-color: #6c5ce7;
}

.ag-quiz-result {
    text-align: center;
    padding: 40px;
    background: #fff;
    border: none;
}

.ag-result-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 8px solid #6c5ce7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
}

.ag-result-score {
    font-size: 32px;
    font-weight: 700;
    color: #6c5ce7;
}

.ag-result-percent {
    font-size: 14px;
    color: #636e72;
    font-weight: 600;
}

/* History Dashboard Styles */
.ag-quiz-history-container {
    font-family: 'Outfit', sans-serif;
    margin-top: 40px;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.ag-history-table {
    width: 100%;
}

.ag-history-table th {
    padding: 15px !important;
    font-weight: 700 !important;
    background: #f8f9fa !important;
}

.ag-history-table td {
    padding: 15px !important;
}

.ag-view-frontend-details {
    color: #6c5ce7;
    text-decoration: none;
    font-weight: 600;
}

/* Modal Enhancements */
#ag-frontend-details-modal,
#ag-attempt-details-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.ag-frontend-modal-close,
.ag-modal-close {
    transition: transform 0.2s ease;
}

.ag-frontend-modal-close:hover,
.ag-modal-close:hover {
    transform: rotate(90deg);
}

.ag-intro-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #edf2f7;
    flex-wrap: wrap;
    gap: 15px;
}

.ag-info-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ag-badge {
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    background: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ag-intro-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ag-language-selector,
.ag-text-resize-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #718096;
}

.ag-lang-dropdown,
#ag-text-resize-select {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.ag-lang-dropdown:focus,
#ag-text-resize-select:focus {
    border-color: #6c5ce7;
}

.ag-intro-nav {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Subject Tabs */
.ag-subject-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 5px;
    overflow-x: auto;
    scrollbar-width: none;
    /* Hide for firefox */
}

.ag-subject-tabs::-webkit-scrollbar {
    display: none;
    /* Hide for chrome/safari */
}

.ag-tab-btn {
    background: transparent;
    border: none;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    color: #718096;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    white-space: nowrap;
    transition: all 0.2s;
    position: relative;
}

.ag-tab-btn.active {
    color: #6c5ce7;
    background: #f0eeff;
}

.ag-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 0;
    width: 100%;
    height: 4px;
    background: #6c5ce7;
    border-radius: 4px;
}

.ag-tab-btn:hover {
    color: #2d3436;
}

.ag-question-type-badge {
    display: inline-block;
    padding: 6px 12px;
    background: #f8f9fa;
    color: #57606f;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    letter-spacing: 0.2px;
    margin-bottom: 12px;
    border: 1px solid #dfe4ea;
}

/* Text Sizes */
.ag-quiz-container.text-small {
    font-size: 14px;
}

.ag-quiz-container.text-normal {
    font-size: 16px;
}

.ag-quiz-container.text-large {
    font-size: 20px;
}

.ag-quiz-container.text-xlarge {
    font-size: 24px;
}

/* Question Transitions */
.ag-question-step {
    animation: fadeIn 0.4s ease-out;
}

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

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

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .ag-intro-header {
        flex-direction: column;
        align-items: stretch;
    }

    .ag-intro-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .ag-language-selector,
    .ag-text-resize-container {
        justify-content: space-between;
    }
}