/* Quiz specific styles */
.input-container {
    position: relative;
    margin-bottom: 1rem;
}

.question-container {
    background-color: var(--bs-dark);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--bs-border-color);
    border-left: 5px solid var(--bs-primary);
}

.answer-container {
    background-color: var(--bs-dark);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--bs-border-color);
    border-left: 5px solid var(--bs-success);
}

.input-overlay {
    position: absolute;
    top: 1px;  /* Account for border */
    left: 1px;  /* Account for border */
    right: 1px;  /* Account for border */
    bottom: 1px;  /* Account for border */
    padding: 0.375rem 0.75rem;  /* Match Bootstrap's form-control padding */
    pointer-events: none;
    font-family: var(--bs-font-monospace);
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-y: auto;
    box-sizing: border-box;
    transition: opacity 0.3s ease;
    transform: translateZ(0);  /* Hardware acceleration for crisp rendering */
    -webkit-font-smoothing: antialiased;  /* Improve text rendering */
}

.input-container textarea {
    background: transparent !important;
    position: relative;
    z-index: 1;
    font-family: var(--bs-font-monospace);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--bs-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    resize: none;
    min-height: calc(1.5em + 0.75rem + 2px);
    height: auto;
    padding: 0.375rem 0.75rem;  /* Match overlay padding */
    box-sizing: border-box;
}

/* Styling for typed/untyped text */
.typed-text {
    color: var(--bs-primary);
}

.untyped-text {
    color: var(--bs-secondary);
    opacity: 0.7;
}

.incorrect-text {
    color: var(--bs-danger);
    text-decoration: underline wavy var(--bs-danger);
}

.text-correct {
    color: var(--bs-success);
    font-weight: bold;
}

.text-incorrect {
    color: var(--bs-danger);
    text-decoration: underline wavy var(--bs-danger);
}

.text-remaining {
    color: var(--bs-secondary);
    opacity: 0.6;
}

.question-container .input-overlay {
    color: var(--bs-primary);
    opacity: 0.5;  /* Increased from 0.3 */
    font-weight: 500;
}

.answer-container .input-overlay {
    color: var(--bs-success);
    opacity: 0.5;  /* Increased from 0.2 */
    font-weight: 500;
}

.phase-indicators {
    display: flex;
    justify-content: space-between;
    max-width: 400px;
    margin: 0 auto;
}

.phase-pill {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background-color: var(--bs-secondary);
    color: var(--bs-white);
    font-size: 0.85rem;
    text-transform: capitalize;
    transition: all 0.3s ease;
}

.phase-pill.active {
    background-color: var(--bs-primary);
    font-weight: 500;
}

.badge.active {
    background-color: var(--bs-primary) !important;
}

/* Progress text and bar styles */
.progress-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--bs-light);
}

/* Progress bar animation */
@keyframes progress-bar-stripes {
  0% { background-position-x: 1rem; }
}

.progress-bar {
    background-image: linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, 
                      transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, 
                      transparent 75%, transparent);
    background-size: 1rem 1rem;
    transition: width 0.6s ease-in-out;
    background-color: var(--bs-success);
    box-shadow: 0 0 8px rgba(25, 135, 84, 0.5);
}

.progress-bar.animated {
    animation: progress-bar-stripes 1s linear infinite;
}

.progress.question-complete .progress-bar {
    animation: pulse 1.5s ease-in-out;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(25, 135, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0); }
}

.lesson-text {
    white-space: pre-wrap;
    font-family: var(--bs-font-sans-serif);
    background: var(--bs-dark);
    padding: 1rem;
    border-radius: 0.375rem;
    margin: 0;
}

.quiz-card {
    min-height: 300px;
}

.quiz-controls {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.quiz-controls button#backButton {
    transition: all 0.3s ease;
}

.quiz-controls button#backButton:hover {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    transform: translateX(-5px);
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.5);
}

.progress-container {
    max-width: 600px;
    margin: 0 auto;
}

/* Feedback styles */
.correct-answer {
    color: var(--bs-success);
    font-weight: bold;
}

.incorrect-answer {
    color: var(--bs-danger);
    font-weight: bold;
}

/* Drop Zone styles */
.drop-zone {
    border: 2px dashed var(--bs-border-color);
    transition: all 0.3s ease;
    background: var(--bs-dark);
    cursor: pointer;
}

.drop-zone-active {
    border-color: var(--bs-primary);
    background: var(--bs-dark-bg-subtle);
}

.drop-zone .drop-zone-prompt {
    color: var(--bs-secondary);
}

.drop-zone-active .drop-zone-prompt {
    color: var(--bs-primary);
}

.drop-zone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

/* File Info styles */
#fileInfo .alert {
    border-color: var(--bs-dark-border-subtle);
}

#fileName {
    font-weight: 500;
}

/* Multi-file upload progress styles */
.progress-sm {
    height: 0.375rem;
}

.file-status {
    font-size: 0.75rem;
    font-weight: 500;
}

#fileProgressContainer .progress {
    background-color: var(--bs-dark-border-subtle);
}

#fileProgressContainer .progress-bar {
    transition: width 0.3s ease;
}

#fileProgressContainer .fa-spin {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sidebar styles */
.sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    border-right: 1px solid var(--bs-border-color);
    overflow-y: auto;
    background-color: var(--bs-dark);
    z-index: 1000;
}

.main-content {
    margin-left: 280px;
    min-height: 100vh;
    padding: 2rem;
    background-color: var(--bs-body-bg);
}

.lesson-list {
    overflow-y: auto;
    max-height: calc(100vh - 70px); /* Account for header */
}

.lesson-item {
    cursor: pointer;
    background: var(--bs-dark);
    border: 1px solid var(--bs-border-color);
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.375rem;
}

