/* 
 * CSS for Question Images Display
 */

/* Image thumbnail next to question title */
.question-image-thumbnail {
    max-width: 80px;
    max-height: 80px;
    border-radius: 4px;
    margin-right: 10px;
    object-fit: contain;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
    transition: transform 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.question-image-thumbnail:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Question title and image container */
.question-title-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

/* Make title container flex with image */
.question-title-text {
    flex: 1;
    min-width: 200px;
    word-break: break-word;
}

#questionImagePreview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    display: block;
    margin: 0 auto;
    transition: transform 0.2s ease;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

#questionImagePreview .card {
    background-color: #f8f9fa;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#questionImagePreview .card-body {
    padding: 10px;
    text-align: center;
}

/* Responsive styles for smaller screens */
@media (max-width: 767px) {
    .question-image-thumbnail {
        max-width: 60px;
        max-height: 60px;
    }
    
    .question-title-container {
        flex-direction: row;
        align-items: center;
    }
    
    .question-title-text {
        width: 100%;
        font-size: 0.95rem;
    }
    
    /* Adjust layout for mobile */
    .question-card .d-flex {
        flex-direction: column;
    }
    
    .question-card .btn-group {
        margin-top: 10px;
        align-self: flex-end;
        display: flex;
        width: 100%;
        justify-content: flex-end;
    }
    
    .question-card .btn-group .btn {
        padding: .25rem .5rem;
        font-size: .875rem;
    }
    
    #questionImagePreview img {
        max-height: 150px;
    }
    
    .image-enlarge-modal .modal-body {
        padding: 10px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .question-image-thumbnail {
        max-width: 50px;
        max-height: 50px;
    }
    
    .question-title-text {
        font-size: 0.875rem;
    }
    
    #questionImagePreview .card-subtitle {
        font-size: 0.8rem;
    }
}

/* Image enlargement modal */
.image-enlarge-modal .modal-body {
    text-align: center;
    padding: 20px;
}

.image-enlarge-modal img {
    max-width: 100%;
    max-height: 80vh;
}

/* Clickable image style */
.clickable-image {
    cursor: pointer;
    transition: transform 0.2s;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.clickable-image:hover {
    transform: scale(1.05);
}

/* Image badge for questions with images */
.image-badge {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.image-badge i {
    margin-right: 0.25rem;
}

/* Loader for images */
.image-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    background-color: #f8f9fa;
}
