* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  background: linear-gradient(to bottom, #e0f9ff 0%, #ffffff 100%);
  color: #333;
  min-height: 100vh;
  margin: 0;
}



/* Landing Page Styles */
.landing-container {
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

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

.ubt-logo {
    background: #0066cc;
    color: white;
    padding: 8px 12px;
    border-radius: 15%;
    font-weight: bold;
}

.quiz-form {
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.start-btn {
    width: 100%;
    padding: 15px;
    background: #0066cc;
    color: white;
    border: none;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
}

.start-btn:hover {
    background: #0052a3;
}

/* Quiz Interface Styles - Modified for new layout */
.quiz-container {
    max-width: 90vw;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.quiz-title {
    display: flex;
    align-items: center;
    gap: 20px;
}

.quiz-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    font-weight: bold;
}

.timer {
    background: #dc3545;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-family: monospace;
}

/* New full-width content layout */
.quiz-content-full {
    padding: 20px 30px;
    min-height: calc(100vh - 200px);
}

/* Question List Landing Page Styles */
.question-list-landing {
    max-width: 80vw;
    margin: 0 auto;
}

.quiz-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
}

.info-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    font-size: 14px;
    color: #666;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    min-width: 80px;
}

.timer-small {
    font-family: monospace;
    font-weight: bold;
    color: #dc3545;
    font-size: 16px;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.questions-grid-container {
    display: grid;
    gap: 30px;
    margin-bottom: 30px;
}

.section-questions h3 {
    margin-bottom: 15px;
    color: #0066cc;
    font-size: 18px;
    text-align: center;
    padding: 8px;
    background: #e3f2fd;
    border-radius: 8px;
}

/* UPDATED: Question Grid - 10 Questions Per Row */
.question-grid-large {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 10px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
}

.question-num-large {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    color: #333;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.question-num-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: #0066cc;
    background: #f8f9fa;
}

.question-num-large.answered {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.question-num-large.answered:hover {
    background: #218838;
    border-color: #1e7e34;
}

/* NEW: Individual Question View Styles with Left-Right Layout */
.question-content-full {
    max-width: 95vw;
    margin: 0 auto;
}

.question-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.question-info span {
    font-weight: bold;
    color: #666;
}

/* NEW: Question Layout - Left-Right Split for Desktop/Tablet */
.question-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    min-height: 500px;
}

.question-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e9ecef;
    overflow-y: auto;
    max-height: 700px;
}

.answers-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    padding-top: 50px;
    border: 2px solid #e9ecef;
    overflow-y: auto;
    max-height: 700px;
}

.question-text h3 {
    margin-bottom: 15px;
    line-height: 1.6;
    margin-top: 0;
}

/* Question title styles for quiz interface */
.question-title {
    font-size: 18px;
    font-weight: bold;
    color: black;
    margin-bottom: 15px;
    padding: 12px 16px;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    line-height: 1.5;
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.1);
    position: relative;
    background: white;
}

/* Universal Image Sizes for Quiz Interface */

/* Question Images - Responsive size with rounded borders */
.question-media img {
    width: 100% !important;
    max-width: 300px !important;
    height: auto !important;
    min-height: 250px !important;
    border-radius: 12px;
    border: 2px solid #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 15px auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.question-media img:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    border-color: #0066cc;
}

