/* css/style.css */
@import url('https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css');

:root {
    --blue: #3F72AF;
    --yellow: #DBE2EF;
    --dark: #112D4E;
    --light: #F9F7F7;
    --green: #28a745;
    --red: #dc3545;
    --purple: #6f42c1;

    --bg-color: #dfe3eb;
    --card-bg: #fbfbfb;
    --text-primary: #112D4E;
    --text-secondary: #555555;
    --border-color: #cfd7de;
    --header-bg: #112D4E;
    --hover-bg: #f3f4f6;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6, strong, b {
    color: var(--text-primary) !important;
}

.stat-label, p {
    color: var(--text-secondary) !important;
}

header {
    height: 60px;
    background: var(--header-bg);
    color: white !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-color);
}

#exam-title {
    font-weight: bold;
    font-size: 1.1rem;
    max-width: 35%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white !important;
}

.btn-header {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    margin-left: 5px;
}

.btn-pause { background: var(--yellow); color: #112D4E; }
.btn-exit  { background: var(--red); color: white; }

.btn-header-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: white !important;
}
.btn-header-outline:hover { background: rgba(255,255,255,0.1); }

.marks-badge {
    font-size: 0.8rem;
    background: #eef3f8;
    color: var(--dark) !important;
    padding: 5px 12px;
    border-radius: 4px;
    border: 1px solid #d0d7de;
    font-weight: bold;
    white-space: nowrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.btn-green  { background: var(--green); }
.btn-red    { background: var(--red); }
.btn-blue   { background: var(--blue); }
.btn-purple { background: var(--purple); }
.btn-orange { background: #fd7e14; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: bold;
}
.btn-outline:hover { background: var(--hover-bg); }

.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.exam-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--bg-color);
}

.q-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--card-bg);
}

.q-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary);
    touch-action: pan-y;
}

.q-footer {
    padding: 10px;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.opt-row {
    display: flex;
    padding: 12px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    align-items: flex-start;
    color: var(--text-primary);
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
    .opt-row:hover { background: var(--hover-bg); }
}

.opt-row.selected {
    background: var(--yellow);
    border-color: var(--blue);
    border-width: 2px;
    color: #333 !important;
}

.opt-row.correct {
    background: rgba(40,167,69,0.25) !important;
    border-color: var(--green) !important;
    color: var(--text-primary) !important;
}

.opt-row.wrong {
    background: rgba(220,53,69,0.25) !important;
    border-color: var(--red) !important;
    color: var(--text-primary) !important;
}

.solution-box {
    background: var(--bg-color);
    padding: 15px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--green);
    margin-top: 20px;
    border-radius: 5px;
    display: none;
    color: var(--text-primary);
}

#sidebar {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 280px;
    background: var(--card-bg);
    border-left: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-shadow: none;
}

#sidebar.open {
    transform: translateX(0);
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 15px;
    overflow-y: auto;
}

.pal-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-primary);
    background: var(--bg-color);
}

.view-result {
    display: none;
    justify-content: center;
    align-items: center;
    background: var(--bg-color);
    width: 100%; height: 100%;
    flex-direction: column;
    position: absolute;
    top: 0; left: 0;
    z-index: 100;
}

.view-result.active { display: flex; }

.score-card {
    text-align: center;
    padding: 30px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    overflow-y: auto;
    max-height: 95vh;
    color: var(--text-primary);
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin: 20px 0;
}

.stat-item {
    padding: 10px;
    border-radius: 5px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}

.stat-val { font-weight: bold; font-size: 1.2rem; color: var(--text-primary); }

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    margin-right: 12px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--blue); }
input:checked + .slider:before { transform: translateX(22px); }

#pause-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgb(0,0,0);
    z-index: 9999;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: 2px solid var(--blue);
    color: var(--blue);
    padding: 8px 16px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-btn:hover { background-color: var(--blue); color: white; }

