/* Base Styles */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --gray-color: #95a5a6;
    --white-color: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    display: flex;
    flex-direction: column;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    flex: 1 0 auto;
    margin-top: 20px;
}

/* Header Styles */
header {
    background-color: var(--dark-color);
    color: var(--white-color);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: relative;
}

header::after {
    content: "";
    display: table;
    clear: both;
}

header h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    display: inline-block;
    vertical-align: middle;
}

nav {
    float: right;
    line-height: 1.8rem;
}

nav a, nav span {
    color: var(--white-color);
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 1rem;
    vertical-align: middle;
}

nav a:hover {
    color: var(--primary-color);
}

/* Footer Styles */
footer {
    background-color: var(--dark-color);
    color: var(--white-color);
    padding: 1.5rem 0;
    text-align: center;
    flex-shrink: 0;
    width: 100%;
    margin-top: 20px;
}

/* Flash Messages */
.flash-messages {
    margin: 1rem 0;
}

.flash {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
}

.flash.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.flash.danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Form Styles */
.auth-form, .form-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    color: var(--gray-color);
    font-size: 0.875rem;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.btn-primary:hover {
    background-color: #2980b9;
}


.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--white-color);
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Dashboard Styles */
.dashboard {
    padding: 2rem 0;
}

.dashboard h2 {
    margin-bottom: 2rem;
    font-family: 'Montserrat', sans-serif;
    color: var(--dark-color);
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--white-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.card p {
    margin-bottom: 1.5rem;
    color: var(--gray-color);
}

/* Universal Table Styles */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin: 2rem 0;
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--white-color);
    min-width: 600px;
}

table th, table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    background-color: var(--dark-color);
    color: var(--white-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    padding: 1rem;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #f0f0f0;
}

table td .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Specific Table Styles */
.sets-table {
    width: 100%;
}

.sets-table th {
    position: sticky;
    top: 0;
}