.lesson-item:hover {
    background: var(--bs-dark-bg-subtle);
    border-color: var(--bs-primary);
}

.lesson-item .lesson-title {
    font-weight: 500;
    color: var(--bs-light);
    display: block;
    margin-bottom: 0.25rem;
}

.lesson-item:hover .lesson-title {
    color: var(--bs-primary);
}

.lesson-item .lesson-date {
    font-size: 0.875rem;
    color: var(--bs-secondary);
}

/* Lesson actions styling */
.lesson-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lesson-actions .btn {
    padding: 2px 4px;
    font-size: 12px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.lesson-actions .btn:hover {
    transform: scale(1.1);
}

/* Edit input styling */
.edit-title-input {
    background: #1a1a1a;
    border: 1px solid #007bff;
    color: #fff;
    font-size: 14px;
    max-width: 200px;
}

.edit-title-input:focus {
    background: #1a1a1a;
    border-color: #0056b3;
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Lesson content styles */
.lesson-text {
    white-space: pre-wrap;
    font-family: var(--bs-font-sans-serif);
    background: var(--bs-dark);
    padding: 1rem;
    border-radius: 0.375rem;
    margin: 0;
}

/* Flashcard styles */
.flashcards-container {
    max-width: 800px;
    margin: 0 auto;
}

.flashcard-scene {
    width: 100%;
    height: 300px;
    perspective: 1000px;
    margin-bottom: 2rem;
}

.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    background-color: var(--bs-dark);
    border: 1px solid var(--bs-border-color);
}

.flashcard-back {
    transform: rotateY(180deg);
    background-color: var(--bs-dark);
}

.flashcard-content {
    font-size: 1.5rem;
    text-align: center;
    padding: 1rem;
    max-width: 100%;
    max-height: 100%;
    overflow: auto;
}

/* Jeopardy styles */
.jeopardy-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.jeopardy-category {
    text-align: center;
    background-color: var(--bs-primary);
    color: white;
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.jeopardy-tile {
    background-color: var(--bs-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    border-radius: 0.375rem;
    font-weight: bold;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.jeopardy-tile:hover {
    transform: scale(1.03);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.jeopardy-tile.completed {
    background-color: var(--bs-dark);
    color: var(--bs-secondary);
    cursor: default;
    opacity: 0.7;
}

.jeopardy-question {
    font-size: 1.25rem;
    font-weight: 500;
}

.jeopardy-answer {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--bs-success);
}

/* Crossword styles */
.crossword-grid {
    display: grid;
    grid-template-columns: repeat(15, 2.5rem);
    grid-template-rows: repeat(15, 2.5rem);
    gap: 2px;
    margin-bottom: 2rem;
}

.crossword-cell {
    width: 100%;
    height: 100%;
    position: relative;
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-dark);
}

.crossword-cell.filled {
    background-color: var(--bs-white);
}

.crossword-cell.black {
    background-color: black;
}

.crossword-cell.highlighted {
    background-color: var(--bs-primary-bg-subtle);
}

.cell-input {
    position: absolute;
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 1.25rem;
    font-weight: bold;
    background: transparent;
    color: var(--bs-body-color);
    text-transform: uppercase;
    z-index: 2;
}

.cell-input:focus {
    outline: 2px solid var(--bs-primary);
}

.cell-number {
    position: absolute;
    top: 0.1rem;
    left: 0.2rem;
    font-size: 0.7rem;
    z-index: 1;
}

.clue-list {
    list-style-type: none;
    padding-left: 0;
}

.clue-item {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
}

.clue-item:hover {
    background-color: var(--bs-dark-bg-subtle);
}

.clue-item.selected {
    background-color: var(--bs-primary-bg-subtle);
    font-weight: 500;
}

/* Final Test Styles */
.final-test-question {
    background-color: var(--bs-dark);
    border: 1px solid var(--bs-border-color);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.final-test-question:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.final-test-question .card-header {
    background-color: var(--bs-dark-bg-subtle);
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0.75rem 1rem;
}

.final-test-answer {
    background-color: var(--bs-dark-bg-subtle) !important;
    color: var(--bs-light) !important;
    border: 1px solid var(--bs-border-color);
    font-family: var(--bs-font-monospace);
}

.final-test-answer:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    border-color: var(--bs-primary);
}

.feedback-message {
    padding: 0.5rem;
    border-radius: 4px;
}

.feedback-message.text-success {
    background-color: rgba(25, 135, 84, 0.1);
}

.feedback-message.text-danger {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Popular badge styling */
.popular-badge {
    font-weight: bold;
    font-size: 0.9rem;
    position: relative;
    z-index: 10;
}

/* Dropdown menu styles */
.dropdown-menu {
    background-color: var(--bs-dark);
    border-color: var(--bs-border-color);
    margin-top: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-menu .dropdown-item {
    color: var(--bs-light);
}

.dropdown-menu .dropdown-item:hover, 
.dropdown-menu .dropdown-item:focus {
    background-color: var(--bs-dark-bg-subtle);
    color: var(--bs-primary);
}

.dropdown-menu .dropdown-header {
    color: var(--bs-secondary);
}

.dropdown-menu .dropdown-divider {
    border-top-color: var(--bs-border-color);
}

/* Mobile responsive adjustments */
@media (max-width: 992px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--bs-border-color);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .crossword-grid {
        grid-template-columns: repeat(15, 1.8rem);
        grid-template-rows: repeat(15, 1.8rem);
    }
}

@media (max-width: 768px) {
    .crossword-grid {
        grid-template-columns: repeat(15, 1.5rem);
        grid-template-rows: repeat(15, 1.5rem);
    }
    
    .cell-input {
        font-size: 1rem;
    }
    
    .cell-number {
        font-size: 0.6rem;
    }
}
