body {
    font-family: 'Montserrat', sans-serif;
    background-color: #353535;
    text-align: center;
    display: flex;
    justify-content: center;  /* Center horizontally */
    align-items: center;      /* Center vertically */
    flex-direction: column; /* Stack items vertically */
    min-height: 100vh;        /* Set the minimum height to 100% of the viewport */
    margin: 0;                /* Remove default margin */
    user-select: none; /* Prevent text selection */
    -webkit-user-select: none; /* Safari and Chrome (mobile and desktop) */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* Internet Explorer/Edge */
}

#mainContainer {
    position: relative;
    background-color: #f0f0f0; /* White background for the container */
    border-radius: 30px;    /* Rounded corners */
    padding: 40px;          /* Padding inside the container */
    box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.5); /* Shadow around the container */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 300px; /* Adjust width as needed */
}

/* The modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    justify-content: center;
    align-items: center;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

/* Modal content */
.modal-content {
    background-color: #fefefe;
    padding: 40px;
    border-radius: 20px;
    width: 600px; /* Fixed width for the modal */
    max-height: 80vh; /* Limit modal height */
    overflow-y: hidden;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: scale(0.7);
    transition: transform 0.3s ease-in;
}

.modal-content h2 {
    text-align: left;
    color: #505050;
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
    font-size: 26px;
    margin-bottom: 8px;
}

/* Scrollable container for the table */
#tableContainer {
    width: 100%; /* Full width of modal content */
    max-height: 300px; /* Set fixed height */
    overflow-y: auto; /* Enable vertical scrolling */
    margin-top: 10px;
}

/* Table styling */
#csvTable {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #505050; /* Add this line */
}

#csvTable th, #csvTable td {
    padding: 10px;
    border: 1px solid #505050;
}

#csvTable th {
    background-color: #203c75;
    color: white;
    font-weight: bold;
    text-align: left;
}

#csvTable td {
    text-align: left;
}

/* The close button (X) */
.close {
    color: #aaa;
    float: right;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
}

.close:hover,
.close:focus {
    color: #353535;
    text-decoration: none;
    cursor: pointer;
}

/* Load More button styling */
#loadMoreBtn {
    margin-top: 20px;
    padding: 12px 20px;
    background-color: #203c75;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    max-width: 180px;
}

#loadMoreBtn:hover {
    background-color: #3052a1;
}

/* Style for the upload box */
#uploadBox {
    width: 80%;
    height: 150px; /* Box height */
    border: 2px dashed #1d75b9; /* Dashed border */
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    margin: 0 auto; /* Center horizontally within its container */
    margin-bottom: 10px;
    color: #1d75b9; /* Text color for instructions */
}

#uploadBox:hover {
    background-color: #f0f4ff; /* Light background on hover */
}

/* Style for the upload icon inside the box */
#uploadIcon {
    width: 60px; /* Icon size */
    height: auto;
}

#uploadBox p {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 500;
}

/* Notification styling */
.notification {
    font-family: 'Montserrat', sans-serif;
    position: fixed;
    top: 45px; /* Adjust to place it at your desired location */
    left: 50%;
    transform: translateX(-50%);
    background-color: #53a85c; /* Success green color */
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    z-index: 200; /* Ensures it appears above other elements */
}

/* Style the settings icon */
#settingsIcon {
    position: absolute;
    top: 30px;
    left: 20px;
    width: 30px;
    height: auto;
    cursor: pointer;
    opacity: 0.69;
    transition: opacity 0.2s ease-in-out ;
}

#settingsIcon:hover {
    opacity: 1;
}

#topLogo {
    display: block;          /* Makes the image behave like a block element */
    width: 200px;             /* Set a width for the image (adjust as needed) */
    height: auto;             /* Maintain aspect ratio */
    margin: 0;
    margin-bottom:30px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

#topLogo:hover {
    transform: scale(0.95);
}

h1 {
    color: #505050;
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
    font-size: 40px;
    margin: 0;
    margin-bottom: 30px;
}

p {
    margin: 0px;
    margin-top: 5px;
}

/* Style for the new image icon on the right */
#imageIcon {
    position: absolute;
    top: 30px;
    right: 20px; /* Position it on the right */
    width: 35px;
    height: 35px;
    cursor: pointer;
    opacity: 0.69;
    transition: opacity 0.2s ease;
}

#imageIcon:hover {
    opacity: 1;
}

/* Image modal styling (reuses general .modal styles) */
#imageModal .modal-content {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers #imageContainer horizontally */
    position: relative;
    background-color: #fefefe;
    padding: 40px;
    border-radius: 20px;
    width: 600px; /* Adjusted width for image display */
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin: 0;
}

