.image-upload-wrap {
    border: 3px dashed var(--primary-color);
    border-radius: 25px;
    padding: 2.5rem;
    background-color: var(--secondary-color);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 250px;
}

.image-upload-wrap:hover {
    background-color: #FFC0CB; /* Slightly darker pink */
    border-color: var(--accent-color);
    transform: translateY(-5px);
}

.drag-text h3 {
    font-family: 'Gowun Batang', serif;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.file-upload-input {
    position: absolute;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    outline: none;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.file-upload-image {
    max-width: 100%;
    max-height: 350px;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 3px solid var(--primary-color);
}

.file-upload-image:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    transform: scale(1.02);
}

.image-title-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -1rem; /* Adjust to overlap image slightly */
}

.remove-image {
    background-color: var(--accent-color);
    color: var(--text-light);
    border: none;
    border-radius: 20px;
    padding: 0.5rem 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.remove-image:hover {
    background-color: #64B5F6; /* Darker Sky Blue */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

#result-section {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 25px;
    padding: 2.5rem;
    margin-top: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px dashed var(--accent-color);
}

#similarity-score {
    font-family: 'Gowun Batang', serif;
    font-size: 4.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 3px 3px 8px rgba(255, 107, 129, 0.4);
    animation: bounceIn 1s ease-out;
}

#chemistry-message {
    font-family: 'Gowun Batang', serif;
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-top: 1rem;
    line-height: 1.5;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

@keyframes bounceIn {
    0%, 20%, 40%, 60%, 80%, 100% {
        transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    }
    0% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
    40% {
        transform: scale3d(0.9, 0.9, 0.9);
    }
    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }
    80% {
        transform: scale3d(0.97, 0.97, 0.97);
    }
    100% {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .image-upload-wrap {
        padding: 1.5rem;
        min-height: 200px;
    }
    .file-upload-image {
        max-height: 250px;
    }
    #similarity-score {
        font-size: 3.5rem;
    }
    #chemistry-message {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .card {
        padding: 1.5rem !important;
    }
    .image-upload-wrap {
        min-height: 150px;
    }
    .drag-text h3 {
        font-size: 1rem;
    }
    .file-upload-image {
        max-height: 200px;
    }
    #similarity-score {
        font-size: 2.8rem;
    }
    #chemistry-message {
        font-size: 1rem;
    }
}

/* Custom Modal Styles */
.custom-result-modal {
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); /* Light gradient background */
    padding: 20px;
    z-index: 1051; /* Ensure result modal is on top */
}
.custom-loading-modal {
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); /* Light gradient background */
    padding: 20px;
    z-index: 1049; /* Ensure loading modal is below result modal */
}

.custom-result-modal .modal-header {
    border-bottom: none;
    padding-bottom: 0;
    justify-content: center; /* Center the title */
}

.custom-result-modal .modal-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
}

.custom-result-modal .modal-body {
    padding-top: 15px;
    padding-bottom: 25px;
}

.custom-result-modal #similarity-score {
    font-size: 3.5rem;
    font-weight: bolder;
    color: #007bff; /* Bootstrap primary blue */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.custom-result-modal #chemistry-message {
    font-size: 1.2rem;
    color: #555;
    margin-top: 15px;
}

.custom-loading-modal .modal-body {
    padding: 30px;
}

.custom-loading-modal .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: .3em;
}

.custom-loading-modal p {
    font-size: 1.1rem;
    color: #333;
    margin-top: 15px;
}
