
/* =====================================================================
   Mock Test Pro — Frontend Styles v1.1
   ===================================================================== */

.mtp-wrapper * {
    box-sizing: border-box;
}

.mtp-wrapper {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

/* =====================================================================
   START SCREEN
   ===================================================================== */

.mtp-start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: #fff;
    text-align: center;
    min-height: 340px;
}

.mtp-start-icon {
    font-size: 52px;
    margin-bottom: 16px;
    line-height: 1;
}

.mtp-start-title {
    font-size: 26px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 24px;
    line-height: 1.3;
}

.mtp-start-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.mtp-start-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f0f4ff;
    border: 1.5px solid #d0d9ff;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #3a4a8a;
}

.mtp-start-btn {
    padding: 14px 48px;
    font-size: 17px;
    font-weight: 700;
    border-radius: 10px;
    letter-spacing: 0.3px;
}

/* =====================================================================
   TOP BAR
   ===================================================================== */

.mtp-top-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 56px;
}

.mtp-exam-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.mtp-exam-title {
    font-size: 17px;
    font-weight: 600;
}

.mtp-question-counter {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.mtp-timer-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 8px;
}

.mtp-timer-display .mtp-time {
    font-size: 22px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    min-width: 80px;
    text-align: center;
}

.mtp-time.mtp-warning { color: #ffd700; }
.mtp-time.mtp-danger  { color: #ff6b6b; animation: mtp-pulse 1s infinite; }

@keyframes mtp-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* =====================================================================
   PASSAGE
   ===================================================================== */

.mtp-passage {
    background: #fffbf0;
    border: 1.5px solid #f0c040;
    border-left: 5px solid #f0c040;
    border-radius: 0 8px 8px 0;
    padding: 18px 24px;
    margin: 0;
}

.mtp-passage-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #b8860b;
    margin-bottom: 10px;
}

.mtp-passage-text {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    max-height: 260px;
    overflow-y: auto;
}

/* =====================================================================
   QUESTION CONTENT (two-column: question | options)
   ===================================================================== */

.mtp-test-interface {
    background: #fff;
}

.mtp-question-content {
    padding: 24px 36px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: start;
    min-height: 260px;
}

.mtp-question-area {
    padding-right: 12px;
}

.mtp-question-number {
    color: #667eea;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mtp-marks-badge {
    background: #e3f2fd;
    color: #1565c0;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 600;
}

/* Question image */
.mtp-question-image {
    margin-bottom: 14px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    display: inline-block;
    max-width: 100%;
}

.mtp-question-image img {
    display: block;
    max-width: 100%;
    max-height: 260px;
    object-fit: contain;
}

.mtp-question-text {
    font-size: 16px;
    line-height: 1.75;
    color: #1d2327;
}

/* Options */
.mtp-options-area {
    padding-left: 16px;
    border-left: 2px solid #f0f0f0;
}

.mtp-options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mtp-option-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: #fafbfc;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    user-select: none;
}

.mtp-option-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateX(4px);
}

.mtp-option-item.mtp-selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102,126,234,0.08) 0%, rgba(118,75,162,0.08) 100%);
    box-shadow: 0 2px 12px rgba(102,126,234,0.18);
}

.mtp-option-radio {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid #aaa;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.mtp-option-item.mtp-selected .mtp-option-radio {
    border-color: #667eea;
    background: #667eea;
}

.mtp-option-item.mtp-selected .mtp-option-radio::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.mtp-option-label {
    font-weight: 700;
    color: #667eea;
    margin-right: 10px;
    min-width: 26px;
    font-size: 14px;
}

.mtp-option-text {
    flex: 1;
    line-height: 1.5;
    color: #333;
    font-size: 15px;
}

/* =====================================================================
   ACTION BAR
   ===================================================================== */

