/* General body font */
:root {
    --default-font: "Roboto", system-ui, sans-serif;
    --heading-font: "Raleway", sans-serif;
    --nav-font: "Poppins", sans-serif;
}

/* Layout for the gallery */
.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    /* Center items for a clean layout */
    gap: 15px;
    padding: 20px;
}

/* Ensures each item adapts responsively */
.gallery-item {
    flex: 1 1 calc(33.33% - 20px);
    /* Default: 3 per row */
    max-width: calc(33.33% - 20px);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item img {
    width: 100%;
    height: 350px;
    display: block;
}

.gallery-item:hover {
    transform: scale(1.05);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .gallery-item {
        flex: 1 1 calc(50% - 20px);
        /* 2 per row on tablets */
        max-width: calc(50% - 20px);
    }
}

@media (max-width: 600px) {
    .gallery-item {
        flex: 1 1 100%;
        /* Full width on mobile */
        max-width: 100%;
    }
}

/* Main container and image comparison layout */
.main-container {
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
}


/* Left section styling */
.left-section {
    background-color: #f9f9f9;
    /* Light background for better readability */
    border: 1px solid #ddd;

    padding: 20px 30px;
    /* Balanced padding */
    text-align: left;
    /* Left align text for better readability */
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* Space between items */
}

.left-section p {
    font-size: 16px;
    /* Slightly larger text for readability */
    line-height: 1.6;
    /* Better line spacing */
    margin: 0;
    /* Remove default margins */
    color: #333;
    /* Darker text for contrast */
}



.options-section label {
    display: flex;
    align-items: center;
    /* Align radio and text */
    font-size: 15px;
    cursor: pointer;
    /* Indicate clickable element */
    color: #555;
    /* Slightly lighter text */
}

.options-section label input {
    margin-right: 8px;
    /* Space between radio button and label text */
}

#attack-strength-text {
    font-size: 16px;
    font-weight: 400;
    /* Normal weight for description */
    margin: 0;
}

.btn-group {
    display: flex;
    justify-content: center;
    /* Center align buttons */
    gap: 10px;
    /* Space between buttons */
    margin-top: 10px;
    /* Space above buttons */
}



#value-buttons-section {
    margin-top: 10px;
    /* Space above the radio buttons */
}

#dynamic-radio-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    /* Space between dynamically generated buttons */
}

.tooltip-radio {
    font-size: 12px;
    /* Smaller tooltip text */
    color: #666;
    display: block;
    margin-top: 5px;
    /* Space below radio buttons */
}


/* Image containers for XAI and Non-XAI models */
.image-container {
    position: relative;
}

.image-container img {
    display: block;
    width: 550px;
    height: 550px;
}

.image-container canvas {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 550px;
    height: 550px;
    /* pointer-events: none; */
}

.bbox-hover {
    position: absolute;
    background-color: rgba(255, 255, 0, 0.5);
    /* Transparent yellow */
    border: 2px solid green;
    /* Green border */
    display: none;
    /* Hidden by default */
    padding: 5px;
    border-radius: 5px;
}

.canvas-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    /* Hover boxes should be above everything */
}

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    pointer-events: none;
    display: none;
    max-width: 250px;
}

.tooltip.show {
    display: block;
}

.image-container h4 {
    font-size: 20px;
    margin-top: 5px;
    align-self: center;
    padding: 5px;
}

/* Spacing between images */
#image-comparison-container {
    display: flex;
    justify-content: space-evenly;
    /* gap: 40px; */
    margin-top: 20px;
    margin-bottom: 20px;
    width: 100%;
    height: auto;
    flex-wrap: wrap;
}

/* Findings section initially hidden */
.findings-section {
    display: none;
    margin-top: 20px;
    padding: 15px;
    background-color: #f1f1f1;
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
}


.findings-section p {
    margin: 8px 0;
    display: flex;
}

/* Button styling */
/* .result-button, */
.back-button {
    padding: 10px 25px;
    border-radius: 5px;
    font-size: 16px;
    transition: all 0.3s ease;
}

/* .result-button {
    background-color: #f4c542;
    color: black;
    border: 1px solid black;
}

.result-button:hover {
    background-color: black;
    color: #f4c542;
} */

.back-button {
    border: 1px solid #ccc;
    background-color: transparent;
    color: #333;
}

.back-button:hover {
    background-color: #f4c542;
    color: black;
}

/* Spacing for demo buttons */
.demo-buttons {
    display: flex;
    justify-content: space-between;
    /* margin-top: 30px; */
}

/* Upload image button */
.upload-image {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background-color: #007bff;
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    margin-left: 15px;
}

.upload-image i {
    margin-right: 8px;
}

.upload-image:hover {
    background-color: #0056b3;
}

/* Radio button section */
.options-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

/* .options-section label {
    display: inline-block;
    margin-right: 20px;
    font-size: 18px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: color 0.3s;
} */

.options-section label:hover {
    color: #f4c542;
}

.options-section [type=radio] {
    accent-color: #f4c542;
}

/* Dynamic radio button styling */
#dynamic-radio-group .btn {
    border: 2px solid #f4c542;
    width: 10%;
    color: black;
    text-align: center;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    margin-right: 10px;
    cursor: pointer;
    padding: 8px 12px;
}

#dynamic-radio-group .btn:hover {
    background-color: #e0a800;
    color: black;
    border-color: #f4c542;
}

#dynamic-radio-group .btn-check:checked+.btn {
    background-color: #e0a800;
    color: black;
    border-color: #f4c542;
}


/* Spacing for other elements */
.wrapper {
    margin-top: 20px;
}

.back-button-div {
    margin: 50px;
}

/* Blur effect for loading */
.blur-effect {
    filter: blur(10px);
    transition: filter 0.3s ease;
}

