/* General Styles */
body {
    background-color: #f8f9fa;
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px; /* Space for footer */
}

footer {
    position: absolute;
    bottom: 0;
    width: 100%;
}

/* Home Page */
.card {
    transition: transform 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

/* Learning Section */
.image-container {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tool-description {
    background-color: #f0f7ff !important;
    border-left: 4px solid #0d6efd;
}

.slider-group {
    padding: 15px;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: background-color 0.3s ease;
}

.active-slider {
    background-color: #e6f2ff;
    border: 1px solid #cce5ff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.slider-value {
    font-weight: bold;
    color: #0d6efd;
    display: inline-block;
    min-width: 30px;
    text-align: right;
}

.canvas-wrapper {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    height: 700px;
    overflow: hidden;
}

#edit-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Disabled sliders */
input[type="range"]:disabled {
    opacity: 0.5;
}

/* Quiz Section */
.quiz-question {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.quiz-options .form-check {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: background-color 0.3s;
}

.quiz-options .form-check:hover {
    background-color: #e6f2ff;
}

.feedback {
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    margin-top: 15px;
    display: none;
}

.feedback.correct {
    background-color: #d4edda;
    color: #155724;
    display: block;
}

.feedback.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    display: block;
}

.btn-primary, .btn-secondary, .btn-success {
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #0056b3;
}

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

.btn-success:hover {
    background-color: #28a745;
}

/***** Feedback Styles *****/
.feedback-container {
    margin-top: 1rem;
}

.feedback {
    padding: 0.75rem;
    border-radius: 5px;
    font-weight: bold;
}

.feedback.correct {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.feedback.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/***** Practical Quiz Styles *****/
.practical-quiz-container {
    display: flex;
    flex-direction: row;
    height: auto;
    min-height: 600px;
    max-height: 90vh;
    padding: 15px;
    gap: 20px;
    overflow: hidden;
}

.practical-quiz-container .images-section {
    flex: 1.5;
    display: flex;
    flex-direction: row;
    gap: 15px;
    height: 100%;
}

.practical-quiz-container .image-wrapper {
    position: relative;
    flex: 1;
    aspect-ratio: 3/4;
    background-color: #ffffff;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: 100%;
    max-height: calc(100vh - 140px);
}

.practical-quiz-container .image-wrapper img,
.practical-quiz-container .image-wrapper canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.practical-quiz-container .image-label {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.8);
    font-weight: bold;
    padding: 5px;
    text-align: center;
    font-size: 14px;
    color: #333;
}

.practical-quiz-container .controls-section {
    flex: 1;
    background-color: #ffffff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    gap: 14px;
}

.practical-quiz-container .slider-group {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 5px;
}

.practical-quiz-container .slider-group label {
    font-size: 14px;
}

.practical-quiz-container .slider-group input[type="range"] {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 5px;
    outline: none;
    width: 100%;
    margin: 5px 0;
}

.practical-quiz-container .slider-group input[type="range"]::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
    background-color: #0d6efd;
    border-radius: 50%;
    cursor: pointer;
}

.practical-quiz-container .slider-group input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background-color: #0d6efd;
    border-radius: 50%;
    cursor: pointer;
}

.practical-quiz-container .feedback-container {
    margin-top: 10px;
}

.practical-quiz-container .feedback {
    padding: 6px;
    font-size: 14px;
    border-radius: 5px;
}

.practical-quiz-container .feedback.correct {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.practical-quiz-container .feedback.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.practical-quiz-container .btn-primary, 
.practical-quiz-container .btn-secondary {
    padding: 8px 12px;
    font-size: 14px;
}

/* Control panel improvements */
.control-panel {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
}

/* Review page enhancements */
.tool-description h5 {
    color: #333;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.tool-description ul {
    padding-left: 1.5rem;
}

.tool-description li {
    margin-bottom: 0.5rem;
}

/* Practice page optimizations */
.practice-page .canvas-wrapper {
    height: 500px;
    max-height: 500px;
    margin-bottom: 0;
}

.practice-page .card {
    margin-bottom: 0.75rem;
}

.practice-page .slider-group {
    margin-bottom: 10px;
}

.practice-page .card-body {
    padding: 12px;
}

.practice-page .form-label {
    margin-bottom: 3px;
    font-size: 0.95rem;
}

.practice-page .form-range {
    height: 8px;
}

/* Make images display better */
.card img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Optimize quiz container height */
.quiz-container {
    max-height: calc(100vh - 180px); /* Account for navbar and footer */
    display: flex;
    flex-direction: column;
}

.quiz-container .card {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
}

/* Progress bar styling */
.quiz-progress {
    height: 8px;
    margin: 15px 0;
    background-color: #e9ecef;
}

.quiz-progress .progress-bar {
    background-color: #0d6efd;
    transition: width 0.3s ease;
}

/* Responsive adjustments for practical quiz */
@media (max-width: 768px) {
    .practical-quiz-container {
        flex-direction: column;
        height: auto;
        max-height: none;
    }
    
    .practical-quiz-container .images-section {
        flex-direction: column;
    }
    
    .practical-quiz-container .image-wrapper {
        aspect-ratio: 1/1;
        max-height: 300px;
    }
    
    .practical-quiz-container .controls-section {
        max-height: none;
    }
}