.mtp-action-bar {
    padding: 12px 36px;
    background: #fff;
    border-top: 2px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.mtp-left-actions,
.mtp-right-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mtp-btn {
    padding: 9px 18px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
    line-height: 1.2;
}

.mtp-btn:hover        { border-color: #667eea; background: #f0f4ff; }
.mtp-btn-primary      { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border: none; }
.mtp-btn-primary:hover { box-shadow: 0 4px 14px rgba(102,126,234,0.4); transform: translateY(-1px); }
.mtp-btn-mark         { background: #ff9800; color: white; border: none; }
.mtp-btn-mark:hover   { background: #f57c00; box-shadow: 0 4px 12px rgba(255,152,0,0.35); }
.mtp-btn-clear        { background: white; color: #555; border-color: #ccc; }
.mtp-btn-danger       { background: #e74c3c; color: white; border: none; }
.mtp-btn-danger:hover { background: #c0392b; box-shadow: 0 4px 12px rgba(231,76,60,0.35); }

/* =====================================================================
   QUESTION BLOCKS PALETTE (bottom)
   ===================================================================== */

.mtp-blocks-section { background: #fff; border-top: 3px solid #e0e0e0; }

.mtp-blocks-header {
    padding: 8px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: white;
    min-height: 40px;
}

.mtp-blocks-stats  { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; font-weight: 600; }
.mtp-blocks-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; font-weight: 600; }

.mtp-stat-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.2);
    padding: 3px 9px;
    border-radius: 4px;
}

.mtp-stat-dot    { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mtp-legend-item { display: flex; align-items: center; gap: 5px; }
.mtp-legend-box  { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

.mtp-blocks-container { padding: 10px 24px 14px; background: #fafbfc; }
.mtp-blocks-grid      { display: flex; flex-wrap: wrap; gap: 5px; }

/* Palette pagination nav */
.mtp-palette-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 24px;
    background: #f0f2f8;
    border-bottom: 1px solid #e0e0e0;
    flex-wrap: wrap;
}
.mtp-palette-nav-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #c5cae9;
    border-radius: 6px;
    background: white;
    color: #5c6bc0;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: background 0.15s, color 0.15s;
}
.mtp-palette-nav-btn:hover:not([disabled]) { background: #5c6bc0; color: white; }
.mtp-palette-nav-btn[disabled]             { opacity: 0.35; cursor: default; }
.mtp-palette-page-btn {
    height: 28px;
    padding: 0 10px;
    border: 1px solid #c5cae9;
    border-radius: 6px;
    background: white;
    color: #5c6bc0;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.mtp-palette-page-btn:hover { background: #e8eaf6; }
.mtp-palette-page-btn.mtp-palette-page-active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.mtp-q-block {
    width: 32px;
    height: 32px;
    border: 2px solid #ddd;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    background: white;
    color: #444;
    flex-shrink: 0;
}

.mtp-q-block:hover { transform: scale(1.2); box-shadow: 0 3px 10px rgba(0,0,0,0.2); z-index: 5; position: relative; }

.mtp-q-block.mtp-answered     { background: #4caf50; color: white; border-color: #4caf50; }
.mtp-q-block.mtp-not-answered { background: #e74c3c; color: white; border-color: #e74c3c; }
.mtp-q-block.mtp-marked       { background: #ff9800; color: white; border-color: #ff9800; }
.mtp-q-block.mtp-current {
    background: #667eea; color: white; border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.3);
    transform: scale(1.15);
}

/* =====================================================================
   RESULTS SCREEN
   ===================================================================== */

.mtp-results-screen { padding: 28px 36px; }

.mtp-results-header {
    text-align: center;
    padding: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 24px;
}

.mtp-result-score    { font-size: 64px; font-weight: bold; margin: 12px 0; line-height: 1; }
.mtp-result-status   { font-size: 20px; opacity: 0.9; }
.mtp-result-subtitle { font-size: 15px; opacity: 0.85; margin-top: 8px; }

.mtp-performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.mtp-perf-card {
    padding: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-align: center;
}

.mtp-perf-card h4 {
    color: #666;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mtp-perf-card .mtp-perf-value { font-size: 28px; font-weight: bold; }

/* Review list */
.mtp-question-review h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 14px;
    color: #1d2327;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.mtp-review-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: #fff;
}

.mtp-review-item.mtp-correct { border-left: 4px solid #4caf50; }
.mtp-review-item.mtp-wrong   { border-left: 4px solid #e74c3c; }
.mtp-review-item.mtp-skipped { border-left: 4px solid #9e9e9e; }

.mtp-review-qnum {
    font-size: 12px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mtp-outcome-badge {
    background: #f0f4ff;
    border: 1px solid #c7d3ff;
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 11px;
    color: #3a4a8a;
}

.mtp-review-image {
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    display: inline-block;
    max-width: 100%;
}

.mtp-review-image img {
    display: block;
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}

.mtp-review-qtext {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.6;
}

.mtp-review-answers {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 13px;
    margin-bottom: 0;
}

.mtp-your-answer  { color: #e74c3c; font-weight: 600; }
.mtp-right-answer { color: #4caf50; font-weight: 600; }

/* Passage toggle in review */
.mtp-review-passage { margin-bottom: 10px; }

.mtp-passage-toggle {
    font-size: 12px;
    font-weight: 600;
    background: #fffbf0;
    border: 1px solid #f0c040;
    color: #b8860b;
    border-radius: 5px;
    padding: 4px 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.mtp-passage-toggle:hover { background: #fff3c0; }

.mtp-passage-content {
    margin-top: 8px;
    background: #fffbf0;
    border-left: 4px solid #f0c040;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.7;
    color: #444;
    border-radius: 0 6px 6px 0;
    max-height: 200px;
    overflow-y: auto;
}

/* Solution box */
.mtp-solution-box {
    margin-top: 12px;
    background: #f0fff4;
    border: 1.5px solid #4caf50;
    border-left: 5px solid #4caf50;
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
}

.mtp-solution-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #2e7d32;
    margin-bottom: 8px;
}

.mtp-solution-text {
    font-size: 14px;
    line-height: 1.7;
    color: #1b5e20;
}

.mtp-results-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 28px;
    flex-wrap: wrap;
}

/* =====================================================================
   AUTO-ADVANCE PROGRESS BAR
   ===================================================================== */

.mtp-advance-bar {
    height: 4px;
    background: #e8eaf0;
    border-radius: 2px;
    margin-top: 14px;
    overflow: hidden;
}

.mtp-advance-progress {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.mtp-advance-progress.mtp-advancing {
    animation: mtp-advance-fill 0.9s linear forwards;
}

@keyframes mtp-advance-fill {
    from { width: 0%; }
    to   { width: 100%; }
}

/* =====================================================================
   SUBMIT OVERLAY / MODAL
   ===================================================================== */

.mtp-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 8px;
}

.mtp-modal {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.mtp-modal h3    { font-size: 20px; margin-bottom: 12px; color: #1d2327; }
.mtp-modal p     { color: #555; line-height: 1.6; margin-bottom: 6px; font-size: 14px; }

.mtp-modal-stat {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 12px;
    margin: 14px 0;
    font-size: 13px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mtp-modal-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */

@media (max-width: 820px) {
    .mtp-question-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .mtp-question-area { padding-right: 0; }

    .mtp-options-area {
        border-left: none;
        border-top: 2px solid #f0f0f0;
        padding-left: 0;
        padding-top: 14px;
    }

    .mtp-action-bar { padding: 12px 16px; flex-direction: column; }
    .mtp-left-actions, .mtp-right-actions { width: 100%; justify-content: space-between; }

    .mtp-top-bar { flex-direction: column; gap: 8px; padding: 10px 16px; }

    .mtp-result-score { font-size: 48px; }

    .mtp-start-screen { padding: 32px 20px; }
    .mtp-start-title  { font-size: 20px; }
}

@media (max-width: 480px) {
    .mtp-btn             { padding: 8px 12px; font-size: 12px; }
    .mtp-question-text   { font-size: 15px; }
    .mtp-passage-text    { font-size: 14px; }
    .mtp-start-btn       { padding: 12px 32px; font-size: 15px; }
    .mtp-start-meta-item { font-size: 13px; padding: 6px 12px; }
}

/* =====================================================================
   ANALYTICS DASHBOARD
   ===================================================================== */

.mtp-dashboard { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 960px; margin: 0 auto; padding: 0 8px 40px; }

.mtp-dash-title {
    font-size: 22px; font-weight: 700; color: #2d3748;
    border-bottom: 3px solid #667eea; padding-bottom: 10px; margin-bottom: 24px;
}
.mtp-dash-section-title { font-size: 16px; font-weight: 700; color: #4a5568; margin: 32px 0 12px; }
.mtp-dash-login-notice  { padding: 16px; background: #fff3cd; border-left: 4px solid #ffc107; border-radius: 4px; }
.mtp-dash-empty         { padding: 24px; text-align: center; color: #718096; background: #f7fafc; border-radius: 8px; }

/* Overview cards */
.mtp-dash-cards {
    display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px;
}
.mtp-dash-card {
    flex: 1 1 120px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 16px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.mtp-dash-card-value { font-size: 28px; font-weight: 800; color: #2d3748; line-height: 1; }
.mtp-dash-card-label { font-size: 11px; font-weight: 600; color: #718096; margin-top: 5px; text-transform: uppercase; letter-spacing: .5px; }

.mtp-dash-card-green  { border-top: 3px solid #48bb78; }
.mtp-dash-card-green  .mtp-dash-card-value { color: #276749; }
.mtp-dash-card-red    { border-top: 3px solid #fc8181; }
.mtp-dash-card-red    .mtp-dash-card-value { color: #9b2335; }
.mtp-dash-card-gray   { border-top: 3px solid #a0aec0; }
.mtp-dash-card-gray   .mtp-dash-card-value { color: #4a5568; }
.mtp-dash-card-purple { border-top: 3px solid #667eea; }
.mtp-dash-card-purple .mtp-dash-card-value { color: #4c51bf; }

/* Table */
.mtp-dash-table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid #e2e8f0; }
.mtp-dash-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.mtp-dash-table thead th {
    background: linear-gradient(135deg,#667eea,#764ba2);
    color: white; padding: 10px 14px; text-align: left; font-weight: 600; white-space: nowrap;
}
.mtp-dash-table tbody tr:nth-child(even) { background: #f7fafc; }
.mtp-dash-table tbody td { padding: 9px 14px; border-bottom: 1px solid #edf2f7; color: #4a5568; }
.mtp-dash-table tbody tr:last-child td { border-bottom: none; }
.mtp-dash-test-name { font-weight: 600; color: #2d3748; }

.mtp-dash-pct         { display: inline-block; padding: 2px 8px; border-radius: 12px; font-weight: 700; font-size: 12px; }
.mtp-dash-pct-green   { background: #c6f6d5; color: #276749; }
.mtp-dash-pct-orange  { background: #feebc8; color: #7b341e; }
.mtp-dash-pct-red     { background: #fed7d7; color: #9b2335; }

.mtp-dash-correct { color: #276749; font-weight: 600; }
.mtp-dash-wrong   { color: #9b2335; font-weight: 600; }
.mtp-dash-skipped { color: #718096; }
.mtp-dash-timeout { font-size: 11px; color: #e53e3e; }

/* Accordion */
.mtp-dash-details {
    border: 1px solid #e2e8f0; border-radius: 8px;
    margin-bottom: 10px; overflow: hidden;
}
.mtp-dash-details-summary {
    padding: 12px 16px; background: #f7fafc; cursor: pointer;
    font-weight: 600; color: #4a5568; font-size: 14px;
    display: flex; justify-content: space-between; align-items: center;
    list-style: none; user-select: none;
}
.mtp-dash-details-summary::-webkit-details-marker { display: none; }
.mtp-dash-details-summary::before { content: '▶'; font-size: 10px; margin-right: 8px; transition: transform .2s; color: #667eea; }
.mtp-dash-details[open] .mtp-dash-details-summary::before { transform: rotate(90deg); }
.mtp-dash-details-count { font-size: 11px; font-weight: 600; color: #a0aec0; margin-left: auto; }
.mtp-dash-table-inner { border-top: 1px solid #e2e8f0; border-radius: 0; }

@media (max-width: 600px) {
    .mtp-dash-card-value { font-size: 22px; }
    .mtp-dash-table { font-size: 12px; }
    .mtp-dash-table thead th, .mtp-dash-table tbody td { padding: 7px 9px; }
}