/* The Modal (background) */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in place */
    z-index: 1000;
    /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    /* Full width */
    height: 100%;
    /* Full height */
    overflow: auto;
    /* Enable scroll if needed */
    background-color: white;
    /* Fallback color */
    background-color: white;
    /* Black with opacity */
}



/* Caption of the image */
#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

/* Add Animation - Zoom in the Modal */
.modal-content,
#caption {
    animation-name: zoom;
    animation-duration: 0.6s;
}

@keyframes zoom {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}




/* anotherrr */

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    /* Black with opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    text-align: center;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

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

/* General Annotations Container */
/* General Annotations Container */
#non-xai-annotations,
#xai-annotations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Prevent annotations from blocking clicks */
}

/* Annotation Text Box */
.annotation {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    color: #000;
    pointer-events: auto;
    /* Allow pointer events for annotation text */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 200px;
    transform: translate(-50%, -100%);
    /* Position above the target */
}

/* Arrows for Annotations */
.annotation .arrow {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 10px 0 10px;
    /* Create a triangle */
    border-color: #f4c542 transparent transparent transparent;
    /* Black triangle */
    position: absolute;
    bottom: -10px;
    /* Position below the text box */
    left: 50%;
    /* Centered horizontally */
    transform: translateX(-50%);
}


/* Close Annotations Button */
#close-non-xai-annotations,
#close-xai-annotations {
    position: absolute;
    top: 10px;
    right: 10px;
    background: red;
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

#close-non-xai-annotations:hover,
#close-xai-annotations:hover {
    background: darkred;
}

/* Show Annotations Button */
#show-non-xai-annotations,
#show-xai-annotations {
    margin-top: 10px;
    display: none;
    /* Hidden by default */
    padding: 8px 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

#show-non-xai-annotations:hover,
#show-xai-annotations:hover {
    background: #0056b3;
}

/* Highlight the Annotation Area */
.annotation-highlight {
    outline: 2px dashed rgba(0, 0, 255, 0.6);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .annotation {
        font-size: 12px;
        max-width: 150px;
    }

    #close-non-xai-annotations,
    #close-xai-annotations {
        padding: 6px 10px;
        font-size: 12px;
    }

    #show-non-xai-annotations,
    #show-xai-annotations {
        padding: 6px 10px;
        font-size: 12px;
    }
}


.tooltip-radio {
    position: absolute;
    visibility: hidden;
    opacity: 0;
    background-color: #fffffffb;
    /* Change to black for dark themes */
    color: #000;
    /* Change to white for dark themes */
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    font-family: "Roboto", sans-serif;
    line-height: 1.5;
    max-width: 250px;
    text-align: center;
    z-index: 1000;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    transform: translateY(-10px);
    /* Initial position (up) */
}

.tooltip-radio::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

.info-icon-wrapper:hover .tooltip {
    display: block;
    /* Show on hover */
}

.info-icon {
    cursor: pointer;
    margin-left: 5px;
    color: black;
    font-size: 18px;
    vertical-align: middle;
}

.info-icon:hover+.tooltip-radio {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    /* Move to its final position */
}


@media (max-width: 768px) {
    .tooltip-radio {
        width: 100%;
        /* Full width on smaller screens */
        max-width: 90%;
        /* Avoid edge clipping */
        font-size: 10px;
        /* Adjust font size for readability */
    }
}

.xaiHeading {
    width: 100%;
    border: 1px solid #ddd;
    border-bottom: 0;
    text-align: center;
    background-color: #f9f9f9;

}

.button-section {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 30px;
}

.button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    flex: 1 1 45%;
    /* Allow buttons to occupy equal space on two columns */
}

.button-instruction {
    font-size: 16px;
    color: #555;
    margin-bottom: 10px;
    align-self: flex-start;
    /* Ensure the instructions do not become too wide */
}

.result-button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #ffc107;
    border: none;
    border-radius: 5px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.result-button:hover {
    background-color: #e0a800;
}


.steps-info {
    max-width: auto;
    margin: auto;
    background-color: #f9f9f9;
    /* border-radius: 10px; */
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;

}

.accordion-button {

    background-color: rgb(162, 160, 160) !important;
    color: white !important;
    border-radius: 0 !important;
}

.accordion-button:focus {
    box-shadow: none !important;
}

.accordion-button:not(.collapsed) {
    background-color: #f9f9f9 !important;
    color: black !important;
    border-radius: 0 !important;
}


/* 🔹 Button Container */
/* 🔹 Button Container */
.demo-buttons {
    display: flex;
    justify-content: space-between;
    /* Places one button on the left and one on the right */
    align-items: center;
    width: 100%;
    padding: 10px 20px;
    position: relative;
}

/* 🔹 Base Button Styles */
.custom-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease-in-out;
    white-space: nowrap;
    text-align: center;
    border: 2px solid transparent;
    min-width: 180px;
}

/* 🔹 Back Button (Left) */
.custom-button.back {
    background-color: white;
    /* Gray (Neutral) */
    color: black;
    border: 2px solid #6c757d;
}

.custom-button.back:hover {
    background-color: #e0a800;
    color: #6c757d;
    border: 2px solid #6c757d;
}

/* 🔹 Upload Button (Right) */
.custom-button.upload {
    background-color: #ffc107;
    /* Website's primary blue */
    color: black;
    border: 2px solid #ffc107;
}

.custom-button.upload:hover {
    background-color: #e0a800;
    color: black;
    border: 2px solid #e0a800;
}

/* 🔹 Icons */
.custom-button i {
    margin-right: 8px;
}

/* 🔹 Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .demo-buttons {
        flex-direction: row;
        justify-content: space-between;
        padding: 10px;
    }

    .custom-button {
        width: auto;
        font-size: 14px;
        padding: 10px 15px;
    }
}