/* The close button (X) */
.modal-content .close {
    position: absolute;
    top: 20px; /* Position the close button from the top */
    right: 30px; /* Position the close button from the right */
    color: #aaa;
    float: right;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
}

.modal-content .close:hover,
.modal-content .close:focus {
    color: #353535;
    text-decoration: none;
    cursor: pointer;
}

/* Image container within the modal */
#imageContainer {
    width: 95%;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f4ff;
    border-radius: 20px;
    border: 2px dashed #1d75b9;
    margin-top: 30px;
    margin-bottom: 15px;
    overflow: hidden;
}

#imageContainer img {
    width: 100%;       /* Ensures image does not exceed container width */
    height: auto;
    object-fit: contain;   /* Maintains aspect ratio within container */
}

#imageContainer p {
    font-family: 'Montserrat', sans-serif;
    color: #505050;
    font-size: 18px;
    font-weight: 500;
}

/* Container to align icons to the left and add spacing */
#iconContainer {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-left: 20px;
    align-self: flex-start; /* Aligns the icons container to the left */
    width: 100%; /* Ensures it takes up full width for left alignment */
    z-index: 3;
}

/* Style for individual icons */
#downloadImageIcon, #fullScreenIcon {
    cursor: pointer;
    width: 30px;           /* Set width for consistent icon sizing */
    height: 30px;          /* Set height for consistent icon sizing */
    opacity: 0.8;          /* Slightly transparent for effect */
    transition: opacity 0.2s ease; /* Smooth hover effect */
}

/* Hover effect to enhance icon visibility */
#downloadImageIcon:hover, #fullScreenIcon:hover {
    opacity: 1;
}

#circleContainer {
    width: 220px; /* Larger than the stateCircle */
    height: 220px;
    border-radius: 50%;
    background-color: #f0f0f0; /* Grey background for the backdrop circle */
    display: flex;
    justify-content: center;
    align-items: center; /* Center the main circle inside the backdrop */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); /* Shadow for the backdrop */
    margin: 0;
    margin-bottom: 40px;
}

.circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: skyblue; /* Idle state color */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* Shadow for the main circle */
}

#stateCircle {
    /* Inherit the layout of .circle but apply scale transformation */
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: skyblue; /* Same as .circle */
    transform: scale(1); /* Default scale value */
    transition: transform 0.1s ease, background-color 0.3s ease;
}

button {
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
    font-size: 18px; /* Normal font size */
    width: 250px;
    color: white; /* Default text color */
    background-color: #3052a1; /* Default background color */
    padding: 25px; /* Button padding */
    border: none;
    border-radius: 40px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    user-select: none; /* Prevent text selection */
    transition: background-color 0.3s ease-in-out; /* Smooth transition */
}

button:hover {
    background-color: #253f7c;
}

button:disabled {
    background-color: #ccc !important;
    color: #666;
    cursor: not-allowed;
}

/* Loading overlay styling */
#loadingOverlay {
    display: none; /* Initially hidden, change to 'flex' only when needed */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.80);
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Simple spinner animation */
.loader {
    border: 6px solid #f3f3f3; /* Light grey */
    border-top: 6px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* New styles for the error page */
.error-message-container {
    max-width: 600px;
    margin: 0 auto 40px auto;
    padding: 20px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.error-actions {
    margin: 30px auto;
}

.error-actions a.button {
    display: inline-block;
    text-decoration: none;
    font-size: 18px;
    color: white;
    background-color: #3052a1;
    padding: 15px 30px;
    border-radius: 10px;
    margin: 0 10px;
    transition: background-color 0.2s ease;
}

.error-actions a.button:hover {
    background-color: #203c75;
}

.error-actions a.button:active {
    transform: scale(0.98);
}

/* For screens that are 768px wide or less (typical for tablets and phones) */
@media only screen and (max-width: 768px) {
    body {
        background-color: #f0f0f0;
    }

    #mainContainer {
        box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);
    }

    .modal {
        background-color: #fefefe; /* Semi-transparent background */
    }

    .modal-content {
        box-shadow: 0 0px 0px rgba(0, 0, 0, 0);
        overflow-y: auto; /* Allow modal to scroll if content exceeds height */
    }

    #imageModal .modal-content {
        box-shadow: 0 0px 0px rgba(0, 0, 0, 0);
    }

    #imageContainer p {
        font-size: 16px;
        padding: 0 20px;
    }

    .modal-content h2 {
        font-size: 22px;
    }

    #uploadBox {
        width: 75%;
        height: 120px; /* Box height */
    }

    #uploadIcon {
        width: 40px; /* Icon size */
    }

    #uploadBox p {
        font-size: 13px;
        margin: 0px;
        margin-bottom: 0px;
    }
}