:root {
    --myPaleBlue: #4ecdc4;
    --myTopicColor: #32847e; /* #ff6b6b; */
    --myDarkDarkGray: #2b2b2b;
    --myDarkGray: #333;
    --myPaleGray: #556270; /*  #556270  // #555 */
    --myPalePaleGray: #6b7280; /*  #556270  // #555 */
    --myPaleRed: #fd4646;
    --myDarkRed: #b00d28;
    --myPaleGreen: #0db077;
    --myDarkGreen: #09744f;
    --myBlue: #007bff; /* #007bff;*/
    --myDarkBlue: #0056b3;
    --myWhite: #ffffff;
}

/* @property --myPaleBlue {
    syntax: "<color>";
    inherits: true;
    initial-value: #4ecdc4;
  } */

body {
    font-family: Arial, sans-serif;
    font-size: 18px;
    margin: 0;
    padding: 0;
    text-align: center;
    /* background-color: #f4f4f4; */
    /* background-color: white; */
    background-color: var(--myWhite);
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

#logo-text {
    width: 85%;
    height: auto;
    justify-content: center;
}

.styled-href {
    color: var(--myPaleBlue);
    text-decoration: none;
    font-weight: bold;
}
.page-container {
    min-height: 65vh; /* take full viewport height */
    display: flex;
    flex-direction: column; /* stack header, main, footer vertically */
}

.container {
    margin: auto;
    width: 90%;
    /* margin: 0 auto; */
    background-color: rgba(255, 255, 255, 0);
    /* box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); */
}

.overlayCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Ensure it doesn't block interaction with the image */
    z-index: 2; /* Ensure it's above the image */
    display: none; /* Initially hidden, shown when needed */
}

.row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1%;
    align-items: center;
}

.column {
    flex: 1;
    padding-top: 1%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

input[type="file"] {
    display: none;
}

/* Style for the custom file input button */
.custom-file-input {
    margin: 20px 0;
    margin-left: auto;
    margin-right: auto;
    width: 20%;
    padding: 10px;
    background-color: var(--myTopicColor);
    border: none;
    border-radius: 3px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-block;
    text-align: center;
    line-height: 40px;
}

/* Style for the file input label (to mimic button appearance) */
.custom-file-label {
    margin: 20px 0;
    margin-left: auto;
    margin-right: auto;
    width: 20%;
    padding: 10px;
    background-color: var(--myTopicColor);
    border: none;
    border-radius: 3px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
/* Change button background color on hover */
.custom-file-label:hover {
    background-color: var(--myPaleBlue);
}

#defaultImage,
#uploadedImage,
#entropyCanvas,
#imageCanvas {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

#histogramCanvas,
#entropyHistogramCanvas {
    width: 90%;
    max-width: 80%;
    height: 200px;
    margin: 0 auto 20px auto;
}

.slider-container {
    width: 90%;
    display: flex;
    flex-direction: column; /* Set to column to stack elements vertically */
    align-items: center;
    margin-bottom: 10px;
}

.slider-group {
    display: flex;
    justify-content: center; /* Centers the contents horizontally */
    align-items: center; /* Centers the contents vertically */
    gap: 10px; /* Adds some space between the elements */
    margin-bottom: 10px;
}

.slider {
    appearance: none;
    /* -webkit-appearance: none;
    -moz-appearance: none; */
    width: 100%;
    height: 10px;
    background: #ddd;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    border-radius: 5px;
}

.slider:hover {
    opacity: 1;
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--myBlue);
    cursor: pointer;
    border-radius: 50%;
}
.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--myBlue);
    cursor: pointer;
    border-radius: 50%;
}

.slider:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.slider:disabled::-webkit-slider-thumb {
    background: #999;
}

.slider:disabled::-moz-range-thumb {
    background: #999;
}

input[type="range"],
input[type="text"] {
    margin-right: 20px; /* Add spacing between slider and edit box */
    vertical-align: middle;
}

.img-magnifier-container {
    position: relative;
}

.img-magnifier-glass {
    position: absolute;
    /* position: relative; */
    border: 2px solid var(--myPaleGray);
    border-radius: 50%;
    cursor: none;
    width: 200px; /* Adjust based on your preference */
    height: 200px;
    visibility: hidden; /* Initially hidden, shown on hover */
    pointer-events: none; /* Ignore mouse events */
    z-index: 100; /* Ensure it's above the image */
}

