body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
}

.container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 500px;
    width: 100%;
    box-sizing: border-box;
}

h1 {
    color: #1a1a1a;
    margin-bottom: 10px;
}

p {
    color: #666;
    line-height: 1.6;
}

.upload-container {
    margin: 20px 0;
}

.upload-label {
    background-color: #007bff;
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.upload-label:hover {
    background-color: #0056b3;
}

#image-preview-container {
    margin-top: 20px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 10px;
    background-color: #fafafa;
    position: relative; /* Needed for positioning bounding boxes */
    line-height: 0; /* To prevent extra space below the image */
}

#image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 6px;
}

#box-container {
    position: absolute;
    top: 10px; /* Match parent padding */
    left: 10px; /* Match parent padding */
    right: 10px; /* Match parent padding */
    bottom: 10px; /* Match parent padding */
    pointer-events: none; /* Allow clicks to go through to the image if needed */
}

.bounding-box {
    position: absolute;
    box-sizing: border-box;
    border: 2px solid;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex; /* To position the label */
    align-items: flex-start;
    justify-content: flex-start;
}

.bounding-box.highlight {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.object-label {
    position: absolute;
    bottom: 100%; /* Position label outside, on top of the box */
    left: -2px; /* Align with box border */
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: all; /* Allow interaction with label if needed */
}

button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover:not(:disabled) {
    background-color: #218838;
    transform: translateY(-2px);
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#loading {
    margin-top: 20px;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #007bff;
    animation: spin 1s ease infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

#result-container {
    margin-top: 30px;
    background-color: #e9f5ff;
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid #007bff;
    text-align: left;
}

#result-container h2 {
    margin-top: 0;
    color: #0056b3;
}

#object-list {
    list-style-type: disc;
    padding-left: 20px;
    margin: 10px 0 0;
}

#object-list li {
    margin-bottom: 8px;
    color: #333;
    line-height: 1.5;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

#object-list li:hover {
    background-color: #d4eaff;
}

#object-list li.active {
    background-color: #cce5ff;
    font-weight: bold;
}

#song-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

#song-reasoning {
    font-style: italic;
    color: #555;
}

.hidden {
    display: none;
}