/* Default Light Mode Variables */
:root {
    --bg-color: #f4f4f4;
    --text-color: #333;
    --border-color: #ccc;
    --button-bg-color: #0275d8;
    --button-hover-bg-color: #025aa5;
    --delete-button-color: #d9534f;
    --delete-hover-color: #c9302c;
    --rename-button-color: #0275d8;
    --menu-bg-color: #ffffff;
    --menu-item-hover-bg-color: #848484;
    --menu-item-text-color: #000000;
    --model-bg-color: white;
    --model-shadow-color: rgba(0, 0, 0, 0.2);
    --model-caption-color: #ccc;
    --input-bg-color: #f2f2f2;
}

/* Dark Mode Variables */
.dark-mode {
    --bg-color: #1e1e1e;
    --text-color: #e4e4e4;
    --border-color: #555;
    --button-bg-color: #0056b3;
    --button-hover-bg-color: #003e7e;
    --delete-button-color: #b52a2a;
    --delete-hover-color: #a12121;
    --rename-button-color: #0056b3;
    --menu-bg-color: #333;
    --menu-item-hover-bg-color: #444;
    --menu-item-text-color: #e4e4e4;
    --model-bg-color: #333;
    --model-shadow-color: rgba(255, 255, 255, 0.1);
    --model-caption-color: #aaa;
    --input-bg-color: #2d2d2d;
    --bg-file-color: #1e1e1e;
}

/* Light Mode Variables */
.light-mode {
    --bg-color: #f4f4f4;
    --text-color: #333;
    --border-color: #ccc;
    --button-bg-color: #0275d8;
    --button-hover-bg-color: #025aa5;
    --delete-button-color: #d9534f;
    --delete-hover-color: #c9302c;
    --rename-button-color: #0275d8;
    --menu-bg-color: #ffffff;
    --menu-item-hover-bg-color: #ececec;
    --menu-item-text-color: #000000;
    --model-bg-color: white;
    --model-shadow-color: rgba(0, 0, 0, 0.2);
    --model-caption-color: #ccc;
    --input-bg-color: #b8b8b8;
    --bg-file-color: #e7e7e7;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

h1 {
    text-align: center;
    color: var(--text-color);
}

.file-list-container {
    display: flex;
    justify-content: center;
    margin: auto;
    border: 1px solid var(--border-color);
    background-color: var(--bg-file-color);
    box-shadow: 0 2px 8px var(--model-shadow-color);
    flex-grow: 0;
    overflow-y: auto;
    max-height: calc(100vh - 12rem);
    min-height: calc(100vh - 12rem);
    border-radius: 3rem;
    /* Hide scrollbar */
    scrollbar-width: none; /* For Firefox */
    -ms-overflow-style: none; /* For Internet Explorer and Edge */
    margin-right: 2rem;
    margin-left: 2rem;
}

/* Hide scrollbar for WebKit browsers */
.file-list-container::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}


/* Style for the file list container */
#file-list {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping when containers overflow */
    gap: 1rem; /* Space between file containers */
    justify-content: center; /* Align items horizontally */
    margin: auto;
    align-items: space-evenly; /* Align items vertically */
    padding-top: 1rem;
    padding-bottom: 1rem;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 100%;
    background-color: var(--bg-file-color);
}

/* Style for each individual file container */
.file-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 15rem; /* Set a fixed width for each file container */
    text-align: center;
    word-wrap: break-word; /* Ensure long filenames wrap correctly */
    box-sizing: border-box;
    margin: auto;
    background-color: var(--input-bg-color);
    border-radius: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    transition: transform 0.3s ease-in-out;
    overflow: hidden; /* Hides overflowed text */
    text-overflow: ellipsis; /* Adds ellipsis for overflowed text */
}
/* Normal hover effect */
.file-container:hover {
    transform: scale(1.1);
    cursor: pointer;
}

/* Active/focused state (applies when clicked) */
.file-container.active {
    transform: scale(1.1);
    cursor: pointer;
    box-shadow: 0 0 10px var(--button-hover-bg-color); /* Optional: add a shadow to highlight the active state */
    border: 2px solid var(--button-hover-bg-color); /* Optional: highlight border when active */
}

.filename-input[readonly] {
  resize: none;
  overflow: hidden;
  height: 1.6em; /* one line high */
}

.filename-container {
  padding: 1rem;
  text-align: center;
  color: var(--text-color);
  max-height: 5rem;
}

.filename-container textarea.active {
  height: 10rem;
  cursor: pointer;
  box-shadow: 0 0 10px var(--button-hover-bg-color);
  border: 2px solid var(--button-hover-bg-color);
}



/* Style for file icons/images */
.file-container img {
    max-width: 100%;
    height: auto;
}

/* Style for file names */
.file-container p {
    font-size: 14px;
    margin: 0;
    word-break: break-word; /* Ensures long words break nicely */
    color: var(--text-color);
}

/* Style for delete buttons */
.delete-button img {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Popup model styling */
.model {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    padding: 20px;
    background-color: var(--model-bg-color);
    box-shadow: 0 4px 8px var(--model-shadow-color);
    border-radius: 8px;
}

.model.active {
    display: block;
}

.model-header {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--text-color);
}