.inst-container {
    background: var(--card-bg);
    max-width: 95%;
    margin: 20px auto;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.inst-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.inst-content {
    height: 60vh;
    overflow-y: auto;
    padding: 15px;
    margin-bottom: 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

.legend-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.legend-icon {
    width: 30px; height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    margin-right: 15px;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.l-not-visit { background: #e0e0e0; color: black; border-radius: 4px; }
.l-not-ans   { background: var(--red); color: white; border: none; }
.l-ans       { background: var(--green); color: white; border: none; }
.l-mark      { background: var(--purple); color: white; border: none; }
.l-ans-mark  { background: var(--purple); color: white; border: none; position: relative; }
.l-ans-mark::after {
    content: '✔';
    position: absolute;
    bottom: -2px; right: -2px;
    font-size: 10px;
    background: var(--green);
    color: white;
    border-radius: 50%;
    padding: 1px;
}

.footer-box {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.chk-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    user-select: none;
    color: var(--text-primary);
}

.chk-input { width: 18px; height: 18px; margin-right: 10px; }

.btn-start {
    width: 100%;
    margin-top: 15px;
    opacity: 0.5;
    pointer-events: none;
    transition: 0.3s;
    background-color: var(--blue);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 4px;
    font-weight: bold;
}

.btn-start.active { opacity: 1; pointer-events: auto; cursor: pointer; }

.feedback-badge {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: white !important;
    padding: 12px 30px;
    border-radius: 50px;
    margin: 20px auto;
    width: fit-content;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.feedback-badge:hover { transform: scale(1.05); }

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

.container {
    animation: fadeInUp 0.6s ease-out;
    padding-bottom: 80px;
}

.container h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 40px !important;
    text-align: center;
}

.container {
    padding-top: 20px !important;
}

.pal-rev-skipped {
    background-color: #d1d5db !important;
    color: #333333 !important;
    border: 1px solid #adb5bd !important;
}

.container h2 span {
    -webkit-text-fill-color: var(--text-primary) !important;
    color: var(--text-primary) !important;
    opacity: 0.6;
}

.q-extra-info table {
    width: 100%;
    max-width: 100%;
    margin: 15px 0;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--card-bg);
    color: var(--text-primary);
}

.q-extra-info th,
.q-extra-info td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: center;
}

.q-extra-info th {
    background-color: var(--blue);
    color: white;
    font-weight: bold;
}

.q-extra-info tr:nth-child(even) { background-color: rgba(0,0,0,0.05); }

@keyframes blink { 50% { opacity: 0.5; } }

#btn-report {
    display: inline-block;
    background-color: transparent;
    color: var(--red);
    border: 1px solid var(--red);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 10px;
    text-decoration: none;
}

#btn-report:hover {
    background-color: var(--red);
    color: white;
    box-shadow: 0 2px 5px rgba(220,53,69,0.4);
    transform: translateY(-1px);
}

.timer {
    font-family: 'Segoe UI', Roboto, Helvetica, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    min-width: auto;
}

