/* QuizGen Custom Styles */

/* General Styles */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.card {
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
    font-weight: 600;
}

/* Header auth group
   The navbar is a flex row of <li> items; "stretch" plus an inline
   .navbar-text (8px vertical padding) and an inline-block .btn-sm (31px tall)
   leaves the button on a text baseline instead of the link's centre line.
   Make the auth <li> its own centred flex row so the email and the button
   share one axis whatever either one's height is. No fixed heights, no
   vertical margins: alignment must not depend on the button's height. */
.navbar-auth {
    display: flex;
    align-items: center;
    min-width: 0;
}

/* A long email truncates inside the row instead of wrapping the block (which
   would make it taller than the nav links) or pushing the button off screen. */
.navbar-auth .navbar-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The button keeps its intrinsic width and label, so a long email can only
   take space from the email itself. */
.navbar-auth .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* At ≥lg the nav is a row: centre every item on the same axis instead of
   stretching them, so no single label's height defines the axis. */
@media (min-width: 992px) {
    .navbar-nav {
        align-items: center;
    }
}

/* Quiz List Styles */
.quiz-card {
    height: 100%;
}

.quiz-card .card-body {
    display: flex;
    flex-direction: column;
}

/* Quiz card score badge — replaces inline style="font-size: 1.25em" */
.quiz-card__score-badge {
    font-size: 1.25em !important;
}

/* Quiz Taking Styles */
.question-card {
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.question-card.correct {
    border-left: 5px solid #28a745;
}

.question-card.incorrect {
    border-left: 5px solid #dc3545;
}

.answer-option {
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.answer-option:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
}

.answer-option.selected {
    background-color: #cfe2ff;
    border-color: #9ec5fe;
}

.answer-option.correct {
    background-color: #d1e7dd;
    border-color: #a3cfbb;
}

.answer-option.incorrect {
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

/* Regular matching styles with distinct class names */
.standard-matching-container .standard-matching-item {
    display: block;
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background-color: #f8f9fa;
    cursor: grab;
    user-select: none;
}

.standard-matching-container .standard-matching-item:active {
    cursor: grabbing;
}

.standard-matching-container .standard-matching-item.draggable {
    cursor: grab;
}

.standard-matching-container .standard-matching-item.dragging {
    opacity: 0.5;
}

.standard-matching-container .standard-drop-zone {
    min-height: 60px;
    border: 2px dashed #dee2e6;
    border-radius: 0.25rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.standard-matching-container .standard-definition-text {
    color: #212529;
    width: 100%;
}

.standard-matching-container .standard-drop-zone.highlight {
    border-color: #0d6efd;
    background-color: #e7f1ff;
}

.standard-matching-container .standard-drop-zone.correct-match {
    border-color: #28a745;
    background-color: #d1e7dd;
}

.standard-matching-container .standard-drop-zone.incorrect-match {
    border-color: #dc3545;
    background-color: #f8d7da;
}

.standard-matching-container .standard-left-items,
.standard-matching-container .standard-right-items {
    display: block;
}

/* Image matching styles with distinct class names */
.image-matching-container .image-matching-item {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background-color: #f8f9fa;
    cursor: grab;
    min-width: 50px;
    text-align: center;
    user-select: none;
}

.image-matching-container .image-matching-item:active {
    cursor: grabbing;
}

.image-matching-container .image-drop-zone {
    display: inline-block;
    min-width: 120px;
    min-height: 50px;
    border: 2px dashed #dee2e6;
    border-radius: 0.25rem;
    padding: 0.5rem;
    margin: 0.25rem;
    text-align: center;
    vertical-align: middle;
}

.image-matching-container .image-drop-zone .image-match-label {
    font-weight: 500;
    color: #6c757d;
}

.image-matching-container .image-drop-zone.highlight {
    border-color: #0d6efd;
    background-color: #e7f1ff;
}

.image-matching-container .image-drop-zone.correct-match {
    border-color: #28a745;
    background-color: #d1e7dd;
}

.image-matching-container .image-drop-zone.incorrect-match {
    border-color: #dc3545;
    background-color: #f8d7da;
}

.image-matching-container .image-left-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.image-matching-container .image-right-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Quiz Results Styles */
.progress-indicator {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.quiz-results {
    display: none;
}

/* Animations */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: #f00;
    border-radius: 50%;
    top: -10px;
    z-index: 9999;
    animation: fall 3s linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(100vh);
    }
}

/* CodeMirror Custom Styles */
.CodeMirror {
    height: auto;
    min-height: 300px;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    resize: vertical;
    overflow-y: auto !important;
    min-height: 200px;
    max-height: 800px;
}

/* Custom Buttons */
.btn {
    border-radius: 0.25rem;
    font-weight: 500;
}

.btn-primary, .btn-success, .btn-danger, .btn-warning {
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

/* Fix for dropdown menus in tables */
.table .dropdown-menu {
    position: absolute !important;
    transform: none !important;
    right: 0 !important;
    left: auto !important;
    top: 100% !important;
    z-index: 1050;
    min-width: 200px;
}

.table .dropdown {
    position: static;
}

.table td {
    position: relative;
}

/* Make regular textareas resizable */
textarea {
    resize: vertical !important;
    min-height: 150px;
}

/* Highlight marked for review count */
.marked-count {
    font-weight: bold;
    color: #ffc107;
}

/* Footer Styles */
.footer {
    margin-top: 3rem;
}

/* Score badge colors - Use background-color properties */
.badge.bg-success {
    background-color: #28a745 !important;
    color: #fff !important;
}

.badge.bg-light-green {
    background-color: #d4edda !important;
    color: #155724 !important;
}

.badge.bg-solid-green {
    background-color: #28a745 !important;
    color: #fff !important;
}

/* Dynamic Image Mapping Styles */
#mappingTable .id-field {
    font-weight: 500;
    text-align: center;
}

#mappingTable .label-field {
    min-width: 200px;
}

#mappingTable .delete-row {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

#mappingTable .delete-row:hover {
    opacity: 1;
}

.tab-pane .table-responsive {
    max-height: 400px;
    overflow-y: auto;
}

.tab-pane .alert {
    margin-bottom: 1rem;
}

.tab-pane .row .col-md-6 {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}
