/* IBGS Quiz Plugin - TestVision-inspired styling */

#ibgs-quiz-app {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Screens */
.ibgs-screen {
    animation: ibgsFadeIn 0.3s ease;
}

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

/* Start screen */
.ibgs-header-block {
    text-align: center;
    margin-bottom: 30px;
}

.ibgs-header-block h1 {
    font-size: 28px;
    color: #1a3a5c;
    margin-bottom: 5px;
}

.ibgs-subtitle {
    font-size: 16px;
    color: #666;
    margin-top: 0;
}

.ibgs-info-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.ibgs-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.ibgs-info-row:last-child {
    border-bottom: none;
}

.ibgs-info-label {
    font-weight: 600;
    color: #555;
}

.ibgs-info-value {
    color: #1a3a5c;
}

.ibgs-hint {
    font-size: 14px;
    color: #888;
    text-align: center;
    margin-bottom: 25px;
}

/* Buttons */
.ibgs-btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ibgs-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ibgs-btn-primary {
    background: #1a3a5c;
    color: #fff;
}

.ibgs-btn-primary:hover:not(:disabled) {
    background: #254d78;
}

.ibgs-btn-secondary {
    background: #e8791d;
    color: #fff;
}

.ibgs-btn-secondary:hover:not(:disabled) {
    background: #d06a15;
}

#ibgs-start-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

/* Progress bar */
.ibgs-progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}

.ibgs-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a3a5c, #2d6da3);
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}

/* Question header */
.ibgs-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ibgs-counter {
    font-size: 14px;
    font-weight: 700;
    color: #1a3a5c;
}