.timer-icon { font-size: 1.1rem; margin-right: 8px; opacity: 0.8; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

.timer.warning { color: #ff6b6b; animation: none; }
.timer-container.warning-bg { border-color: #ff6b6b; background: rgba(255,0,0,0.1); }

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    height: 60px;
    width: 100%;
}

.header-right-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.timer-container {
    position: static !important;
    transform: none !important;
    margin: 0;
    background: rgba(255,255,255,0.1);
    padding: 5px 15px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

#exam-title {
    display: block !important;
    font-size: 1.1rem;
    font-weight: bold;
    color: white !important;
    max-width: 40%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 500px) {
    .header-right-group { gap: 8px; }
    .timer-container { padding: 4px 10px; }
    .timer { font-size: 1rem; }
    .timer-icon { display: none; }
    #exam-title { font-size: 0.9rem; max-width: 35%; }
}

.q-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 15px auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.img-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    padding-top: 50px;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    background-color: #ffffff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation-name: zoom;
    animation-duration: 0.3s;
}

@keyframes zoom {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

.close-modal {
    position: absolute;
    top: 15px; right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-modal:hover { color: #bbb; }

@media only screen and (max-width: 700px) {
    .modal-content { width: 100%; }
}

.btn-filter {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
}

.btn-filter:hover { background: var(--hover-bg); transform: translateY(-1px); }
.btn-filter.active { background: var(--blue); color: white; border-color: var(--blue); }

.filter-dropdown {
    display: none;
    position: absolute;
    right: 0; top: 45px;
    width: 220px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 100;
    flex-direction: column;
}

.filter-dropdown.show { display: flex; }

.filter-list { max-height: 250px; overflow-y: auto; padding: 10px; }

.filter-option {
    padding: 8px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 5px;
    transition: 0.2s;
    background: var(--bg-color);
    border: 1px solid transparent;
}

.filter-option:hover { background: var(--hover-bg); }

.filter-option.selected {
    background: rgba(63,114,175,0.15);
    color: var(--blue);
    border-color: var(--blue);
    font-weight: bold;
}

.btn-clear-filter {
    width: 100%;
    background: linear-gradient(135deg, #dc3545, #c82333);
    border: none;
    color: white;
    padding: 12px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 0 0 8px 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 -2px 10px rgba(220,53,69,0.3);
}

.btn-clear-filter:hover {
    background: linear-gradient(135deg, #e4606d, #dc3545);
    box-shadow: 0 0 20px rgba(220,53,69,0.6);
}

.section-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: var(--bg-color);
    border-bottom: 2px solid var(--border-color);
}

.sec-btn {
    padding: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.sec-btn:hover { background: var(--hover-bg); }
.sec-btn.active { background: var(--blue); color: white; border-color: var(--blue); box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.sec-btn.locked { opacity: 0.6; background: #eee; color: #999; cursor: not-allowed; }
.sec-badge { font-size: 0.75rem; background: rgba(0,0,0,0.1); padding: 2px 6px; border-radius: 4px; }

.review-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    padding: 10px 0;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.badges-group { display: flex; gap: 10px; }

.pro-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.toggle-group { display: flex; align-items: center; gap: 10px; }
.toggle-label { font-size: 0.9rem; font-weight: 600; color: var(--text-primary) !important; }

@media (max-width: 500px) {
    .review-toolbar { flex-direction: column; align-items: flex-start; gap: 10px; }
    .toggle-group { width: 100%; justify-content: space-between; }
}

body { transition: none !important; }

::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 9999; }

.pause-title { color: #ffffff !important; margin-bottom: 10px; }
.pause-msg   { color: #cccccc !important; margin-bottom: 30px; }

#pause-overlay { background: rgb(255,255,255); }

.score-card .btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-bottom: 12px;
}

.score-card .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 15px rgba(0,0,0,0.15); }

.btn-orange {
    background: linear-gradient(135deg, #faa538, #e65100);
    color: white;
    box-shadow: 0 4px 15px rgba(230,81,0,0.2);
}

.btn-orange:hover {
    background: linear-gradient(135deg, #ffb74d, #f57c00);
    box-shadow: 0 8px 20px rgba(230,81,0,0.3);
}

.btn-blue {
    background: linear-gradient(135deg, #3F72AF, #112D4E);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    box-shadow: none;
}

.btn-outline:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: var(--hover-bg);
    transform: translateY(-1px);
}

.header-section { text-align: center; margin-bottom: 40px; }

.app-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #3F72AF, #6f42c1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.beta-badge {
    background: linear-gradient(135deg, #ff9966, #ff5e62);
    color: white !important;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(255,94,98,0.3);
    display: inline-block;
    -webkit-text-fill-color: white !important;
    text-shadow: none;
}

.subtitle { font-size: 1rem; color: var(--text-secondary); margin-top: 0; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}

.subject-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card-content { display: flex; align-items: center; }
.text-group { display: flex; flex-direction: column; }
.text-group strong { font-size: 1.1rem; margin-bottom: 4px; }
.sub-text { font-size: 0.85rem; color: var(--text-secondary); opacity: 0.8; }

.icon-box {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    margin-right: 15px;
    background: rgba(63,114,175,0.1);
    transition: background 0.3s ease;
}

.arrow-icon {
    font-size: 1.2rem;
    color: var(--border-color);
    transition: transform 0.3s ease, color 0.3s ease;
}

.subject-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); border-color: var(--blue); }
.subject-card:hover .icon-box { background: var(--blue); color: white; }
.subject-card:hover .arrow-icon { color: var(--blue); transform: translateX(5px); }

.footer-tip {
    margin-top: 50px;
    padding: 15px;
    background: rgba(63,114,175,0.05);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.title-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.app-title { margin-bottom: 0 !important; }
.card-content strong { margin-bottom: 0 !important; font-size: 1.1rem; }

.list-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.text-area { display: flex; flex-direction: column; }

#list-title {
    font-size: 1.8rem;
    margin: 0;
    background: linear-gradient(135deg, #3F72AF, #6f42c1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.list-subtitle { font-size: 0.9rem; color: var(--text-secondary) !important; margin: 5px 0 0 0; }

.test-list-grid { display: flex; flex-direction: column; gap: 15px; width: 100%; }

.test-card-modern {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.test-card-modern:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); border-color: var(--blue); }

.tc-left { display: flex; align-items: center; gap: 15px; flex: 1; }

.tc-icon {
    width: 45px; height: 45px;
    background: rgba(63,114,175,0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.tc-info { display: flex; flex-direction: column; }
.tc-title { font-weight: 700; font-size: 1rem; color: var(--text-primary); margin-bottom: 3px; }
.tc-status { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

.btn-action {
    padding: 10px 24px;
    border-radius: 50px;
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: transform 0.2s;
    color: white;
    flex-shrink: 0;
    margin-left: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.btn-action:hover { transform: scale(1.05); }

.btn-list-start {
    background: linear-gradient(135deg, #00b09b, #96c93d);
    opacity: 1 !important;
    box-shadow: 0 0 15px rgba(0,176,155,0.6);
    border: 1px solid rgba(255,255,255,0.2);
}

.test-card-modern:hover .btn-list-start { box-shadow: 0 0 25px rgba(0,176,155,0.9); transform: scale(1.05); }

.btn-result {
    background: linear-gradient(135deg, #3F72AF, #112D4E);
    opacity: 1 !important;
    box-shadow: 0 4px 15px rgba(63,114,175,0.3);
}

@media (max-width: 500px) {
    .test-card-modern { padding: 15px; }
    .tc-icon { width: 38px; height: 38px; font-size: 1.1rem; }
    .btn-action { padding: 6px 14px; font-size: 0.7rem; }
    .tc-title { font-size: 0.95rem; }
}

body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

@media (min-width: 600px) { .modal-overlay { align-items: center; } }

.modal-content {
    background: var(--card-bg);
    width: 100%;
    max-width: 400px;
    padding: 25px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 1px solid var(--border-color);
}

.btn-modal {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    position: relative;
    overflow: hidden;
    color: white;
}

.btn-modal:active { transform: scale(0.98); }
.btn-sectional { background: linear-gradient(135deg, #3F72AF, #112D4E); box-shadow: 0 4px 15px rgba(63,114,175,0.3); }
.btn-topic { background: linear-gradient(135deg, #6f42c1, #4a2c85); box-shadow: 0 4px 15px rgba(111,66,193,0.3); }
.btn-icon { font-size: 1.5rem; margin-bottom: 5px; }
.btn-modal small { font-size: 0.75rem; opacity: 0.8; font-weight: 400; margin-top: 2px; display: block; }

.btn-text-close {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: white !important;
    border: none;
    font-weight: bold;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 15px;
    width: 100%;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 0 15px rgba(220,53,69,0.5);
    transition: all 0.3s ease;
}

.btn-text-close:hover {
    background: linear-gradient(135deg, #e4606d, #dc3545) !important;
    box-shadow: 0 0 25px rgba(220,53,69,0.8);
    transform: translateY(-2px);
}

.tag-badge {
    background-color: rgba(63,114,175,0.15);
    color: var(--blue);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 5px;
    text-transform: uppercase;
}

.pal-btn-current {
    border: 2px solid #3F72AF !important;
    box-shadow: 0 0 0 3px rgba(63,114,175,0.2) !important;
    font-weight: 700;
    position: relative;
}

.btn-resume {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%) !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(74,144,226,0.3) !important;
    border: none !important;
}

.btn-resume:hover {
    background: linear-gradient(135deg, #357abd 0%, #2a5f99 100%) !important;
    box-shadow: 0 6px 15px rgba(74,144,226,0.4) !important;
    transform: translateY(-1px);
}

.tc-metadata {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    margin-bottom: 4px;
    font-weight: 500;
    line-height: 1.4;
}

.main-dashboard { max-width: 1200px !important; }

#selection-modal.modal-overlay,
#selection-modal .modal-content,
.modal-overlay .modal-content,
.modal-content {
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
    animation: none !important;
}

#sol-text .katex { font-size: 1.1em !important; color: var(--text-primary); }
#sol-text .katex-display { margin: 1em 0; text-align: center; }

.list-view-container { max-width: 800px !important; padding-top: 20px !important; }
