/* Overlay style */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Darker translucent background */
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it covers everything */
}

/* Loader container */
.loader {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Loader style */
.loader:before, .loader:after {
    content: '';
    width: 60px; /* Width of the loader */
    height: 60px; /* Height of the loader */
    border-radius: 50%;
    position: absolute;
    border: 8px solid transparent; /* Transparent border for the loader */
    border-top-color: #3498db; /* Color of the top border */
    animation: spin 1s linear infinite; /* Spin animation */
}

/* Second loader circle */
.loader:after {
    border-top-color: #e74c3c; /* Different color for the second loader */
    animation-delay: -0.5s; /* Delay for the second loader */
}

/* Spin animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Optional: Add a text message below the loader */
.loader-text {
    margin-top: 10px;
    color: #ffffff; /* White text color */
    font-size: 1.2rem; /* Font size */
    text-align: center;
}


/* General navbar styling */
.navbar {
    background-color: #1a1a3a; /* Dark background color */
    padding: 10px 20px;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto; /* Center align navbar content */
}

/* Title and subtitle container styling */
.title-subtitle {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align text to the left */
    color: #ffffff; /* White text color */
}

.title {
    font-size: 30px;
    font-weight: bold;
}

.subtitle {
    font-size: 14px;
    font-weight: normal;
    color: #dddddd; /* Lighter color for subtitle */
}

/* Logo styling */
.navbar-logo {
    height: 40px; /* Adjust size as needed */
    width: auto;
    margin: 0 auto; /* Center logo in the middle */
}

/* Avatar styling */
.navbar-avatar {
    height: 40px; /* Match logo height */
    width: auto;
    border-radius: 50%; /* Circular avatar */
}


@media (max-width: 769px) {
    /* Basic Reset */
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    @media (max-width: 769px) {
        .header {
            flex-direction: column; /* Stacks items vertically on smaller screens */
            align-items: center; /* Centers items horizontally in column layout */
        }
    }
    

    body {
        display: block;
        background: linear-gradient(135deg, #f0f8ff, #e6e6fa);
    }

    /* Body and Container Styling */
    .banner {
        font-family: Arial, sans-serif;
        display: flex;
        justify-content: center;  /* Align content to the top */
        align-items: center;         /* Center content horizontally */
        width: 100%;                 /* Ensure the banner spans the full width */
    }

    /* Majority Section */
    .majority {
        display: flex;
        flex-wrap: wrap; /* Allow items to wrap onto the next line */
        justify-content: center; /* Center the items horizontally */
        padding-top: 20px; /* Space at the top for the image */
        gap: 1.0%; /* Space between the containers */
    }

    .top-center-image {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-bottom: 20px; /* Space below the image */
    }

    .top-center-image img {
        max-width: 100%;
        height: auto;
    }

    /* Main Container Styling */
    .container {
        text-align: center;
        background: #fff;
        padding: 30px 20px;
        border-radius: 12px;
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
        max-width: 400px;
        width: 90%;
        margin-bottom: 20px;
        animation: fadeIn 1.2s ease-in-out;
    }

    .container1 {
        flex-basis: 100%; /* Make this container take the full width */
        margin-top: 20px; /* Add some space above this container */
        text-align: center;
        background: #fff;
        padding: 30px 20px;
        border-radius: 12px;
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    }

    /* Title Styling */
    h1 {
        font-size: 2rem;
        color: #333;
        margin-bottom: 10px;
    }

    /* Instruction Text */
    p {
        font-size: 1rem;
        color: #555;
        margin-bottom: 20px;
    }

    /* Custom File Input */
    .file-label {
        display: inline-block;
        cursor: pointer;
        color: #fff;
        background-color: #007BFF;
        padding: 10px 20px;
        border-radius: 6px;
        font-weight: bold;
        transition: background-color 0.3s ease;
        margin-bottom: 15px;
    }

    .file-label:hover {
        background-color: #0056b3;
    }

    .file-label input[type="file"] {
        display: none;
    }

    /* Button Styling */
    button {
        padding: 10px 20px;
        background-color: #28a745;
        color: #fff;
        font-weight: bold;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        transition: background-color 0.3s ease, transform 0.2s;
    }

    button:hover {
        background-color: #218838;
        transform: scale(1.05);
    }

    /* Result and Error Styling */
    .result, .error {
        margin-top: 20px;
        font-size: 1.2em;
    }

    .result {
        color: #333;
    }

    .error {
        color: #dc3545;
        font-weight: bold;
    }

    /* Preview Image Styling */
    #image-preview {
        margin-top: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #preview-image {
        max-width: 100%;
        max-height: 200px;
        border-radius: 8px;
        box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
        display: none;
    }

    /* Leaderboard Styling */
    #leaderboard {
        margin-top: 20px;
        padding: 10px;
        background-color: #f8f9fa;
        border-radius: 8px;
    }

    .leaderboard-entry {
        font-size: 1rem;
        padding: 5px 0;
        color: #333;
    }

    /* Auth Section Styling */
    #auth-section {
        margin-bottom: 20px;
    }

    #auth-section input, #auth-section button {
        padding: 10px;
        margin: 5px 0;
        width: 100%;
        max-width: 300px;
    }

    #auth-section button {
        background-color: #007bff;
        color: #fff;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        transition: background-color 0.3s;
    }

    #auth-section button:hover {
        background-color: #0056b3;
    }

    /* Fade-in Animation */
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }

}



