.lwa-quiz-wrapper {
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.lwa-quiz-inner {
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Header */
.lwa-quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    margin: 0 0 1rem 0;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

.lwa-quiz-header-results {
    margin-bottom: 1.5rem;
}

.lwa-quiz-title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.lwa-quiz-meta {
    margin-top: 0.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    font-size: 0.8rem;
    align-items: center;
}

.lwa-quiz-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    background: #f5f5f5;
}

.lwa-icon-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #2e7d32;
}

.lwa-quiz-meta-label {
    opacity: 0.7;
}

.lwa-quiz-meta-value {
    font-weight: 600;
}

/* Timer & header buttons */
.lwa-quiz-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lwa-quiz-timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
}

/* Pill-shaped timer with red outline */
.lwa-quiz-timer-pill {
    border-radius: 999px;
    padding: 0.25rem 0.9rem;
    border: 2px solid #c62828;
    background: #ffffff;
    min-width: 110px;
    text-align: center;
}

.lwa-quiz-timer-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #c62828;
}

/* Start test button – green pill like timer */
.lwa-quiz-start-btn {
    border-radius: 999px;
    padding: 0.35rem 1.1rem;
    border: 2px solid #2e7d32;
    background: #ffffff;
    color: #2e7d32;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

/* Top submit button (header) – initially hidden & disabled */
.lwa-quiz-submit-top {
    display: none;
    border-radius: 999px;
    padding: 0.35rem 1.1rem;
    border: 2px solid #888;
    background: #f5f5f5;
    color: #888;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: not-allowed;
    white-space: nowrap;
}

/* Enabled state for header submit */
.lwa-quiz-submit-top.enabled {
    border-color: #2e7d32;
    color: #2e7d32;
    background: #ffffff;
    cursor: pointer;
}

/* Rules panel */
.lwa-quiz-rules {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
}

.lwa-quiz-rules-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.lwa-quiz-rules-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.9rem;
}

.lwa-quiz-rules-list li {
    margin-bottom: 0.25rem;
}

/* Form layout */
.lwa-quiz-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* Question area */
.lwa-quiz-questions {
    margin-top: 1rem;
    position: relative;
    min-height: 260px;
    width: 100%;
    box-sizing: border-box;
}

/* Question box */
.lwa-quiz-question {
    width: 100%;
    max-width: 100%;
    margin: 0 0 0.75rem 0;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    background: #fff;
    box-sizing: border-box;
}

.lwa-quiz-question-inner {
    width: 100%;
    box-sizing: border-box;
}

/* Question header */
.lwa-quiz-question-header {
    margin-bottom: 0.75rem;
}

.lwa-quiz-question-topline {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.lwa-quiz-question-number {
    font-weight: 800;
    font-size: 1.15rem;
    color: #222;
}

.lwa-quiz-question-category {
    font-size: 0.8rem;
    opacity: 0.7;
    text-align: right;
}

.lwa-quiz-question-text {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.lwa-quiz-question-image {
    margin: 0.5rem 0 0.75rem;
    text-align: center;
}

.lwa-quiz-question-image img {
    max-width: 100%;
    height: auto;
}

/* Answers grid */
.lwa-quiz-answers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.6rem;
}

@media (max-width: 600px) {
    .lwa-quiz-answers {
        grid-template-columns: 1fr;
    }
}

.lwa-quiz-answer {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    border-radius: 999px;
    border: 1px solid #ccc;
    padding: 0.25rem 0.55rem;
    cursor: pointer;
    font-size: 0.9rem;
    background: #fafafa;
    transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
    max-width: 100%;
    box-sizing: border-box;
}

.lwa-quiz-answer input[type="radio"] {
    margin: 0.25rem 0.35rem 0.25rem 0.25rem;
}

.lwa-quiz-answer-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
}

.lwa-quiz-answer-letter {
    font-weight: 600;
    font-size: 0.9rem;
}

.lwa-quiz-answer-text {
    flex: 1;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: break-word;
}

/* Selected state */
.lwa-quiz-answer.selected {
    border-color: #2e7d32;
    background: #e8f5e9;
    box-shadow: 0 0 0 1px rgba(46,125,50,0.2);
}

