/* 
 * CSS for Question Edit Form
 */

/* Modal styling */
.modal-question-edit {
    max-height: 90vh;
}

.modal-question-edit .modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 120px);
    padding-right: 15px;
}

/* Improve general modal appearance */
.modal-question-edit .modal-header {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.modal-question-edit .modal-footer {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* Image upload container */
.image-upload-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
    align-items: stretch;
}

/* Make it responsive for smaller screens */
@media (max-width: 768px) {
    .image-upload-container {
        grid-template-columns: 1fr;
    }
    
    .modal-question-edit .modal-body {
        padding: 0.75rem;
    }
    
    /* Stack the image upload and preview on mobile */
    .image-upload-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    /* Reduce spacing to fit more content */
    .modal-question-edit .mb-3 {
        margin-bottom: 0.75rem !important;
    }
    
    /* Smaller heading text */
    .modal-question-edit h6 {
        font-size: 0.9rem;
    }
    
    /* More compact answer rows */
    .answer-row .input-group-text {
        padding: 0.25rem 0.5rem;
    }
    
    /* Hide the remove text on small screens */
    .answer-row .btn i {
        margin-right: 0;
    }
}

/* Dropzone styling */
.dropzone-wrapper {
    border: 1px solid #dee2e6;
    padding: 5px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.image-upload-container .dropzone {
    min-height: 100px;
    flex: 1;
    border: 2px dashed #dee2e6;
    background: #f8f9fa;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Compact thumbnails in dropzone */
.image-upload-container .dropzone .dz-preview {
    margin: 5px;
    min-height: auto;
}

.image-upload-container .dropzone .dz-preview .dz-image {
    width: 80px;
    height: 80px;
    border-radius: 4px;
}

.image-upload-container .dropzone .dz-preview .dz-remove {
    margin-top: 2px;
    font-size: 12px;
    text-align: center;
}

.image-upload-container .dz-message {
    text-align: center;
    margin: 0;
}

/* Image preview styling */
.image-preview-wrapper {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 5px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 150px;
    overflow: hidden;
}

.image-preview-wrapper .card {
    margin-bottom: 0;
    border: none;
    background: transparent;
    width: 100%;
}

.image-preview-wrapper .card-body {
    padding: 5px;
}

.image-preview-wrapper .card-subtitle {
    font-size: 12px;
    margin-bottom: 5px !important;
}

.image-preview-container {
    text-align: center;
    display: flex;
    justify-content: center;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out;
}

.image-preview-container img:hover {
    transform: scale(1.05);
}

/* Answer container styling */
#answersContainer {
    max-height: 250px;
    overflow-y: auto;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #f8f9fa;
}

/* Answer row styling */
.answer-row {
    margin-bottom: 8px;
    background-color: #fff;
    border-radius: 4px;
    padding: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.answer-row .input-group {
    flex-wrap: nowrap;
}

.answer-row .form-control {
    min-height: 32px;
    height: auto;
    padding: 4px 10px;
}

/* Make buttons more compact */
.answer-row .btn {
    padding: 0.25rem 0.5rem;
}

/* Remove bottom margin from last answer item */
.answer-row:last-child {
    margin-bottom: 0;
}

/* Make the textarea resize smaller */
#intrebare {
    min-height: 60px;
    resize: vertical;
}

/* Add styles for the enlarged image modal */
.image-enlarge-modal .modal-body {
    padding: 0;
    text-align: center;
    /* background-color: #000; */
}

.image-enlarge-modal img {
    max-width: 100%;
    max-height: calc(90vh - 120px);
    object-fit: contain;
    margin: 0 auto;
}

/* Add loading indicator style */
.image-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    width: 100%;
}