@media (min-width: 769px) {


    /* Basic Reset */
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    body {
        display: block;
        background: linear-gradient(135deg, #f0f8ff, #e6e6fa);
    }

    /* Body and Container Styling */
    .banner {
        font-family: Arial, sans-serif;
        display: flex;
        justify-content: center;  /* Align content to the top */
        align-items: center;         /* Center content horizontally */
        width: 100%;                 /* Ensure the banner spans the full width */
    }

    .majority {
        font-family: Arial, sans-serif;
        display: flex;
        flex-wrap: wrap;
        flex-direction: row;
        align-items: start;
        padding-top: 20px; /* Space at the top for the image */
        justify-content: center;
        gap: 1.0%;
    }

    .top-center-image {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-bottom: 20px; /* Space below the image */
    }

    .top-center-image img {
        max-width: 100%;
        height: auto;
    }

    /* Main Container Styling */
    .container {
        text-align: center;
        background: #fff;
        padding: 30px 20px;
        border-radius: 12px;
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
        max-width: 400px;
        /* width: 90%; */
        margin-bottom: 20px;
        animation: fadeIn 1.2s ease-in-out;
    }

    .container1 {
        text-align: center;
        background: #fff;
        padding: 30px 20px;
        border-radius: 12px;
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
        max-width: 400px;
        /* width: 90%; */
        margin-bottom: 20px;
        animation: fadeIn 1.2s ease-in-out;
    }

    .container2 {
        text-align: center;
        background: #fff;
        padding: 30px 20px;
        border-radius: 12px;
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
        max-width: 400px;
        /* width: 90%; */
        margin-bottom: 20px;
        animation: fadeIn 1.2s ease-in-out;
    }

    .main-container {
        text-align: center;
        border-radius: 12px;
        max-width: 400px;
        width: 100%;
        animation: fadeIn 1.2s ease-in-out;
    }

    #classification-container {
        width: 100%;
        /* margin-top: 110px; Adjusts space between leaderboard and classification result */
        padding: 30px;
        padding-top: 10px;
        background-color: #f9f9f9; /* Light background for the classification area */
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        display: none; /* Initially hidden */
        transition: all 0.3s ease;
        overflow-x: scroll; 
        height: 700px;
        position: relative;
    }

    /* Title Styling */
    h1 {
        font-size: 2rem;
        color: #333;
        margin-bottom: 10px;
    }

    /* Instruction Text */
    p {
        font-size: 1rem;
        color: #555;
        margin-bottom: 20px;
    }

    /* Custom File Input */
    .file-label {
        display: inline-block;
        cursor: pointer;
        color: #fff;
        background-color: #007BFF;
        padding: 10px 20px;
        border-radius: 6px;
        font-weight: bold;
        transition: background-color 0.3s ease;
        margin-bottom: 15px;
    }

    .file-label:hover {
        background-color: #0056b3;
    }

    .file-label input[type="file"] {
        display: none;
    }

    /* Button Styling */
    button {
        padding: 10px 20px;
        background-color: #28a745;
        color: #fff;
        font-weight: bold;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        transition: background-color 0.3s ease, transform 0.2s;
    }

    button:hover {
        background-color: #218838;
        transform: scale(1.05);
    }

    /* Result and Error Styling */
    .result, .error {
        margin-top: 20px;
        font-size: 1.2em;
    }

    .result {
        color: #333;
    }

    .error {
        color: #dc3545;
        font-weight: bold;
    }

    /* Preview Image Styling */
    #image-preview {
        margin-top: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #preview-image {
        max-width: 100%;
        max-height: 200px;
        border-radius: 8px;
        box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
        display: none;
    }

    /* Leaderboard Styling */
    #leaderboard {
        margin-top: 20px;
        padding: 10px;
        background-color: #f8f9fa;
        border-radius: 8px;
    }

    .leaderboard-entry {
        font-size: 1rem;
        padding: 5px 0;
        color: #333;
    }

    /* Auth Section Styling */
    #auth-section {
        margin-bottom: 20px;
    }

    #auth-section input, #auth-section button {
        padding: 10px;
        margin: 5px 0;
        width: 100%;
        max-width: 300px;
    }

    #auth-section button {
        background-color: #007bff;
        color: #fff;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        transition: background-color 0.3s;
    }

    #auth-section button:hover {
        background-color: #0056b3;
    }

    /* Fade-in Animation */
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }
}