/* NAVBAR STYLE */
/* .navbar{
    background-color: var(--myTopicColor);
} */

.navbar-right {
    display: flex;
    align-items: center;
    margin-left: auto; /* optional: keep this block at the right in a flex navbar */
}

.homebg {
    height: 100vh;
    display: flex;
    color: white;
    justify-content: center;
    align-items: center;
    font-size: 50px;
    background: linear-gradient(
        270deg,
        var(--myPaleRed),
        var(--myPaleGray),
        var(--myPaleBlue)
    );
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
}

.overlayImage {
    position: relative;
    width: fit-content;
    height: fit-content;
    display: none;
}

.error {
    color: darkred;
}

.text_area,
.sort_by {
    display: none;
}

.loading {
    height: 100%;
    /* height: 1vh; */
    display: flex;
    color: white;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    background: linear-gradient(
        270deg,
        var(--myPaleRed),
        var(--myPaleGray),
        var(--myPaleBlue)
    );
    background-size: 400% 400%;
    animation: gradientAnimation 8s ease infinite;
    display: none; /* Hidden by default */
}
.progress {
    width: 100%;
    height: 1px;
    background-color: white;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
    display: none; /* Hidden by default */
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.upper {
    text-transform: none;
    /* text-transform: uppercase; */
}

.colorbar {
    /* background: linear-gradient(to right, var(--myPaleGray), var(--myPaleGray)); */
    /* background: linear-gradient(to right, var(--myDarkGray), var(--myPaleBlue)); */
    /* background: black; */
    background: var(--myDarkGray);
    /* background: var(--myTopicColor); */
    /* background: linear-gradient(to right, var(--myDarkGray), var(--myPaleGray));    */
    /* background: var(--myTopicColor); */
    color: white;
    text-align: center;
    padding-top: 1px;
    padding-bottom: 0.5%;
    margin-bottom: 1%;
}

.colorbar2 {
    background: linear-gradient(
        to right,
        var(--myTopicColor),
        var(--myPaleBlue)
    );
    /* background: var(--myTopicColor); */
    color: white;
    text-align: center;
    padding-top: 1px;
    padding-bottom: 0.5%;
    margin-bottom: 1%;
}

nav {
    background: linear-gradient(
        to right,
        var(--myDarkGray),
        var(--myDarkDarkGray)
    );
    /* background: linear-gradient(to right, black, var(--myDarkGray));    */
    /* background: linear-gradient(to right, var(--myTopicColor), var(--myPaleBlue)); */
    background: var(--myDarkDarkGray);
    /* background: linear-gradient(to right, var(--myDarkGray), var(--myPaleBlue)); */
    color: white;
    /* overflow: hidden; */
    overflow: visible;
    padding-top: 0.5%;
    padding-bottom: 0.5%;
}
nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}
nav ul li {
    float: left;
}

nav ul li a {
    display: block;
    color: white;
    text-align: center;
    padding: 30px 20px;
    text-decoration: none;
}

nav ul li a:hover {
    /* background-color: var(--myPaleGray); */
    transition: 0.15s;
    transform: scale(1.15);
}

/* @media screen and (max-width: 80%) {
    nav ul {
        display: flex;
        flex-direction: column;
    }

    nav ul li {
        float: none;
    }
} */

/* Style for form */
form {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1%;
}

/* Style for form header */
form h1 {
    margin-bottom: 20px;
    text-align: center;
    color: var(--myDarkGray);
}

/* Style for form field labels */
form label {
    display: block;
    margin-bottom: 8px;
    color: #666;
}

/* Style for form input fields */
form input[type="text"],
form input[type="email"],
form input[type="password"],
form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 16px;
    box-sizing: border-box; /* Ensure padding and border are included in width */
}

form textarea {
    resize: vertical; /* Allow vertical resizing */
    min-height: 100px; /* Set a minimum height */
}