.model-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.model-button {
    padding: 8px 16px;
    border: none;
    background-color: var(--delete-button-color);
    color: white;
    cursor: pointer;
    border-radius: 4px;
}

.model-button.cancel {
    background-color: var(--button-bg-color);
}

.model-button.rename {
    background-color: var(--rename-button-color);
}

.rename-input {
    margin-top: 10px;
    display: none;
    background-color: var(--input-bg-color);
    color: var(--text-color);
}

.file-list-container.drag-over {
    border: 2px dashed var(--button-bg-color);
    background-color: var(--button-hover-bg-color);
}

/* Menu styling */
.menu {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0px;
    background-color: var(--bg-color);
    height: 4rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
}

.menu-item {
    margin: 0 15px;
    transition: transform 0.3s ease-in-out;
    /* position: relative; */
}

.menu-item img {
    width: 64px;
    height: auto;
    display: block;
}

.menu-item:hover {
    transform: scale(1.2);
    cursor: pointer;
}

.menu-item:hover::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--menu-item-hover-bg-color);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    white-space: nowrap;
    opacity: .7;
}

.menu-item img {
    filter: brightness(1.5);
}

.menu-item span {
    color: var(--menu-item-text-color);
}

/* The model (background) */
.image-model {
    display: none;
    position: fixed;
    z-index: 1000;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.image-model img {
    border-radius: 3.5rem;
    max-height: 80%; /* Ensure the image takes up no more than 80% of the modal height */
    max-width: 100%; /* Ensure the image takes up no more than 100% of the modal width */
    object-fit: contain; /* Ensure the image maintains aspect ratio */
    width: auto; /* Ensure width adjusts automatically based on aspect ratio */
    height: auto; /* Ensure height adjusts automatically based on aspect ratio */
}


/* Model Image */
.model-content {
    margin: auto;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* Caption (image text) */
.image-caption {
    color: var(--model-caption-color);
    text-align: center;
    font-size: 1rem;
    padding-bottom: 2rem;
}
.image-caption-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* Close button */
.close-model {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

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


/* Styling the form and inputs */
#upload-form {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.custom-button {
    background-color: var(--button-bg-color);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
    transition: background-color 0.3s ease-in-out;
}

.custom-button:hover {
    background-color: var(--button-hover-bg-color);
}

#file-input {
    display: none;
}

/* Camera icon hidden by default */
.camera-icon {
    font-size: 24px;
}



#upload-progress::-webkit-progress-bar {
    background-color: #e0e0e0;
    border-radius: 10px;
}

#upload-progress::-webkit-progress-value {
    background-color: #4facfe;
    border-radius: 10px;
    transition: width 0.3s ease; /* Smooth transition */
}

#upload-progress::-moz-progress-bar {
    background-color: #4facfe;
    border-radius: 10px;
    transition: width 0.3s ease; /* Smooth transition */
}

.empty-box-container {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: .1;

}
#empty-box {
    width: 100%;
    height: 100%;
    margin-top: 1rem;
}

#empty-box > img {
    filter: invert();
}
#empty-box > img {
    border-radius: 25%;
}


/* Style for the "X" close button */
.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    background: none;
    border: none;
    color: #a7a7a7;  /* Customize color */
    cursor: pointer;
}

.close-btn:hover {
    color: #ff0000;  /* Customize hover color */
}




.media-model {
    display: none;
    position: fixed;
    z-index: 1000;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    align-items: center;
    justify-content: center;
    text-align: center;
    display: flex;
}

.media-model img, .media-model video {
    border-radius: 3.5rem;
    max-height: 80%;
    max-width: 100%;
    object-fit: contain;
    width: auto;
    height: auto;
}


.filename-input {
    border: none;
    background-color: transparent;
    color: var(--text-color); /* Use your existing text color variable */
    text-align: center;
    width: 100%;
    font-size: 14px;
    pointer-events: auto;
    overflow: hidden;
    resize: none; /* Prevent manual resizing */
    transition: all 0.3s ease;
}

.filename-input:focus {
    outline: 2px solid var(--border-color); /* Optional: Add a border or outline on focus */
    height: auto;
}


/* When the input is editable */
.filename-input.editing {
    height: 3rem; /* Expand to two rows */
    border-color: var(--button-hover-bg-color); /* Highlight border color */
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); /* Add a shadow to emphasize editing mode */
}

.filename-input[readonly] {
    background-color: var(--input-bg-color); /* Restore background for readonly */
    cursor: pointer;
}

/* Active/focused state */
textarea:focus {
    height: auto;
}


