body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.container {
    background-color: #ffffff;
    padding: 2rem 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

p {
    color: #7f8c8d;
    line-height: 1.6;
}

.uploader input[type="file"] {
    display: none; /* Hide the default file input */
}

.uploader label {
    background-color: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
    display: inline-block;
    margin: 1.5rem 0;
}

.uploader label:hover {
    background-color: #2980b9;
}

.preview {
    margin-top: 1rem;
    width: 100%;
    min-height: 200px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#imagePreview {
    max-width: 100%;
    max-height: 300px;
    display: none; /* Hidden until an image is selected */
}

#previewText {
    color: #bdc3c7;
}

#predictButton {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: background-color 0.3s;
}

#predictButton:hover {
    background-color: #27ae60;
}

#predictButton:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

#results {
    margin-top: 2rem;
    text-align: left;
    background-color: #ecf0f1;
    padding: 1rem;
    border-radius: 8px;
}

#results h2 {
    text-align: center;
    margin-top: 0;
    color: #2c3e50;
}

#loader {
    margin-top: 1.5rem;
}

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

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

.logo img {
    width: 400px;
    max-width: 100%;  
    height: auto;
    display: block;    
    margin: 0 auto;
}

/* --- Modal Styles for Error/Message Handling --- */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    text-align: center;
}

.modal-content h3 {
    color: #e74c3c; /* Red for errors */
    margin-top: 0;
    margin-bottom: 10px;
}

.modal-content p {
    color: #333;
    margin-bottom: 20px;
}

#modalCloseButton {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
}

#pneumoCam {
    margin-top:1.5rem;
    background-color:#ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

#overlayContainer {
    position:relative;
    width:100%;
    line-height:0;
    overflow:hidden;
    border-radius: 8px 8px 0 0;
}


#xrayOverlay {
    width:100%;
    display:block;
}

#heatmapOverlay {
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
    object-fit:cover;
    opacity:0.5;
}

#pneumoCamStrip {
    display:flex;
    justify-content: space-between;
    align-items:center;
    padding:0.6rem 1rem;
    background-color: #ffffff;
    overflow:visible;
}

#pneumoCamStrip span {
    font-weight:bold;
    font-size:0.85rem;
    color:#2c3e50;
    letter-spacing:0.05em;
}

#downloadBtn {
    position:relative;
    cursor:pointer;
    color:#2c3e50;
    display:flex;
    align-items:center;
}

#downloadBtn svg {
    width:20px;
    height:20px;
}

#downloadBtn .tooltip {
    display:none;
    position:absolute;
    bottom:125%;
    left:50%;
    transform:translateX(-50%);
    background:#333;
    color:white;
    padding: 4px 8px;
    border-radius:4px;
    font-size:0.75rem;
    white-space:nowrap;
}

#downloadBtn:hover .tooltip {
    display:block;
}