/* Style for form submit button */
form button[type="submit"] {
    width: 100%;
    padding: 10px;
    background-color: var(--myTopicColor);
    border: none;
    border-radius: 3px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button[type="submit"] {
    width: 100%;
    padding: 10px;
    background-color: var(--myTopicColor);
    border: none;
    border-radius: 3px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button[type="submit"]:hover,
form button[type="submit"]:hover {
    /* background-color: var(--myDarkBlue); */
    background-color: var(--myPaleBlue);
}

/* footer style */

footer {
    /* background-color: var(--myDarkGray); */
    height: auto;
    color: #fff;
    padding-top: 0%;
    /* background-color: #1e1e1e; */
    /* color: white; */
    text-align: center;
    /* padding: 1rem; */
}

footer .container {
    background-color: var(--myDarkGray);
    width: 100%;
    margin: 20 auto;
    padding-top: 15px;
    padding-bottom: 15px;
    min-height: 35vh;
}

.content {
    flex: 1; /* pushes footer to bottom */
}

select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 16px;
    box-sizing: border-box; /* Ensure padding and border are included in width */
}

/* image container */

.image-container {
    position: relative;
    width: fit-content;
    height: fit-content;
}

.image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.image1 {
    z-index: 1; /* The first image is below the second image */
}

.image2 {
    z-index: 2; /* The second image is above the first image */
    /* opacity: 0; Initially hidden */
    /* transition: opacity 0.5s ease; Add a transition effect */
}

/* end of image container */

#toolbar {
    margin-bottom: 10px;
}

.viewer_box {
    position: relative; /* Make sure it's positioned on top of #viewer */
    /* border: 1px solid black;  */
    width: 80%;
    height: 80%;
    margin: 0 auto;
}

.viewer_box > #viewer {
    width: 80%;
    /* height: 80%; */
    height: 100px;
    position: absolute; /* Make sure it's positioned relative to its containing div */
    border: 1px solid black;
}

.viewer_box > #viewer {
    /* position: absolute; Make sure it's positioned on top of #viewer */
    position: absolute; /* Make sure it's positioned on top of #viewer */
    /* top: 80px;
    left: 20px; */
    /* width: 800px; */
    width: 100%;
    height: 80%;
    border: 1px solid black;
    pointer-events: none; /* Ensure it doesn't block interaction with the OSD viewer */
}

.viewer_box > #viewer_konva {
    position: absolute; /* Make sure it's positioned on top of #viewer */
    /* top: 80px; */
    /* left: 20px; */
    /* width: 800px; */
    width: 100%;
    height: 80%;
    border: 1px solid black;
    pointer-events: none; /* Ensure it doesn't block interaction with the OSD viewer */
}

.viewer_box > .openseadragon-canvas {
    /* width: 800px; */
    width: 80%;
    /* width: auto; */
    height: 80%;
    outline: none;
    background-color: #f4f4f4 !important;
    border-radius: 3px;
    position: absolute;
}

#dragon_row {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
}

.viewer_box > #anchor {
    width: 80%;
    height: 80%;
    outline: none;
    background-color: #f4f4f4 !important;
    border-radius: 3px;
    position: relative;
}

.controls {
    position: relative;
    margin-top: 0%;
}

button {
    margin-right: 0px;
}

.viewer_box > .annotation-tools {
    position: relative;
    top: 10px;
    left: 175px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    padding-top: 10%;
}

.tool-btn {
    background-color: var(--myTopicColor);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 14px;
    transition: background-color 0.3s;
}

.tool-btn:hover {
    /* background-color: var(--myDarkBlue); */
    background-color: var(--myPaleBlue);
}

.tool-btn.active {
    background-color: var(--myPaleBlue);
}

#bgButton {
    background-color: var(--myPaleGreen);
}
#bgButton:hover {
    background-color: var(--myDarkGreen);
}

#bgButton.active {
    background-color: var(--myDarkGreen);
}

#asphaltButton {
    background-color: var(--myPaleRed);
}
#asphaltButton:hover {
    background-color: var(--myDarkRed);
}

#asphaltButton.active {
    background-color: var(--myDarkRed);
}

#fgButton {
    background-color: var(--myBlue);
}
#fgButton:hover {
    background-color: var(--myPaleBlue);
}

#fgButton.active {
    background-color: var(--myPaleBlue);
}

/* ------------------------------ */
/* TABLES */
/* ------------------------------ */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    margin-bottom: 20px;
}

th,
td {
    padding: 10px;
    border: 1px solid #ddd;
}