.file-ext {
    position: absolute;
    top: 5px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}


        /* Styles for the blurred content container */
        #content-container {
            transition: filter 0.3s ease;
        }

        /* Cloudflare-style countdown overlay */
        #countdown-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent white background */
            z-index: 9999;
        }

        #countdown-box {
            background-color: #f5f5f5;
            border: 2px solid #e5e5e5;
            border-radius: 10px;
            box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
            text-align: center;
            font-family: "Helvetica Neue", Arial, sans-serif;
            font-size: 24px;
            color: #333;
        }
        /* Blur effect */
        .blurred {
            filter: blur(5px);
        }

        #countdown {
            position: fixed;
            display: flex;
            flex-direction: row;
            justify-content: center;
            align-items: center;
            margin: auto;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: #161616;
            border: 1px solid #ccc;
            font-size: 24px;
            text-align: center;
            z-index: 9999; /* Ensure it appears on top */
            padding: 1rem;
            gap: 2rem;
        }

        /* Spinner styling */
        .spinner {
            border: 8px solid #f3f3f3; /* Light grey */
            border-top: 8px solid #3498db; /* Blue */
            border-radius: 50%;
            width: 50px;
            height: 50px;
            animation: spin 2s linear infinite; /* Rotate continuously */
        }

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


        /* Blur effect */
        .blurred {
            filter: blur(5px);
        }

        /* Disable all interactions */
        .disabled {
            pointer-events: none; /* Disable interaction for all elements */
        }



/* Media query for screens under 900px width */
@media (max-width: 900px) {
    #upload-form {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        display: flex;
        justify-content: center;
    }


    .custom-button {
        padding: 15px;
        font-size: 18px;
        background-color: #0275d8;
        width: 80%;
        max-width: 500px;
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 5rem;
        width: 5rem;
        border-radius: 50%;
    }

    .button-text {
        display: none;
    }

    .camera-icon {
        display: inline;
    }

    #countdown {
        flex-direction: column;
        font-size: 1rem;
    }

}


@media (max-width: 400px) {
    /* Style for each individual file container */
    .file-container {
        /* width: 100px; */
    }
}


/* Hide the file extension by default */
.file-ext {
    position: absolute;
    top: 5px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    display: none; /* Hidden by default */
}

/* Show the file extension when hovering over the file container */
.file-container:hover .file-ext {
    display: block; /* Show the file extension on hover */
}

/* Show the file extension when the file container is active */
.file-container.active .file-ext {
    display: block; /* Show the file extension when the container is selected */
}



/* Hide the file size tooltip by default */
.file-size-tooltip {
    position: absolute;
    top: 5px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    display: none; /* Hidden by default */
}

/* Show the file size tooltip when hovering over the file container */
.file-container:hover .file-size-tooltip {
    display: block; /* Show the file size on hover */
}

/* Show the file size tooltip when the file container is active */
.file-container.active .file-size-tooltip {
    display: block; /* Show the file size when the container is selected */
}




.no-files-found {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
}

#progress-wrapper {
    position: relative;
    width: 100%;
    display: none;
    border-radius: 0; /* No border radius on the wrapper */
}

#upload-progress {
    width: 100%;
    height: 1rem;
    border-radius: 0; /* Remove border radius for smooth edges */
    transition: width 0.5s ease; /* Smooth transition when progress changes */
    -webkit-appearance: none; /* For WebKit browsers like Chrome/Safari */
    appearance: none; /* Remove default styles in modern browsers */
}

/* For WebKit browsers like Chrome and Safari */
#upload-progress::-webkit-progress-bar {
    border-radius: 0;
    background-color: #f3f3f3; /* Customize the background if necessary */
}

#upload-progress::-webkit-progress-value {
    border-radius: 0; /* Ensure the progress fill has no rounded edges */
    background-color: var(--button-bg-color); /* Set the progress color */
    transition: width 0.5s ease; /* Smooth transition for value changes */
}

/* For Firefox */
#upload-progress::-moz-progress-bar {
    border-radius: 0; /* Remove border radius for Firefox */
    background-color: var(--button-bg-color); /* Set the progress color */
    transition: width 0.5s ease; /* Smooth transition */
}

#progress-percentage {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    font-weight: bold;
    color: white;
    text-shadow: 
        -1px -1px 0 black,  
         1px -1px 0 black,
        -1px  1px 0 black,
         1px  1px 0 black;
    pointer-events: none;
}



@media (max-width: 900px) {
    .custom-button {
        width: 4rem; /* Adjust button size for smaller screens */
        height: 4rem;
        bottom: 10px;
        right: 10px;
    }

    .camera-icon {
        font-size: 20px; /* Adjust icon size for smaller screens */
    }
    .custom-button {
        position: absolute; /* Fixed positioning to float on the page */
        bottom: 0; /* Adjust based on your desired placement */
        right: 1px; /* Adjust based on your desired placement */
        padding: 0;
        font-size: 1rem;
        background-color: var(--button-bg-color);
        width: 4rem;
        height: 4rem;
        border-radius: 50%; /* Circle button */
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 1000; /* Ensure it's above other content */
    }

#paste-box {
    width: calc(100% - 8rem);
    margin-left: 2rem;
    margin-right: 2rem;
    display: none;
}
}


#paste-box-container {
    width: 100%;
    display: flex;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
}

@media (min-width: 900px) {
#upload-button {
    width: 50%;
}

#paste-box {
    width: 50%;
}
}


.blur {
  filter: blur(5px);
  transition: filter 0.3s ease;
}