/* Card Styles */
.set-card {
    margin-bottom: 2rem;
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.set-actions .btn {
    margin-right: 0.75rem;
}

.set-actions .btn:last-child {
    margin-right: 0;
}

/* Quiz Card Styles */
.quiz-card {
    border: 1px solid #ddd;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    background-color: var(--white-color);
}

.quiz-card.unlocked {
    border-left: 4px solid var(--secondary-color);
}

.quiz-card.locked {
    border-left: 4px solid var(--gray-color);
    opacity: 0.7;
}

.quiz-status {
    margin-top: 1rem;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-status.completed {
    color: var(--secondary-color);
}

.quiz-status.locked {
    color: var(--gray-color);
}

/* Level Card Styles */
.level-card {
    border: 1px solid #ddd;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: var(--border-radius);
    background-color: var(--white-color);
}

.level-card.unlocked {
    border-left: 5px solid var(--secondary-color);
}

.level-card.locked {
    border-left: 5px solid var(--gray-color);
    opacity: 0.7;
}

.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.level-status {
    font-size: 0.9em;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.level-status.completed {
    background-color: #d4edda;
    color: #155724;
}

.level-status.locked {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Quiz Container */
.quizzes-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

/* Utility Classes */
.result-header h2 {
    color: var(--dark-color);
    font-family: 'Montserrat', sans-serif;
}

.badge {
    padding: 0.5em 0.8em;
    font-size: 0.9em;
    border-radius: var(--border-radius);
}

.table-success {
    background-color: rgba(46, 204, 113, 0.1);
}

.table-warning {
    background-color: rgba(243, 156, 18, 0.1);
}

.table-danger {
    background-color: rgba(231, 76, 60, 0.1);
}

.text-center {
    text-align: center;
}

.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }

.header-with-button, .header-with-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.buttons-right a {
    margin-left: 0.75rem;
}

.btn-success {
    background-color: var(--secondary-color);
    color: var(--white-color);
}

.btn-success:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-secondary {
    background-color: var(--gray-color);
    color: var(--white-color);
}

.btn-secondary:hover {
    background-color: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: none;
}

.sets-table input.form-control {
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.sets-table input.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.topic-text {
    font-weight: normal;
    font-size: 0.9em;
    color: #555;
}
.subtopic-text {
    font-weight: normal;
    font-size: 0.85em;
    color: #666;
}
.level-header h3 {
    margin-bottom: 0.2rem;
}
.quiz-card h4 {
    margin-bottom: 0.2rem;
}


/* Level title styling */
.level-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

/* Topic styling */
.topic {
    font-weight: 500;
    color: #000000;
}

/* Quiz title styling */
.quiz-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #34495e;
    margin-bottom: 1rem;
}

/* Subtopic styling */
.subtopic {
    font-weight: 400;
    color: #7f8c8d;
    font-style: italic;
}

/* Question indicator styling */
.progress-indicator {
    margin-bottom: 1.5rem;
}

.set-question {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: #add5f0;
    border-radius: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #000000;
    letter-spacing: 0.5px;
    font-weight: bold; 
}

/* Question text styling */
.question-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333;
    padding: 1rem;
    background-color: #f9f9f9;
    border-left: 4px solid #3498db;
    border-radius: 0 4px 4px 0;
}

/* Keep existing CSS for general layout, report sections, student table */
.report-section {
    margin-bottom: 40px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
}
.heatmap-container img {
    display: block; /* Ensures the image takes its own line */
    margin: 0 auto; /* Centers the image */
}
.heatmap-legend {
    margin-top: 20px; /* Add some space above the legend */
    margin-bottom: 30px;
    text-align: center; /* Center the legend items */
}
.legend-item {
    display: inline-block;
    padding: 2px 8px;
    margin: 0 5px;
    border-radius: 3px;
    color: #333; /* Default text color */
    border: 1px solid #ccc; /* Add a border to legend items */
}
.legend-label {
    font-weight: bold;
    margin-right: 10px;
}
/* Styles for the student table can remain the same */
.student-table {
    width: 100%;
    border-collapse: collapse;
}
.student-table th, .student-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left; /* Align text left for better readability in tables */
}
.student-table th {
    background-color: #f2f2f2;
}

.viz-section {
    transition: all 0.3s ease;
}
.card {
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}
.card:hover {
    box-shadow: 0 0.5rem 1.5rem 0 rgba(58, 59, 69, 0.2);
}

/* In your CSS file */
.validation-method {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}
/* Admin Dashboard Styles */
.dashboard-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dashboard-section h3 {
    margin-top: 0;
    color: #343a40;
}
/* Admin Dashboard Total Cost Styles */
.total-cost-container {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center; /* This will center the box */
    width: 100%;
}

.total-cost-box {
    background-color: #e9ecef; /* Light grey color */
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #dee2e6;
    width: fit-content;
    max-width: 100%;
}

.total-cost-label {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    display: block;
}

.total-cost-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* Adjust header layout */
.tracking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    width: 100%;
}

.tracking-title {
    margin: 0;
}

.tracking-options {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Form switch styling */
.form-switch {
    padding-left: 2.5em;
}

.form-check-label {
    font-weight: 500;
    color: #495057;
}

.form-check-input {
    width: 2.5em;
    margin-left: -2.5em;
}


.clickable-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%; /* Ensures consistent card height */
}

.clickable-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.chart-container {
    width: 100%;
    overflow: hidden; /* Changed from auto to prevent scrollbars */
}

.chart-container img {
    width: 100%;
    height: auto;
    min-width: 0; /* Remove fixed minimum width */
}

/* Zoom controls */
.zoom-controls {
    text-align: center;
    margin: 15px 0;
}

.table th {
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: white;
}

.table-responsive {
    max-height: 80vh;
    overflow-y: auto;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    color: white;
}

/* Loading state for the button */
button[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Solution steps styling */
/* Solution steps styling for div-based format */
.steps-content div {
    margin: 1em 0;
    line-height: 1.5;
}

.steps-content div strong {
    display: block;
    margin-bottom: 0.3em;
}

.steps-content div .indent {
    display: inline-block;
    margin-left: 30em;
    text-indent: -10em;
}

/* Spacing between steps */
.steps-content div br + br {
    content: "";
    display: block;
    margin-top: 0.5em;
}

.solution-steps {
    margin-bottom: 3rem;  
    padding-bottom: 2rem; 
    border-bottom: 1px solid #eee; 
}

.navigation-buttons {
    margin-top: 2rem;    
    padding-top: 2rem;    
    text-align: center;   
}

.manage-container {
    margin-top: 20px;
}

.sets-table th:first-child {
    width: 140px; /* Fixed width for the first column */
    text-align: center;
}

table td:first-child {
    text-align: center; /* Center align the first column */
}