body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
}

.icons {
    display: flex;
    justify-content: flex-start;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 2; /* Ensure the icons appear above other elements */
}

.icons a {
    margin-left: 10px;
    font-size: 36px;
    text-decoration: none;
    color: rgb(228, 228, 228);
}

.icons a:hover{
    color: white;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    color: #e2e2e2;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn.btn-github{
    background-color: #000000;
}

.btn.btn-github:hover {
    color: #fff;
}

.container {
    width: 100%;
    height: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

#imageInput {
    margin: 0px;
    padding: 5px 0px;
}

#uploadedImage {
    /* border: 2px solid #ccc; */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    max-width: 100%;
    display: none;
    margin-top: 10px;
}

#colorPalette {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.colorBox {
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    color: #333;
    font-weight: bold;
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.colorBox:hover {
    transform: scale(1.1);
}

.colorBox span {
    margin-bottom: 5px;
}

button {
    border-radius: 50%;
    cursor: pointer;
    border-style: solid;
}

button:active {
    border-style: solid;
}  

.tooltip {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px;
    border-radius: 3px;
}

/* Center content inside the image-placeholder */
.image-placeholder {
    border: 2px dashed #aaa;
    border-radius: 10px;
    padding: 30px;
    margin: 100px 0 20px 0;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;

    display: flex;            
    align-items: center;      
    justify-content: center;  
    text-align: center;      
    flex-direction: column; 
    width: 500px;
    height: 300px;            
    box-sizing: border-box;  
}

.image-placeholder p{
    font-size: 20px;
    margin-block-start: 10px;
    margin-block-end: 10px;
}

.image-placeholder .format {
    color: #aaa;
    font-size: 18px;
}

.image-placeholder:hover {
    background-color: #f0f8ff;
    border-color: #007bff;
}

.image-placeholder.drag-over {
    border-color: #007bff;
    background-color: #e6f7ff;
    color: #007bff;
    transition: border-color 0.3s, background-color 0.3s;
}

#colorChangeControls, #colorDistanceInput{
    width: 100%;
    max-width: 800px;
    display: none;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 7px 0px;
    border-radius: 5px;
    background-color: #740808;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#colorDistanceInput{
    display: none;
    flex-direction: column;
    margin-top: 10px;
    margin-bottom: 10px;
    gap: 0px;
}

.threshold{
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.explanation{
    display: none;
    margin: 0px 20px;
}

.explanation p{
    margin-block-start: 5px;
    margin-block-end: 0px;
    font-style: italic;
}

.change-color{
    font-weight: bold;
    color: white;
}

/* Button styling */
.apply-button {
    padding: 7px;
    background-color: inherit;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    border-style: solid;
    border-color: white;
    color: white;
    border: 2px solid white;
}

.apply-button:hover{
    transform: scale(1.05);
}

.apply-button:active {
    transform: scale(.95);
}

#explanationButton{
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

input[type='range'] {
    appearance: none;
    width: 30%;
    margin: 5px 0px;
    overflow: hidden;
    border-radius: 10px;
    background-color: var(--rangebackground,#f0f0f0);
}
  
input[type='range']::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    cursor: pointer;
    border-radius: 10px;
    background: var(--rangecolor, #2196F3);
    box-shadow: -195px 0 0 185px var(--rangecolor, #2196F3);
}
  
input[type='range']::-webkit-slider-thumb:hover{
    background: var(--rangehovercolor, #1976D2);
}

.mobilerow{
    display: unset;        
    flex-direction: unset; 
    gap: unset;                
    align-items: unset;   
}

@media only screen and (max-width: 767px) {
    .image-placeholder {
        max-width: calc(100% - 20px);
    }
    #colorChangeControls{
        flex-direction: column;
        gap: 10px;
    }
    .threshold{
        flex-direction: column;
    }
    .mobilerow{
        display: flex;
        flex-direction: row;
        gap: 20px;
        align-items: center;
    }
}