.ibgs-module-tag {
    font-size: 12px;
    background: #eef3f8;
    color: #1a3a5c;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

/* Question image */
.ibgs-q-image {
    margin-bottom: 16px;
    text-align: center;
}

.ibgs-q-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Question text */
.ibgs-q-text {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    margin-bottom: 8px;
    line-height: 1.5;
}

.ibgs-type-hint {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
    font-style: italic;
}

/* Options */
.ibgs-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.ibgs-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.ibgs-option:hover:not(.ibgs-disabled) {
    border-color: #1a3a5c;
    background: #f5f8fc;
}

.ibgs-option.ibgs-selected {
    border-color: #1a3a5c;
    background: #eef3f8;
}

.ibgs-option.ibgs-correct {
    border-color: #2e7d32;
    background: #e8f5e9;
}

.ibgs-option.ibgs-wrong {
    border-color: #c62828;
    background: #ffebee;
}

.ibgs-option.ibgs-missed {
    border-color: #f9a825;
    background: #fff8e1;
}

.ibgs-option.ibgs-disabled {
    cursor: default;
}

.ibgs-option-marker {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid #bbb;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #888;
    margin-top: 1px;
    transition: all 0.15s ease;
}

.ibgs-option-marker.ibgs-radio {
    border-radius: 50%;
}

.ibgs-option.ibgs-selected .ibgs-option-marker {
    border-color: #1a3a5c;
    background: #1a3a5c;
    color: #fff;
}

.ibgs-option.ibgs-correct .ibgs-option-marker {
    border-color: #2e7d32;
    background: #2e7d32;
    color: #fff;
}

.ibgs-option.ibgs-wrong .ibgs-option-marker {
    border-color: #c62828;
    background: #c62828;
    color: #fff;
}

.ibgs-option-text {
    font-size: 15px;
    line-height: 1.5;
    color: #333;
}

/* Feedback */
.ibgs-feedback {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.ibgs-feedback.ibgs-feedback-correct {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #1b5e20;
}

.ibgs-feedback.ibgs-feedback-wrong {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    color: #b71c1c;
}

.ibgs-feedback-title {
    font-weight: 700;
    margin-bottom: 4px;
}

/* Navigation */
.ibgs-nav {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Results screen */
.ibgs-result-header {
    text-align: center;
    padding: 30px 0 20px;
}

.ibgs-result-header h2 {
    font-size: 26px;
    margin-bottom: 8px;
}

.ibgs-result-header.ibgs-passed h2 {
    color: #2e7d32;
}

.ibgs-result-header.ibgs-failed h2 {
    color: #c62828;
}

.ibgs-result-header p {
    font-size: 16px;
    color: #666;
}

.ibgs-score-display {
    text-align: center;
    margin-bottom: 30px;
}

.ibgs-score-big {
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
}

.ibgs-score-big.ibgs-passed-score {
    color: #2e7d32;
}

.ibgs-score-big.ibgs-failed-score {
    color: #c62828;
}

.ibgs-score-label {
    font-size: 16px;
    color: #888;
    margin-top: 5px;
}

/* Module breakdown */
.ibgs-module-breakdown {
    margin-bottom: 30px;
}

.ibgs-module-breakdown h3 {
    font-size: 18px;
    color: #1a3a5c;
    margin-bottom: 12px;
}

.ibgs-module-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 14px;
}

.ibgs-module-row:nth-child(even) {
    background: #f8f9fa;
}

.ibgs-module-score {
    font-weight: 700;
}

.ibgs-module-score.ibgs-score-good {
    color: #2e7d32;
}

.ibgs-module-score.ibgs-score-bad {
    color: #c62828;
}

/* Review */
.ibgs-review {
    margin-bottom: 30px;
}

.ibgs-review h3 {
    font-size: 18px;
    color: #1a3a5c;
    margin-bottom: 12px;
}

.ibgs-review-item {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.ibgs-review-item.ibgs-review-correct {
    border-left: 4px solid #2e7d32;
}

.ibgs-review-item.ibgs-review-wrong {
    border-left: 4px solid #c62828;
}

.ibgs-review-q {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 15px;
}

.ibgs-review-answer {
    font-size: 14px;
    margin-bottom: 4px;
}

.ibgs-review-answer .ibgs-correct-label {
    color: #2e7d32;
    font-weight: 600;
}

.ibgs-review-answer .ibgs-wrong-label {
    color: #c62828;
    font-weight: 600;
}

.ibgs-review-explanation {
    font-size: 13px;
    color: #666;
    font-style: italic;
    margin-top: 8px;
}

/* Visual / Diamond options */
.ibgs-options-visual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ibgs-option-visual {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 12px;
}

.ibgs-option-visual .ibgs-option-marker {
    margin-bottom: 8px;
}

.ibgs-option-svg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.ibgs-option-svg svg {
    display: block;
    margin: 0 auto;
}

.ibgs-option-svg small {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Ordering / Drag & Drop */
.ibgs-ordering-options {
    gap: 8px !important;
}

.ibgs-order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: grab;
    transition: all 0.15s ease;
    user-select: none;
    touch-action: none;
}

.ibgs-order-item:active {
    cursor: grabbing;
}

.ibgs-order-handle {
    color: #bbb;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.ibgs-order-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    background: #eef3f8;
    color: #1a3a5c;
    font-size: 13px;
    font-weight: 800;
}

.ibgs-order-text {
    font-size: 15px;
    line-height: 1.5;
    color: #333;
}

.ibgs-order-item.ibgs-dragging {
    opacity: 0.4;
    border-color: #1a3a5c;
    background: #edf2f9;
}

.ibgs-order-item.ibgs-drag-over {
    border-color: #1a3a5c;
    border-style: dashed;
    background: #f5f8fc;
}

.ibgs-order-item.ibgs-order-correct {
    border-color: #2e7d32;
    background: #e8f5e9;
}

.ibgs-order-item.ibgs-order-correct .ibgs-order-num {
    background: #2e7d32;
    color: #fff;
}

.ibgs-order-item.ibgs-order-wrong {
    border-color: #c62828;
    background: #ffebee;
}

.ibgs-order-item.ibgs-order-wrong .ibgs-order-num {
    background: #c62828;
    color: #fff;
}

.ibgs-order-item.ibgs-disabled {
    cursor: default;
}

/* Responsive */
@media (max-width: 600px) {
    #ibgs-quiz-app {
        padding: 12px;
    }
    
    .ibgs-header-block h1 {
        font-size: 22px;
    }
    
    .ibgs-q-text {
        font-size: 16px;
    }
    
    .ibgs-option {
        padding: 12px;
    }
    
    .ibgs-nav {
        flex-direction: column;
    }
    
    .ibgs-nav .ibgs-btn {
        width: 100%;
        text-align: center;
    }
    
    .ibgs-question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .ibgs-score-big {
        font-size: 48px;
    }
}