/* Image container styling */
.question-media {
    text-align: center;
    margin: 10px 0;
    padding: 10px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.question-media audio,
.question-media video {
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
}

.answers {
    display: grid;
    gap: 15px;
}

.answer-option {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s;
    cursor: default;
    background: white;
}

.answer-option:hover {
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

.answer-option.selected {
    border-color: #0066cc;
    background: #e3f2fd;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

.option-number {
    background: #6c757d;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.clickable-option-number {
    background: #ffffff;
    color: #000000;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
    border: 2px solid black;
}
}

.clickable-option-number:hover {
    background: #0066cc;
    transform: scale(1.1);
    color: white;
}

.answer-option.selected .option-number,
.answer-option.selected .clickable-option-number {
    background: #0066cc;
    color: white;
    border: 2px solid #0066cc ;
}

.option-content {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    pointer-events: none;
    line-height: 1.5;
}

.non-clickable {
    pointer-events: none;
}

/* Option Images - Responsive size with rounded borders */
.option-content img {
    width: 100% !important;
    max-width: 180px !important;
    height: auto !important;
    min-height: 120px !important;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    pointer-events: auto;
    cursor: pointer;
}

.option-content img:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    border-color: #0066cc;
}

/* Audio controls - Allow interaction */
.option-content audio {
    pointer-events: auto;
    width: 100%;
    max-width: 250px;
    margin-bottom: 10px;
}

/* When option is selected, highlight the image */
.answer-option.selected .option-content img {
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

/* Ensure text doesn't break layout with images */
.option-content span {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    pointer-events: none;
    font-size: 15px;
    line-height: 1.4;
}

/* For clickable images */
.clickable-image, .clickable-video {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.clickable-image:hover, .clickable-video:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.clickable-image:active {
    transform: scale(0.98);
}



/* Modified Navigation Styles */
.question-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 12px 24px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover {
    background: #0052a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.nav-btn.list-btn {
    background: #0066CC;
}

.nav-btn.list-btn:hover {
    background: #0154A8;
}

.submit-section {
    text-align: center;
    padding: 30px;
    margin-top: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.submit-btn {
    padding: 18px 48px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.submit-btn:hover {
    background: #0052a3;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Modal Styles - Simplified for media preview only */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 800px;
    position: relative;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    margin-bottom: 10px;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

/* Eye Test Styles */
.eyetest-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    min-height: 100vh;
}

.eyetest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.eyetest-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat {
    padding: 5px 10px;
    background: #6c757d;
    color: white;
    border-radius: 5px;
    font-size: 14px;
}

.stat.current {
    background: #0066cc;
}

.eyetest-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    margin-bottom: 30px;
}

.eyetest-image {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

/* Eye Test Images - Universal size with rounded borders */
.eyetest-image img {
    width: 350px !important;
    height: 350px !important;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid #ddd;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.eyetest-image img:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-color: #0066cc;
}

.calculator {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.calculator-display {
    margin-bottom: 15px;
}

.calculator-display input {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    text-align: right;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.calculator-buttons button {
    padding: 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    transition: background 0.3s;
}

.calculator-buttons button:hover {
    background: #e9ecef;
}

.eyetest-nav {
    display: flex;
    justify-content: space-between;
}

.skip-btn {
    background: #6c757d;
}

.skip-btn:hover {
    background: #5a6268;
}

/* Results Page Styles - Modified for question list view with better responsive design */
.result-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
}

.result-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

/* Make result stats more compact and responsive */
.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.label {
    font-weight: bold;
    color: #666;
    margin-bottom: 5px;
    font-size: 12px;
    text-align: center;
}

.value {
    font-size: 20px;
    font-weight: bold;
    color: #0066cc;
}

/* Results Legend Styles - More compact */
.results-legend {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    text-align: center;
}

.results-legend h4 {
    margin-bottom: 12px;
    color: #333;
    font-size: 16px;
}

.legend-items {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 13px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    display: inline-block;
}

.legend-color.correct {
    background: #28a745;
}

.legend-color.wrong {
    background: #dc3545;
}

.legend-color.unanswered {
    background: #ffc107;
}

/* Questions Results Container - Use same style as quiz page */
.questions-results-container {
    display: grid;
    gap: 25px;
    margin-bottom: 30px;
}

.section-results h3 {
    margin-bottom: 15px;
    color: #0066cc;
    font-size: 18px;
    text-align: center;
    padding: 8px;
    background: #e3f2fd;
    border-radius: 8px;
}

/* Use the same grid system as quiz page for better consistency */
.question-grid-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
}

.question-num-result {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.question-num-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.question-num-result.correct {
    background: #28a745;
}

.question-num-result.correct:hover {
    background: #218838;
}

.question-num-result.wrong {
    background: #dc3545;
}

.question-num-result.wrong:hover {
    background: #c82333;
}

.question-num-result.unanswered {
    background: #ffc107;
    color: #333;
}

.question-num-result.unanswered:hover {
    background: #e0a800;
}

/* Eye Test Results - More compact */
.eye-test-results-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 25px;
}

.eye-test-results-summary h3 {
    margin-bottom: 15px;
    color: #0066cc;
    text-align: center;
    font-size: 18px;
}

.eye-test-legend {
    margin-bottom: 15px;
    text-align: center;
}

.eye-test-grid-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
}

.eye-test-num-result {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.eye-test-num-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.eye-test-num-result.correct {
    background: #28a745;
}

.eye-test-num-result.correct:hover {
    background: #218838;
}

.eye-test-num-result.wrong {
    background: #dc3545;
}

.eye-test-num-result.wrong:hover {
    background: #c82333;
}

.eye-test-num-result.unanswered {
    background: #ffc107;
    color: #333;
}

.eye-test-num-result.unanswered:hover {
    background: #e0a800;
}

.result-actions {
    text-align: center;
    margin-top: 25px;
}

.restart-btn {
    padding: 12px 24px;
    background: #0066cc;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.restart-btn:hover {
    background: #0052a3;
}

/* Admin Styles */
.admin-container {
    max-width: 95vw;
    margin: 0 auto;
    padding: 20px;
}

.admin-nav {
    background: #0066CC;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.admin-nav a {
    color: white;
    text-decoration: none;
    margin-right: 20px;
    padding: 8px 8px;
    border-radius: 3px;
    transition: background 0.3s;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: #28A745;
}

.admin-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.admin-form {
    max-width: 800px;
}

.admin-form .form-group {
    margin-bottom: 15px;
}

.admin-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 75%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.admin-form textarea {
    height: 100px;
    resize: vertical;
}

.admin-btn {
    background: #0066cc;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
}

.admin-btn:hover {
    background: #0052a3;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th,
.admin-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: bold;
}

.delete-btn {
    background: #dc3545;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    display: inline-block;
}

.delete-btn:hover {
    background: #c82333;
}

/* Media Upload Styles */
.media-upload-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
}

.option-section {
    background: #ffffff;
}

.tab-btn {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    cursor: pointer;
    margin-right: 5px;
    border-radius: 5px 5px 0 0;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #e9ecef;
}

.tab-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.file-item {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.file-item:hover {
    border-color: #007bff;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.file-item.selected {
    border-color: #007bff;
    background: #e3f2fd;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.file-preview {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 3px;
    margin-bottom: 5px;
}

.file-info {
    font-size: 12px;
    color: #666;
    word-break: break-word;
}

.file-actions {
    display: flex;
    gap: 3px;
    justify-content: center;
    margin-top: 8px;
}

.file-actions button {
    flex: 1;
    min-width: 0;
    font-size: 9px !important;
    padding: 3px 4px !important;
    border-radius: 3px;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* File Manager Modal Fixes */
#fileManagerModal .modal-content {
    height: 85vh;
}

#fileManagerContent {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    margin-bottom: 20px;
}

/* Custom scrollbar for better appearance */
#fileManagerContent::-webkit-scrollbar {
    width: 8px;
}

#fileManagerContent::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#fileManagerContent::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#fileManagerContent::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Fixed bottom buttons */
.file-manager-buttons {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 15px 0 0 0;
    border-top: 1px solid #eee;
    margin-top: auto;
    text-align: center;
}

/* Tab buttons */
#fileManagerTabs {
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

/* File Preview Modal Styles */
#filePreviewModal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

#filePreviewContent {
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
}

/* Preview button styling */
.preview-btn {
    transition: all 0.3s ease;
}

.preview-btn:hover {
    background: #138496 !important;
    transform: translateY(-1px);
}

/* Question title in admin preview */
.admin-section .question-title {
    font-size: 14px;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #e8f4fd;
    border-left: 3px solid #0066cc;
    border-radius: 4px;
}

/* Loading placeholder for images */
.question-media img[src=""], .option-content img[src=""] {
    background: linear-gradient(90deg, #f0f0f0 25%, transparent 37%, #f0f0f0 63%);
    background-size: 400% 100%;
    animation: loading 1.5s ease infinite;
}

@keyframes loading {
    0% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Preserve line breaks in question titles */
.question-title {
    white-space: pre-line;
    word-wrap: break-word;
}

/* Preserve line breaks in question text */
.question-text h3 {
    white-space: pre-line;
    word-wrap: break-word;
}

/* Preserve line breaks in option text */
.option-content span {
    white-space: pre-line;
    word-wrap: break-word;
}

/* For results page - preserve line breaks in review */
.question-review .question-title {
    white-space: pre-line;
    word-wrap: break-word;
}

.question-review .question-text {
    white-space: pre-line;
    word-wrap: break-word;
}

.option-review span {
    white-space: pre-line;
    word-wrap: break-word;
}

/* For admin form inputs */
.admin-form textarea {
    white-space: pre-line;
    word-wrap: break-word;
    font-family: inherit;
}

/* Loading animation for previews */
.preview-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

/* Preview content styling */
#filePreviewContent img {
    transition: transform 0.3s ease;
}

#filePreviewContent img:hover {
    transform: scale(1.02);
}

#filePreviewContent audio,
#filePreviewContent video {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
}

/* Custom Audio Button Styles - Ensure proper visibility */
.custom-audio-btn {
    z-index: 1001 !important;
    position: relative !important;
    pointer-events: auto !important;
}

/* Ensure option audio containers are properly positioned */
.option-audio-container {
    display: inline-flex !important;
    align-items: center !important;
    margin-right: 10px !important;
    vertical-align: middle !important;
    pointer-events: auto !important;
}




/* Responsive Design */
@media (max-width: 1200px) {
    /* Adjust question grid for smaller desktop screens */
    .question-grid-large {
        grid-template-columns: repeat(8, 1fr);
        gap: 8px;
    }
    
    .question-num-large {
        width: 55px;
        height: 55px;
        font-size: 15px;
    }
    
    /* Tablet Layout - Still use left-right but more compact */
    .question-layout {
        grid-template-columns: 1fr 1fr;
        gap: 25px;
        min-height: 450px;
    }
    
    .question-section,
    .answers-section {
        padding: 20px;
        max-height: 600px;
    }
    
    .question-media img {
        max-width: 300px !important;
        min-height: 200px !important;
    }
    
    .option-content img {
        max-width: 150px !important;
        min-height: 100px !important;
    }
}

@media (max-width: 992px) {
    /* Further adjust question grid for medium screens */
    .question-grid-large {
        grid-template-columns: repeat(6, 1fr);
        gap: 8px;
    }
    
    .question-num-large {
        width: 50px;
        height: 50px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    /* Mobile Layout - Switch to Single Column */
    .quiz-content-full {
        padding: 10px;
    }
    
    .question-list-landing {
        max-width: 100%;
    }
    
    /* Compact stats for mobile */
    .quiz-info {
        padding: 12px;
        margin-bottom: 20px;
    }
    
    .info-stats {
        gap: 8px;
        margin-bottom: 0;
    }
    
    .stat-item {
        font-size: 12px;
        padding: 6px 8px;
        min-width: 60px;
    }
    
    .timer-small {
        font-size: 14px;
        padding: 6px 8px;
    }
    
    /* More compact grid for mobile */
    .questions-grid-container {
        gap: 20px;
        margin-bottom: 20px;
    }
    
    .section-questions h3 {
        font-size: 16px;
        margin-bottom: 12px;
        padding: 6px;
    }
    
    /* Mobile question grid - 5 per row */
    .question-grid-large {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        padding: 0 5px;
    }
    
    .question-num-large {
        width: 45px;
        height: 45px;
        font-size: 14px;
    }
    
    /* MOBILE: Single Column Layout */
    .question-content-full {
        max-width: 100%;
    }
    
    .question-layout {
        display: block;
        gap: 0;
    }
    
    .question-section {
        margin-bottom: 25px;
        max-height: none;
        border-radius: 10px;
        padding: 20px;
    }
    
    .answers-section {
        max-height: none;
        border-radius: 10px;
        padding: 20px;
        border: 2px solid #e9ecef;
    }
    
    .question-info {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .question-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    .submit-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .eyetest-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Eye test image responsive for tablets */
    .eyetest-image img {
        width: 280px !important;
        height: 280px !important;
        border-radius: 10px;
    }
    
    /* Results page responsive */
    .result-container {
        padding: 15px;
    }
    
    .result-header {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .result-header h1 {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    /* Make stats more compact on mobile */
    .result-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-top: 15px;
    }
    
    .stat-item {
        padding: 8px;
    }
    
    .label {
        font-size: 11px;
    }
    
    .value {
        font-size: 16px;
    }
    
    /* Compact legend for mobile */
    .results-legend,
    .eye-test-legend {
        padding: 12px;
        margin-bottom: 20px;
    }
    
    .results-legend h4 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .legend-items {
        gap: 15px;
    }
    
    .legend-item {
        font-size: 12px;
        gap: 5px;
    }
    
    .legend-color {
        width: 14px;
        height: 14px;
    }
    
    /* Use same mobile grid as quiz page */
    .questions-results-container {
        gap: 20px;
        margin-bottom: 20px;
    }
    
    .section-results h3 {
        font-size: 16px;
        margin-bottom: 12px;
        padding: 6px;
    }
    
    .question-grid-results {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        gap: 6px;
        padding: 0 5px;
    }
    
    .question-num-result {
        width: 40px;
        height: 40px;
        font-size: 12px;
    }
    
    .eye-test-results-summary {
        padding: 15px;
        margin-top: 20px;
    }
    
    .eye-test-results-summary h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .eye-test-grid-results {
        grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
        gap: 6px;
        padding: 0 5px;
    }
    
    .eye-test-num-result {
        width: 32px;
        height: 32px;
        font-size: 10px;
    }
    
    .result-actions {
        margin-top: 20px;
    }
    
    .restart-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    /* Question title responsive */
    .question-title {
        font-size: 16px;
        padding: 10px 12px;
        margin-bottom: 12px;
    }
    
    .question-review .question-title {
        font-size: 14px;
        padding: 8px 10px;
    }
    
    /* Image responsive adjustments for tablets */
    .question-media img {
        max-width: 320px !important;
        min-height: 240px !important;
        border-radius: 10px;
    }
    
    .option-content img {
        max-width: 120px !important;
        min-height: 90px !important;
        border-radius: 6px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 95vh;
        padding: 15px;
    }
    
    #fileManagerModal .modal-content {
        height: 90vh;
    }
    
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .tab-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .quiz-content-full {
        padding: 8px;
    }
    
    /* Extra compact stats for small mobile */
    .quiz-info {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .info-stats {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat-item {
        font-size: 11px;
        padding: 4px 6px;
        min-width: 50px;
    }
    
    .timer-small {
        font-size: 12px;
        padding: 4px 6px;
    }
    
    .question-title {
        font-size: 14px;
        padding: 8px 10px;
        margin-bottom: 10px;
    }
    
    .questions-grid-container {
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .section-questions h3 {
        font-size: 14px;
        margin-bottom: 10px;
        padding: 4px;
    }
    
    /* Small mobile - 4 questions per row */
    .question-grid-large {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
        padding: 0;
    }
    
    .question-num-large {
        width: 38px;
        height: 38px;
        font-size: 12px;
        border-radius: 6px;
    }
    
    .question-content-full {
        max-width: 100%;
    }
    
    /* Mobile Question/Answer Layout */
    .question-section,
    .answers-section {
        padding: 15px;
        border-radius: 8px;
    }
    
    .question-section {
        margin-bottom: 20px;
    }
    
    /* Results page mobile responsive */
    .result-container {
        padding: 10px;
    }
    
    .result-header {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .result-header h1 {
        font-size: 20px;
    }
    
    /* Extra compact stats for small mobile */
    .result-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-top: 10px;
    }
    
    .stat-item {
        padding: 6px;
    }
    
    .label {
        font-size: 10px;
    }
    
    .value {
        font-size: 14px;
    }
    
    /* Ultra compact legend */
    .results-legend,
    .eye-test-legend {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .results-legend h4 {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .legend-items {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .legend-item {
        font-size: 11px;
        gap: 4px;
    }
    
    .legend-color {
        width: 12px;
        height: 12px;
    }
    
    /* Extra compact grids for small mobile */
    .questions-results-container {
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .section-results h3 {
        font-size: 14px;
        margin-bottom: 10px;
        padding: 4px;
    }
    
    .question-grid-results {
        grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
        gap: 4px;
        padding: 0;
    }
    
    .question-num-result {
        width: 35px;
        height: 35px;
        font-size: 11px;
        border-radius: 6px;
    }
    
    .eye-test-results-summary {
        padding: 12px;
        margin-top: 15px;
    }
    
    .eye-test-results-summary h3 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .eye-test-grid-results {
        grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
        gap: 4px;
        padding: 0;
    }
    
    .eye-test-num-result {
        width: 28px;
        height: 28px;
        font-size: 9px;
    }
    
    .result-actions {
        margin-top: 15px;
    }
    
    .restart-btn {
        padding: 8px 16px;
        margin: 5px;
        font-size: 13px;
        width: 100%;
        max-width: 200px;
    }
    
    /* Modal responsive for mobile */
    .modal-content {
        width: 95%;
        margin: 2% auto;
        padding: 10px;
        max-height: 95vh;
    }
    
    /* Image responsive adjustments for mobile phones */
    .question-media img {
        max-width: 280px !important;
        min-height: 210px !important;
        border-radius: 8px;
        margin: 10px auto;
    }
    
    .option-content img {
        max-width: 100px !important;
        min-height: 75px !important;
        border-radius: 5px;
        margin-bottom: 8px;
    }
    
    /* Eye test image responsive for mobile */
    .eyetest-image img {
        width: 250px !important;
        height: 250px !important;
        border-radius: 8px;
    }
    
    .submit-section {
        padding: 15px 8px;
    }
    
    .submit-btn {
        padding: 12px 24px;
        font-size: 16px;
    }
    
    #filePreviewModal .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .file-actions {
        flex-direction: column;
        gap: 2px;
    }
    
    .file-actions button {
        font-size: 10px !important;
        padding: 4px 6px !important;
    }
}

/* For very small screens */
@media (max-width: 360px) {
    .quiz-content-full {
        padding: 5px;
    }
    
    /* Ultra compact stats */
    .quiz-info {
        padding: 8px;
        margin-bottom: 12px;
    }
    
    .info-stats {
        gap: 4px;
    }
    
    .stat-item {
        font-size: 10px;
        padding: 3px 5px;
        min-width: 45px;
    }
    
    .timer-small {
        font-size: 11px;
        padding: 3px 5px;
    }
    
    .question-media img {
        max-width: 250px !important;
        min-height: 190px !important;
    }
    
    .option-content img {
        max-width: 80px !important;
        min-height: 60px !important;
    }
    
    /* Eye test image responsive for very small screens */
    .eyetest-image img {
        width: 220px !important;
        height: 220px !important;
        border-radius: 6px;
    }
    
    .questions-grid-container {
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .section-questions h3 {
        font-size: 13px;
        margin-bottom: 8px;
        padding: 3px;
    }
    
    /* Very small mobile - 3 questions per row */
    .question-grid-large {
        grid-template-columns: repeat(3, 1fr);
        gap: 3px;
        padding: 0;
    }
    
    .question-num-large {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }
    
    /* Mobile Question/Answer Layout for very small screens */
    .question-section,
    .answers-section {
        padding: 12px;
        border-radius: 6px;
    }
    
    .question-section {
        margin-bottom: 15px;
    }
    
    /* Results page very small screens */
    .result-container {
        padding: 8px;
    }
    
    .result-header {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .result-header h1 {
        font-size: 18px;
    }
    
    /* Ultra compact stats */
    .result-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        margin-top: 8px;
    }
    
    .stat-item {
        padding: 4px;
    }
    
    .label {
        font-size: 9px;
    }
    
    .value {
        font-size: 12px;
    }
    
    /* Minimal legend */
    .results-legend,
    .eye-test-legend {
        padding: 8px;
        margin-bottom: 12px;
    }
    
    .results-legend h4 {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .legend-items {
        gap: 6px;
    }
    
    .legend-item {
        font-size: 10px;
        gap: 3px;
    }
    
    .legend-color {
        width: 10px;
        height: 10px;
    }
    
    /* Minimal grids for very small screens */
    .questions-results-container {
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .section-results h3 {
        font-size: 12px;
        margin-bottom: 8px;
        padding: 3px;
    }
    
    .question-grid-results {
        grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
        gap: 3px;
        padding: 0;
    }
    
    .question-num-result {
        width: 30px;
        height: 30px;
        font-size: 10px;
        border-radius: 4px;
    }
    
    .eye-test-results-summary {
        padding: 10px;
        margin-top: 12px;
    }
    
    .eye-test-results-summary h3 {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .eye-test-grid-results {
        grid-template-columns: repeat(auto-fill, minmax(24px, 1fr));
        gap: 3px;
        padding: 0;
    }
    
    .eye-test-num-result {
        width: 24px;
        height: 24px;
        font-size: 8px;
    }
    
    .result-actions {
        margin-top: 12px;
    }
    
    .restart-btn {
        padding: 6px 12px;
        margin: 5px;
        font-size: 12px;
        width: 100%;
        max-width: 180px;
    }
    
    /* Section containers */
    .section-questions,
    .section-results {
        margin: 0;
    }
    
    .results-legend,
    .eye-test-results-summary {
        margin: 0;
        padding: 8px;
    }
    
    /* Modal for very small screens */
    .modal-content {
        width: 98%;
        margin: 1% auto;
        padding: 6px;
    }
    
    /* Question details modal content */
    .question-details-content {
        font-size: 13px;
    }
    
    .question-details-content h4 {
        font-size: 15px;
        margin-bottom: 6px;
    }
    
    .option-detail {
        padding: 5px;
        margin: 5px 0;
        font-size: 12px;
    }
    
    .result-summary {
        padding: 8px;
        font-size: 13px;
    }
    
    .submit-section {
        padding: 12px 5px;
    }
    
    .submit-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

#mediaPreviewTitle {
    display: none;
}

/* Custom Audio Button Styles - Ensure proper visibility */
.custom-audio-btn {
    z-index: 1001 !important;
    position: relative !important;
    pointer-events: auto !important;
}

/* Ensure option audio containers are properly positioned */
.option-audio-container {
    display: inline-flex !important;
    align-items: center !important;
    margin-right: 10px !important;
    vertical-align: middle !important;
    pointer-events: auto !important;
}



button.custom-audio-btn{
    border-radius: 15px !important;
    padding: 8px 10px !important;
}











