/* RSGIS Quiz v2.1 - Bootstrap-compatible responsive styles */

.rsgis-quiz-container {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    padding: 0 15px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #212529;
}

.rsgis-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e9ecef;
}

.rsgis-header h2 {
    margin: 0 0 8px;
    color: #1a5276;
    font-size: clamp(1.4rem, 4vw, 1.75rem);
    font-weight: 700;
}

.rsgis-header p {
    margin: 4px 0;
    color: #6c757d;
    font-size: 0.95rem;
}

.rsgis-sub {
    font-size: 0.875rem !important;
    color: #adb5bd !important;
}

.rsgis-form {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.08);
    border: 1px solid #dee2e6;
}

.rsgis-form-group {
    margin-bottom: 1rem;
}

.rsgis-form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #343a40;
}

.rsgis-form-group .required {
    color: #dc3545;
}

.rsgis-form-group input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #ced4da;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.rsgis-form-group input:focus {
    outline: 0;
    border-color: #1a5276;
    box-shadow: 0 0 0 0.2rem rgba(26, 82, 118, 0.2);
}

.rsgis-btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    text-align: center;
}

.rsgis-btn-primary {
    background: #1a5276;
    color: #fff !important;
}
.rsgis-btn-primary:hover {
    background: #154360;
    color: #fff !important;
}

.rsgis-btn-secondary {
    background: #e9ecef;
    color: #212529 !important;
}
.rsgis-btn-secondary:hover {
    background: #dee2e6;
}

.rsgis-btn-success {
    background: #198754;
    color: #fff !important;
}
.rsgis-btn-success:hover {
    background: #157347;
}

.rsgis-progress {
    font-size: 0.9rem;
    color: #6c757d;
}

.rsgis-progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

#rsgis-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a5276, #2980b9);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.rsgis-question {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0.125rem 0.4rem rgba(0,0,0,0.06);
    border: 1px solid #dee2e6;
    margin-bottom: 16px;
}

.rsgis-question h3 {
    margin: 0 0 16px;
    font-size: 1.05rem;
    line-height: 1.5;
    color: #212529;
    font-weight: 600;
}

.rsgis-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rsgis-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
    background: #f8f9fa;
    margin: 0;
}

.rsgis-option:hover {
    border-color: #1a5276;
    background: #eaf2f8;
}

.rsgis-option input[type="radio"] {
    margin: 0;
    accent-color: #1a5276;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.rsgis-option-key {
    font-weight: 700;
    color: #1a5276;
    min-width: 22px;
}

.rsgis-option-text {
    flex: 1;
    font-size: 0.95rem;
}

.rsgis-option:has(input:checked) {
    background: #eaf2f8;
    border-color: #1a5276;
    box-shadow: 0 0 0 2px rgba(26,82,118,0.15);
}

.rsgis-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

#rsgis-result-content {
    text-align: center;
    margin-bottom: 20px;
}

.rsgis-score-box {
    display: inline-block;
    background: linear-gradient(135deg, #1a5276, #2980b9);
    color: #fff;
    padding: 24px 40px;
    border-radius: 12px;
    margin: 12px 0;
}

.rsgis-score-box .big-score {
    font-size: clamp(2rem, 6vw, 2.6rem);
    font-weight: 700;
    line-height: 1.15;
}

.rsgis-score-box .percentage {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 6px;
}

.rsgis-actions {
    text-align: center;
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

#rsgis-loading {
    text-align: center;
    padding: 50px 20px;
}

.rsgis-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e9ecef;
    border-top-color: #1a5276;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: rsgis-spin 0.75s linear infinite;
}

@keyframes rsgis-spin {
    to { transform: rotate(360deg); }
}

.rsgis-error {
    padding: 16px;
    background: #f8d7da;
    color: #842029;
    border-radius: 8px;
    text-align: center;
}

.rsgis-results-app {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 0 !important;
}

.rsgis-results-app .card {
    border-radius: 12px;
    overflow: hidden;
}

.rsgis-results-app .sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.rsgis-admin .card {
    max-width: 100% !important;
}

.rsgis-admin .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 576px) {
    .rsgis-quiz-container {
        margin: 10px auto;
        padding: 0 10px;
    }
    .rsgis-form,
    .rsgis-question {
        padding: 16px;
    }
    .rsgis-nav {
        flex-direction: column;
    }
    .rsgis-nav .rsgis-btn {
        width: 100%;
    }
    .rsgis-actions {
        flex-direction: column;
    }
    .rsgis-actions .rsgis-btn {
        width: 100%;
    }
    .rsgis-score-box {
        padding: 18px 24px;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {
    .rsgis-results-app h2 {
        font-size: 1.25rem;
    }
}