th {
    background-color: var(--myTopicColor);
    color: white;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

.btn-grant-admin-privileges,
.btn-details,
.btn-details-right,
.btn-details-left,
.btn-export {
    padding: 8px 12px;
    margin-right: 5px;
    border: none;
    border-radius: 3px;
    background-color: var(--myTopicColor);
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-details-right {
    padding-right: 32px; /* space for icon */
    background-image: url("/static/icons/arrow-right.png");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 12px;
}
.btn-details-left {
    padding-right: 32px; /* space for icon */
    background-image: url("/static/icons/arrow-left.png");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 12px;
}

.btn-grant-admin-privileges:hover,
.btn-remove-admin-privileges:hover,
.btn-details-right:hover,
.btn-details-left:hover,
.btn-details:hover,
.btn-export:hover {
    background-color: var(--myPaleBlue);
}

/*  */

.btn-remove-admin-privileges,
.btn-cancel {
    padding: 8px 12px;
    margin-right: 5px;
    border: none;
    border-radius: 3px;
    background-color: var(--myDarkRed);
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-remove-admin-privileges:hover,
.btn-cancel:hover {
    background-color: var(--myPaleRed);
}

input[type="text"],
input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--myBlue);
}

/* Navbar layout */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* background-color: #1e1e1e; */
    padding: 0.6rem 1.5rem;
    color: white;
    font-family: sans-serif;
    position: relative;
    z-index: 10; /* keep it above other sections */
    overflow: visible; /* <-- important! */
}

.navbar ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.navbar ul li {
    margin-right: 1rem;
}

.navbar a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

/* .navbar a:hover {
     color: #ffb400; 
     color: var(--myPaleGreen); 
} */

/* 🌐 Language Switcher */
/* .language-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-switcher a img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: transform 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.language-switcher a img:hover {
    transform: scale(1.1);
    /* border-color: #ffb400; 
    border-color: var(--myPaleGreen);
} */

/* 🌐 Language Dropdown */
.nav-dropdown {
    position: relative;
    display: inline-block;
    z-index: 1000; /* ensures the dropdown appears on top */
}
/* Show dropdown on hover (desktop) */
.nav-dropdown:hover .lang-menu,
.nav-dropdown:hover .user-menu {
    display: block;
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-weight: 500;
    padding: 0.3rem 0.5rem;
    transition: background 0.2s ease;
}

.lang-btn img.current-lang {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.lang-btn .arrow {
    font-size: 0.7rem;
    opacity: 0.8;
}

.user-menu,
.lang-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #2c2c2c;
    border-radius: 10px;
    min-width: 140px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 2000; /* ensures visibility even outside navbar */
    overflow: visible;
}

.lang-menu a,
.user-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 0.8rem;
    text-decoration: none;
    color: white;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.lang-menu a img,
.user-menu a img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

.lang-menu a:hover,
.user-menu a:hover {
    /* background: rgba(192, 188, 178, 0.2); */
    background: var(--myTopicColor);
}

.menu-mobile {
    display: flex;
    gap: 20px;
}

.hamburger {
    display: none;
    font-size: 35px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .menu {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    .menu.active {
        display: flex;
    }

    .antimenu.active {
        display: none;
    }

    .menu ul li a {
        display: block; /* 👈 important */
        width: 100%;
        padding: 12px 16px;
        /* border-top: 1px solid #ddd; */
    }

    .hamburger {
        display: block;
    }
    .navbar {
        flex-wrap: wrap;
    }
    .navbar-right {
        flex-wrap: wrap;
        /* flex-direction: column; */
        align-items: center;
        /* margin-left: 18vh; */
    }
    .navbar-right li {
        align-items: center;
        /* margin-left: 18vh; */
    }
}

/* Responsive adjustment */
/* @media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
    }
} */

.footer-link {
    color: white;
    text-decoration: none;
    transition: color 0.2s ease;
    font-style: italic;
}

footer .container p {
    margin: 5px 0;
}

.footer-link:hover {
    color: var(--myBlue);
}

.text-gray-500 {
    color: var(--myPalePaleGray); /* Tailwind's gray-500 */
    font-size: 0.875rem; /* Tailwind's text-sm */
    font-style: italic;
}

#imageType {
    display: none;
}

.footer-logo {
    height: 128px;
    vertical-align: middle;
    margin: 24px;
    margin-left: 30px;
    margin-right: 30px;
}

/* Email below avatar */
.user-email {
    font-size: 0.8rem;
    /* color: #ddd; */
    color: var(--myPalePaleGray);
    text-align: center;
    line-height: 1.1;
}

.profile-picture {
    border-radius: 50%;
    width: 200px;
    height: 200px;
    object-fit: cover;
    margin-bottom: 15px;
}

@media (max-width: 600px) {
    .profile-picture {
        width: 150px;
        height: 150px;
    }
}