/* Pagination nav */
.lwa-quiz-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    gap: 0.75rem;
}

.lwa-quiz-nav-btn {
    border-radius: 999px;
    padding: 0.45rem 1.4rem;
    border: 2px solid #f4a300;
    background: #fff;
    color: #f4a300;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

.lwa-quiz-nav-btn:hover {
    opacity: 0.85;
}

.lwa-quiz-nav-btn[disabled] {
    opacity: 0.4;
    border-color: #ccc;
    color: #ccc;
    cursor: default;
}

.lwa-quiz-nav-status {
    font-size: 1.35rem !important;
    font-weight: 800 !important;
    color: #111 !important;
    letter-spacing: 0.3px;
}

/* Try again button on results */
.lwa-quiz-submit-wrap {
    text-align: center;
    margin-top: 1.25rem;
}

.lwa-quiz-try-again {
    display: inline-block;
    padding: 0.6rem 1.6rem;
    border-radius: 999px;
    border: 2px solid #222;
    background: #222;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.lwa-quiz-try-again:hover {
    opacity: 0.9;
}

/* Notices */
.lwa-quiz-notice {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-radius: 4px;
}

.lwa-quiz-notice-error {
    background: #ffe5e5;
    border-left: 4px solid #e53935;
}

.lwa-quiz-notice-success {
    background: #e8f5e9;
    border-left: 4px solid #2e7d32;
}

/* Results */
.lwa-quiz-results-summary {
    margin-bottom: 1rem;
}

.lwa-quiz-result-pass {
    color: #2e7d32;
    font-weight: 600;
}

.lwa-quiz-result-fail {
    color: #c62828;
    font-weight: 600;
}

.lwa-quiz-results-details {
    margin-top: 1rem;
}

.lwa-quiz-results-details summary {
    cursor: pointer;
    font-weight: 600;
}

.lwa-quiz-results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.lwa-quiz-results-table th,
.lwa-quiz-results-table td {
    border: 1px solid #ddd;
    padding: 0.4rem 0.5rem;
    vertical-align: top;
}

.lwa-quiz-row-correct {
    background: #e8f5e9;
}

.lwa-quiz-row-incorrect {
    background: #ffebee;
}

/* Responsive */
@media (max-width: 700px) {
    .lwa-quiz-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .lwa-quiz-header-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .lwa-quiz-question-topline {
        flex-direction: column;
        align-items: flex-start;
    }

    .lwa-quiz-question-category {
        text-align: left;
    }
}

/* Panels under quiz (stats, attempts, leaderboard, test details) */
.lwa-quiz-panel {
    padding: 0.75rem 1rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-sizing: border-box;
}

.lwa-quiz-panel h2 {
    margin-top: 0;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* Style ONLY the Test Details panel to blend with widget border */
.lwa-quiz-panel-test-details {
    border: none;
    border-radius: 12px;
    padding: 1rem 0;
    background: transparent;
    box-sizing: border-box;
}

.lwa-quiz-panel-test-details form p {
    margin-bottom: 0.6rem;
}

.lwa-quiz-panel-test-details label {
    font-size: 0.9rem;
}

.lwa-quiz-panel-test-details input[type="date"],
.lwa-quiz-panel-test-details input[type="text"] {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid #ccc;
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.lwa-quiz-panel-test-details button {
    border-radius: 999px;
    padding: 0.4rem 1.2rem;
    border: 2px solid #2e7d32;
    background: #2e7d32;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.lwa-quiz-panel-test-details button:hover {
    opacity: 0.9;
}

/* Green pill Edit details button */
.lwa-quiz-test-details-edit {
    display: inline-block;
    padding: 8px 22px;
    border-radius: 999px;
    background: #fff !important;
    color: #3abf00 !important;
    font-weight: 700 !important;
    border: 2px solid #3abf00 !important;
    cursor: pointer;
    font-size: 0.95rem;
    transition: 0.2s ease-in-out;
}

.lwa-quiz-test-details-edit:hover {
    background: #3abf00 !important;
    color: #fff !important;
}

.lwa-quiz-question-inner .lwa-quiz-navigation { margin-top:25px; }

/* Increase gap between answers and navigation inside question box */
.lwa-quiz-question-inner .lwa-quiz-answers {
    margin-bottom: 24px;
}
.lwa-quiz-question-inner .lwa-quiz-navigation {
    margin-top: 24px; /* ensure spacing in case margin-bottom is overridden */
}

/* Unified button styling for theory test details */
.lwa-quiz-panel-test-details button,
.lwa-quiz-panel-test-details input[type="submit"] {
    background: #1FAF54;
    color: #fff;
    border: none;
    border-radius: 40px;
    padding: 10px 26px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
    transition: 0.2s ease;
    text-align: center;
}
.lwa-quiz-panel-test-details button:hover,
.lwa-quiz-panel-test-details input[type="submit"]:hover {
    background: #159645;
}
.lwa-quiz-panel-test-details .lwa-quiz-test-details-actions {
    width: 100%;
    text-align: center;
    margin-top: 15px;
}
.lwa-quiz-test-details button:focus,
.lwa-quiz-test-details input[type="submit"]:focus {
    outline: none;
    box-shadow: none;
}

/* Enhance theory test details panel styling */
.lwa-quiz-panel-test-details {
    position: relative;
}

/* Shared row layout for date/centre */
.lwa-quiz-panel-test-details .lwa-quiz-test-details-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Icons beside labels/date/centre */
.lwa-quiz-test-details-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(31, 175, 84, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    flex-shrink: 0;
}

/* Simple icon shapes using pseudo elements */
.lwa-quiz-icon-calendar::before {
    content: "\1F4C5"; /* calendar emoji */
}
.lwa-quiz-icon-location::before {
    content: "\1F4CD"; /* location pin emoji */
}

/* Countdown badge */
.lwa-quiz-test-countdown {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lwa-quiz-test-countdown-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(31, 175, 84, 0.08);
    border: 1px solid rgba(31, 175, 84, 0.3);
    font-weight: 700;
    font-size: 16px;
}

.lwa-quiz-test-countdown-label {
    font-weight: 500;
    font-size: 13px;
    text-transform: lowercase;
}

.lwa-quiz-test-countdown-text {
    font-size: 14px;
}

/* Animate button hover (subtle lift + shadow) */
.lwa-quiz-panel-test-details button,
.lwa-quiz-panel-test-details input[type="submit"] {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.lwa-quiz-panel-test-details button:hover,
.lwa-quiz-panel-test-details input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Center actions container if not already */
.lwa-quiz-panel-test-details .lwa-quiz-test-details-actions {
    display: flex;
    justify-content: center;
}

/* "Take another test" button styled like timer pill */
.lwa-quiz-submit-wrap {
    margin-top: 1.25rem;
    text-align: center;
}

.lwa-quiz-try-again {
    display: inline-block;
    border-radius: 999px;
    padding: 0.45rem 1.4rem;
    border: 2px solid #1FAF54;
    background: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s ease-in-out;
}

.lwa-quiz-try-again:hover {
    background: #1FAF54;
    color: #ffffff;
}

/* Email results note styling and layout within rules */
.lwa-quiz-rules {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Ensure title, email note, and rules list appear in the right order */
.lwa-quiz-rules-title {
    order: 0;
}
.lwa-quiz-email-note {
    order: 1;
}
.lwa-quiz-rules-list {
    order: 2;
}

/* Email note block styling */
.lwa-quiz-email-note {
    background: #ffffff;
    border-radius: 16px;
    padding: 12px 16px 14px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    margin: 4px 0 2px;
}

/* Label text */
.lwa-quiz-email-note label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

/* Email input styling */
.lwa-quiz-email-note input[type="email"] {
    width: 100%;
    max-width: 320px;
    padding: 8px 14px;
    font-size: 15px;
    border-radius: 40px;
    border: 1px solid #d0d0d0;
    outline: none;
    transition: 0.18s ease-in-out;
}

/* Focus state */
.lwa-quiz-email-note input[type="email"]:focus {
    border-color: #1FAF54;
    box-shadow: 0 0 0 3px rgba(31,175,84,0.18);
}
