/* public/css/bqm-public.css */

/* --- General Structure --- */
.bqm-quiz-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background: #fdfdfd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* Ensure fonts are consistent across browsers */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.bqm-quiz-container h2 {
    color: #333;
    text-align: center;
    margin-bottom: 25px;
}

.bqm-back-link {
    display: inline-block;
    margin-bottom: 15px;
    text-decoration: none;
    color: #0073aa;
    font-weight: 500;
}

/* --- Card Grids (Grade & Subject Selection) --- */
.bqm-selection-grid {
    display: grid;
    gap: 25px;
    padding: 15px 0;
}

.bqm-grade-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.bqm-subject-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* --- Card Styling --- */
.bqm-card {
    display: block;
    text-decoration: none;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    /* Cross-browser transitions */
    -webkit-transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    -moz-transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    text-align: center;
    color: inherit;
}

.bqm-card:hover {
    transform: translateY(-4px);
    -webkit-transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #0073aa; 
}

.bqm-card h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.3em;
}

.bqm-card-meta {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 0.95em;
}

/* --- Buttons --- */
.bqm-btn {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.2s;
    font-size: 1em;
    line-height: 1.4;
    text-align: center;
}

.bqm-btn-link {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.9em;
    color: #0073aa;
    border: 1px solid #0073aa;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s;
}
.bqm-card:hover .bqm-btn-link {
    background: #e5f1f7;
}

.bqm-btn-primary {
    background-color: #0073aa;
    color: #fff;
}
.bqm-btn-primary:hover {
    background-color: #005177;
    color: #fff;
}

.bqm-btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    border-color: #ccc;
}
.bqm-btn-secondary:hover {
    background-color: #e0e0e0;
}

.bqm-btn-success {
    background-color: #46b450;
    color: #fff;
}
.bqm-btn-success:hover {
    background-color: #3aa044;
}

.bqm-btn-warning {
    background-color: #ff9800; 
    color: #fff;
}
.bqm-btn-warning:hover {
    background-color: #e68900;
}

.bqm-btn-start {
    width: 100%;
    display: block;
    box-sizing: border-box;
}

/* --- Difficulty Selection --- */
.bqm-difficulty-options {
    display: flex;
    gap: 20px;
    margin: 20px 0 30px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.bqm-difficulty-card {
    cursor: pointer;
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

.bqm-difficulty-card input[type="radio"] {
    display: none;
}

.bqm-difficulty-card span {
    display: block;
    padding: 15px;
    background: #f9f9f9;
    border: 2px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    color: #555;
    transition: all 0.2s;
}

.bqm-difficulty-card input[type="radio"]:checked + span {
    background: #0073aa;
    color: white;
    border-color: #005177;
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

/* --- Quiz Interface --- */
.bqm-quiz-wrapper {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.bqm-quiz-title {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-top: 0;
}

.bqm-question-container {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #e5e5e5;
    background-color: #fafafa;
    border-radius: 6px;
}

.bqm-question-container h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.15em;
    color: #222;
}

.bqm-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bqm-option-label {
    display: block;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
    transition: background-color 0.1s;
}

.bqm-option-label:hover {
    background-color: #f0f7fc;
    border-color: #99c5e3;
}

.bqm-option-label input[type="radio"] {
    margin-right: 10px;
}

.bqm-option-label input[type="radio"]:checked + .bqm-option-text {
    font-weight: bold;
    color: #0073aa;
}

/* --- Difficulty Badge --- */
.bqm-difficulty-label {
    font-size: 0.75em;
    padding: 3px 8px;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    float: right;
    text-transform: uppercase;
}
.bqm-diff-easy { background-color: #4CAF50; }
.bqm-diff-medium { background-color: #ffad1f; color: #fff; }
.bqm-diff-hard { background-color: #F44336; }

/* --- Navigation --- */
.bqm-quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* --- Messages --- */
.bqm-message {
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #0073aa;
    background: #f1f8fc;
}
.bqm-message-error {
    border-left-color: #d63638;
    background: #fce9e9;
}
.bqm-message-warning {
    border-left-color: #ffb900;
    background: #fff8e5;
}
.bqm-limit-actions.bqm-limit-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 25px;
}
.bqm-limit-actions.bqm-limit-buttons a.bqm-btn {
    min-width: 200px;
    text-align: center;
}

/* --- Results --- */
#bqm-results-area {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}
.bqm-result-item {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    border-left: 5px solid #ccc;
    background: #f9f9f9;
}
.bqm-correct { border-left-color: #4CAF50; background-color: #e8f5e9; }
.bqm-wrong { border-left-color: #F44336; background-color: #ffebee; }
.bqm-unanswered { border-left-color: #ffb900; background-color: #fff8e5; }
.bqm-feedback-note.bqm-feedback-correct {
    color: #2e7d32;
    background: #e8f5e9;
    padding: 5px 10px;
    border-radius: 4px;
    margin-top: 5px;
    display: inline-block;
}

/* --- Membership Upgrade / Pricing Tables --- */
.bqm-pricing-grid {
    display: grid;
    /* Force grid to work on older browsers if possible, or use Flexbox fallback */
    display: -ms-grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.bqm-pricing-card {
    box-sizing: border-box; /* Critical for padding calculation */
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    /* Vendor Prefixes for Transitions */
    -webkit-transition: transform 0.3s ease, box-shadow 0.3s ease;
    -moz-transition: transform 0.3s ease, box-shadow 0.3s ease;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bqm-pricing-card:hover {
    transform: translateY(-5px);
    -webkit-transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: #0073aa;
}

/* Highlight for recommended/premium plans */
.bqm-pricing-card.featured {
    border: 2px solid #0073aa;
    background: #fdfdfd;
    /* Slight shadow for emphasis */
    box-shadow: 0 5px 15px rgba(0,115,170,0.1); 
}

.bqm-badge {
    background: #0073aa;
    color: #fff;
    padding: 5px 15px;
    font-size: 0.8em;
    text-transform: uppercase;
    font-weight: bold;
    position: absolute;
    top: 0;
    right: 0;
    border-bottom-left-radius: 10px;
    z-index: 1;
}

.bqm-pricing-header h3 {
    margin-top: 10px;
    font-size: 1.5em;
    color: #333;
    font-weight: 600;
}

.bqm-price {
    font-size: 2.5em;
    color: #0073aa;
    font-weight: bold;
    margin: 15px 0;
}
.bqm-price span {
    font-size: 0.4em;
    color: #777;
    font-weight: normal;
}

.bqm-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}
.bqm-features li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    font-size: 0.95em;
    color: #555;
}
.bqm-features li:last-child {
    border-bottom: none;
}
.bqm-features li::before {
    content: "✔";
    color: #4CAF50;
    margin-right: 10px;
    font-weight: bold;
}

/* Upgrade Form Styling */
.bqm-upgrade-form-container {
    margin-top: 40px;
    padding: 25px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
}
.bqm-payment-details {
    background: #fff;
    padding: 15px;
    border-left: 4px solid #0073aa;
    margin-bottom: 15px;
}

/* Login / Auth Forms */
.bqm-auth-form {
    background: #fff;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.bqm-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-top: 5px;
}