.editor-toolbar {
    background-color: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    height: 50px; /* Fixed height */
    width: 100%; /* Full width */
    overflow-x: auto; /* Horizontal scroll if content overflows */
    display: flex; /* Ensure buttons are aligned properly */
    align-items: center; /* Center buttons vertically */
}

.editor-toolbar button {
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    color: #4a5568;
    font-size: 16px; /* Increased font size */
}

.editor-toolbar button:hover {
    color: #1d4ed8; /* More prominent hover color */
}

#messageInput {
    overflow-y: auto; /* Add vertical scroll for overflow */
    word-wrap: break-word; /* Ensure long words break properly */
    word-break: break-word; /* Ensure long words break properly */
    white-space: pre-wrap; /* Preserve whitespace and wrap text */
    overflow-wrap: break-word; /* Break long words to prevent overflow */
    background-color: #f9fafb; /* Subtle background color */
    border: 1px solid #d1d5db;
    border-radius: 8px; /* Rounded corners */
    padding: 12px;
    font-size: 16px; /* Improved readability */
    line-height: 1.5;
}

.editor-toolbar button.active {
    color: #1d4ed8;
    border: 2px solid #1d4ed8;
    border-radius: 6px;
}

/* Add these new styles for toaster animation */
#toaster {
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

#toaster.show {
    transform: translateX(0);
}

#toaster.hide {
    transform: translateX(120%);
}

/* Adjusted styles for side-by-side view */
.content-container {
    display: flex;
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: calc(100vh - 160px); /* Ensure it takes up the full viewport minus header/footer */
    padding-bottom: 40px; /* Increased bottom padding for spacing */
    align-items: stretch; /* Ensure child elements stretch properly */
}

.text-sharing, .file-sharing {
    flex: 0 0 100%;
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    height: 100%; /* Ensure sections fill the container */
    will-change: transform;
    box-sizing: border-box; /* Include padding and border in height calculation */
}

.text-sharing {
    transform: translateX(0); /* Visible by default */
    height: 650px; /* Further increased height */
}

.file-sharing {
    transform: translateX(100%); /* Hidden by default */
    position: absolute;
    top: 0;
    right: 0;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    overflow-y: auto; /* Add vertical scrollbar for overflow */
    height: 650px; /* Further increased height */
}

/* Delete button hover effect */
#fileDisplayArea button:hover {
    background-color: #dc2626 !important;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

.content-container.active .text-sharing,
.content-container.active .file-sharing {
    height: 100%;
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.content-container.active .text-sharing {
    flex: 0 0 59%; /* Shrink text-sharing area slightly */
    transform: translateX(0); /* Stay visible */
    margin-right: 1%; /* Add margin between text-sharing and file-sharing */
    height: auto; /* Adjust height dynamically */
}

.content-container.active .file-sharing {
    flex: 0 0 40%; /* Adjust file-sharing area width */
    transform: translateX(0);
    position: relative; /* Align side-by-side */
    height: auto; /* Adjust height dynamically */
}

.toggle-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #2563eb; /* Updated color for better contrast */
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 10;
}

.toggle-button:hover {
    background-color: #1e40af;
}

body {
    background-image: url('/static/assets/img/backgrounds/4.jpg'); /* Path to your background image */
    background-size: cover; /* Ensure the image covers the entire background */
    background-position: center; /* Center the image */
    background-attachment: fixed; /* Make the background fixed during scrolling */
}

/* Enhanced styles for better visual hierarchy and readability */
.editor-toolbar button {
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    color: #4a5568;
    font-size: 16px; /* Increased font size */
}

.editor-toolbar button:hover {
    color: #1d4ed8; /* More prominent hover color */
}

.editor-toolbar button.active {
    color: #1d4ed8;
    border: 2px solid #1d4ed8;
    border-radius: 6px;
}

#messageInput {
    background-color: #f9fafb; /* Subtle background color */
    border: 1px solid #d1d5db;
    border-radius: 8px; /* Rounded corners */
    padding: 12px;
    font-size: 16px; /* Improved readability */
    line-height: 1.5;
}

.toggle-button {
    background-color: #2563eb; /* Updated color for better contrast */
    font-size: 14px;
    padding: 12px 18px;
    border-radius: 8px;
}

.toggle-button:hover {
    background-color: #1e40af;
}

#dropZone {
    border-color: #60a5fa; /* Updated border color */
    background-color: #eff6ff; /* Subtle background for better visibility */
}

#dropZone:hover {
    border-color: #2563eb; /* Highlight on hover */
    background-color: #dbeafe;
}

.mode-toggle button {
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 6px;
}

.mode-toggle button:hover {
    background-color: #e0f2fe;
}

.mode-toggle button.active {
    background-color: #2563eb;
    color: white;
}

.file-sharing h2 {
    font-size: 24px; /* Larger heading for better emphasis */
    color: #1e3a8a;
}

.file-sharing button {
    font-size: 16px;
    padding: 12px 20px;
    border-radius: 8px;
}

.file-sharing button:hover {
    background-color: #1e40af;
}

#fileDisplayArea {
    min-height: 240px; /* Ensure a fixed minimum height */
    display: grid; /* Use grid layout for better alignment */
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Adjust column size */
    gap: 16px; /* Add spacing between items */
    padding: 16px; /* Ensure consistent padding */
    background-color: #ffffff; /* Clean white background */
    border: 1px solid #e5e7eb; /* Subtle border */
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Slight shadow for depth */
    max-height: 240px; /* Increase height for better visibility */
    overflow-y: auto; /* Enable scrolling */
    align-items: center; /* Center content vertically */
    justify-content: center; /* Center content horizontally */
}

#fileDisplayArea .flex {
    width: 100%; /* Ensure icons fit within the grid */
    max-width: 100px; /* Reduce maximum width */
    aspect-ratio: 1 / 1; /* Make icons square */
    background-color: #f9fafb; /* Subtle background for icons */
    border: 1px solid #d1d5db; /* Border for better separation */
    border-radius: 8px; /* Rounded corners */
    display: flex; /* Flexbox for centering content */
    flex-direction: column; /* Stack content vertically */
    align-items: center; /* Center horizontally */
    justify-content: flex-start; /* Align content to the top */
    padding: 8px 8px 32px; /* Add extra bottom padding for the file name */
    transition: transform 0.2s ease, box-shadow 0.2s ease; /* Smooth hover effects */
    position: relative; /* Ensure child elements like buttons are positioned relative to the container */
    overflow: hidden; /* Prevent content overflow */
}

#fileDisplayArea .flex:hover {
    transform: scale(1.05); /* Slightly enlarge on hover */
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15); /* Add shadow on hover */
}

#fileDisplayArea .flex:hover > a {
    filter: blur(4px); /* Blur the icon on hover */
    transition: filter 0.2s ease-in-out;
}

#fileDisplayArea .flex .action-buttons {
    position: absolute;
    bottom: 8px; /* Position buttons at the bottom of the icon */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row; /* Align buttons side-by-side */
    gap: 12px; /* Add spacing between buttons */
    opacity: 0; /* Hidden by default */
    transition: opacity 0.2s ease-in-out;
}

#fileDisplayArea .flex:hover .action-buttons {
    opacity: 1; /* Show buttons on hover */
}

#fileDisplayArea .flex .action-buttons button,
#fileDisplayArea .flex .action-buttons a {
    background-color: #ffffff; /* Semi-transparent background */
    color: #ffffff;
    border: none;
    border-radius: 50%; /* Circular buttons */
    width: 24px; /* Reduced button size */
    height: 24px; /* Reduced button size */
    display: flex;
    align-items: left;
    justify-content: center;
    font-size: 12px; /* Adjusted icon size */
    cursor: pointer;
    transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

#fileDisplayArea .flex .action-buttons button:hover,
#fileDisplayArea .flex .action-buttons a:hover {
    background-color: rgba(0, 0, 0, 0.9); /* Darker background on hover */
    transform: scale(1.05); /* Slightly enlarge on hover */
}

#fileDisplayArea .flex i {
    font-size: 28px; /* Smaller icon size */
    color: #4a5568; /* Neutral color for icons */
}

#fileDisplayArea .flex span {
    margin-top: auto; /* Push the file name to the bottom */
    font-size: 12px; /* Smaller font size */
    color: #374151; /* Darker text color */
    text-align: center; /* Center-align text */
    word-wrap: break-word; /* Ensure long names wrap */
    max-width: 90%; /* Prevent overflow */
    white-space: normal; /* Allow text to wrap */
    line-height: 1.2; /* Adjust line height for better readability */
    position: relative; /* Ensure proper positioning */
    bottom: 0; /* Align at the bottom of the icon */
}

#fileDisplayArea .flex .group-hover {
    background-color: rgba(0, 0, 0, 0.05); /* Subtle hover effect */
    border-radius: 8px; /* Match container's rounded corners */
}

#fileDisplayArea .flex button {
    position: relative;
    top: 4px; /* Adjusted placement for better alignment */
    right: 4px; /* Adjusted placement for better alignment */
    background-color: #dc2626;
    color: white;
    border: none;
    border-radius: 50%; /* Circular button */
    width: 10px;
    height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6px;
    cursor: pointer;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    z-index: 5; /* Ensure it stays above other elements */
}

#fileDisplayArea .flex:hover button {
    opacity: 1; /* Show on hover */
    transform: scale(1.1); /* Slightly enlarge on hover */
}

#fileDisplayArea .flex button:hover {
    background-color: #b91c1c; /* Darker red on hover */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Add subtle shadow */
}

/* Deletion Modal Styles */
#deleteModal {
    transition: opacity 0.3s ease;
}

#deleteModal.hidden {
    opacity: 0;
    pointer-events: none;
}

#deleteModal .modal-content {
    opacity: 0;
    transform: scale(0.95);
}

#deleteModal:not(.hidden) .modal-content {
    opacity: 1;
    transform: scale(1);
}

#confirmDelete {
    transition: all 0.2s ease;
}

#deleteSpinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Adjusted styles for the "Share Files" button in the top-right of the editor panel */
.share-files-button {
    position: absolute; /* Position relative to the text-sharing container */
    top: 14px; /* Align with the toolbar */
    right: 12px; /* Slightly inward for better alignment */
    background-color: #2563eb;
    color: white;
    padding: 28px;
    border-radius: 50%; /* Rounded button for FAB style */
    cursor: pointer;
    z-index: 10;
    font-size: 16px;
    transition: all 0.3s ease-in-out;
    border: 12px solid #CBF9F0;
}

.share-files-button:hover {
    background-color: #1e40af;
    transform: scale(1.1); /* Slightly enlarge on hover */
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

/* Tooltip for the button */
.share-files-button::after {
    content: "Upload File"; /* Tooltip text */
    position: absolute;
    top: 50%;
    right: 110%; /* Position tooltip to the left of the button */
    transform: translateY(-50%);
    background-color: #000;
    color: #fff;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.share-files-button:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .share-files-button {
        top: 5px; /* Adjust position for smaller screens */
        right: 10px; /* Ensure it doesn't overlap toolbar elements */
    }
}

/* Icon inside the button */
.share-files-button i {
    font-size: 18px; /* Adjust icon size */
}

/* Simplified styles for the close icon */
.file-sharing .close-icon {
    position: absolute;
    top: 1px;
    right: 14px;
    color: #dc2626;
    font-size: 45px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
}

.file-sharing .close-icon:hover {
    color: #b91c1c;
    transform: scale(1.2); /* Slightly increase size on hover */
}

/* File Icon Container */
.file-icon {
    background: linear-gradient(135deg, #ADE8F4, #CAF0F8); /* Gradient background for a modern look */
    width: 120px;
    height: 120px;
    border-radius: 16px; /* Increased border radius for a softer look */
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px;
    user-select: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth hover effects */
    align-items: center; /* Center-align content */
    justify-content: flex-end; /* Align content to the bottom */
    gap: 8px; /* Add spacing between icon and label */
    overflow: hidden; /* Prevent content overflow */
}

.file-icon:hover {
    transform: scale(1.1); /* Slight enlargement on hover */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); /* Enhanced shadow on hover */
}

.file-icon::before {
    content: ""; /* Remove the default icon content */
}

.file-icon i {
    font-size: 48px; /* Adjust icon size */
    color: #4a5568; /* Neutral color for icons */
    transition: transform 0.2s ease, color 0.2s ease; /* Smooth hover effects */
}

.file-icon[data-file-type="pdf"] i {
    color: #e53e3e; /* Red for PDFs */
}

.file-icon[data-file-type="doc"], .file-icon[data-file-type="docx"] i {
    color: #3182ce; /* Blue for Word documents */
}

.file-icon[data-file-type="xls"], .file-icon[data-file-type="xlsx"] i {
    color: #38a169; /* Green for Excel files */
}

.file-icon[data-file-type="image"] i {
    color: #dd6b20; /* Orange for images */
}

.file-icon[data-file-type="text"] i {
    color: #718096; /* Gray for text files */
}

.file-icon:hover i {
    transform: scale(1.1); /* Slightly enlarge on hover */
    color: #2563eb; /* Highlight color on hover */
}

.file-label {
    font-size: 10px; /* Smaller font size */
    color: #374151; /* Darker text color */
    text-align: center; /* Center-align text */
    word-wrap: break-word; /* Ensure long names wrap */
    max-width: 90%; /* Prevent overflow */
    white-space: normal; /* Allow text to wrap */
    line-height: 1.2; /* Adjust line height for better readability */
    position: relative; /* Ensure proper positioning */
    bottom: 0; /* Align at the bottom of the icon */
    transition: opacity 0.3s ease-in-out; /* Smooth fade effect */
}

.file-label {
    font-weight: 600;
    font-size: 10px; /* Slightly larger font for better readability */
    color: #1f2937; /* Darker text color for contrast */
    text-align: center;
    margin-top: auto; /* Push the label to the bottom */
    flex-grow: 0; /* Prevent it from stretching */
    align-self: center;
    user-select: text;
    overflow: hidden; /* Hide overflowing text */
    text-overflow: ellipsis; /* Add ellipsis for overflowing text */
    max-width: 90%; /* Ensure it fits within the container */
    white-space: nowrap; /* Prevent wrapping */
    line-height: 1.4; /* Improved line height */
    position: relative; /* Ensure proper positioning */
    bottom: 4px; /* Add spacing from the bottom */
}

/* Buttons Container */
.file-buttons {
    display: flex;
    justify-content: center;
    gap: 6px;
    position: absolute;
    bottom: 8px; /* Position buttons at the bottom of the icon */
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease-in-out; /* Smooth fade-in effect */
}

/* General Button Styling */
.file-buttons button {
    flex: 1;
    background: #e2e8f0;
    border: none;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    outline-offset: 2px;
    color: #334155;
    height: 36px;
}

.file-buttons button:focus-visible {
    outline: 3px solid #2563eb;
}

/* Hover Styles */
.file-buttons button#downloadBtn:hover {
    background-color: #2563eb; /* Blue color */
    color: white;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.6); /* Blue shadow */
}

.file-buttons button#downloadBtn:hover {
    background-color: #2563eb !important; /* Force blue color */
    color: white !important; /* Ensure text is white */
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.6) !important; /* Blue shadow */
}

.file-buttons button#deleteBtn:hover {
    background-color: #dc2626;
    color: white;
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.6);
}

.file-buttons button#copyLinkBtn:hover {
    background-color: #10b981 !important; /* Force blue color */
    color: white;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.6); /* Green shadow */
}

/* Icon Styles */
.file-buttons svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: block;
}

/* Responsive Adjustments */
@media (max-width: 400px) {
    .file-icon {
        width: 100px;
        height: 130px;
        padding: 10px;
    }
    .file-buttons button {
        height: 32px;
    }
    .file-buttons svg {
        width: 18px;
        height: 18px;
    }
    .file-label {
        font-size: 10px;
    }
}

/* Dynamic Colors for File Types */
.file-icon[data-file-type="pdf"] {
    background-color: #fef2f2; /* Light red for PDFs */
    border: 1px solid #f87171; /* Red border */
}
.file-icon[data-file-type="doc"], .file-icon[data-file-type="docx"] {
    background-color: #eff6ff; /* Light blue for Word documents */
    border: 1px solid #60a5fa; /* Blue border */
}
.file-icon[data-file-type="xls"], .file-icon[data-file-type="xlsx"] {
    background-color: #ecfdf5; /* Light green for Excel files */
    border: 1px solid #34d399; /* Green border */
}
.file-icon[data-file-type="image"] {
    background-color: #fefce8; /* Light yellow for images */
    border: 1px solid #facc15; /* Yellow border */
}
.file-icon[data-file-type="text"] {
    background-color: #f3f4f6; /* Light gray for text files */
    border: 1px solid #9ca3af; /* Gray border */
}

/* Hover Effects */
.file-icon:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); /* Subtle shadow */
    transform: scale(1.05); /* Slight enlargement */
    transition: all 0.3s ease-in-out;
}

/* Improved Responsiveness */
@media (max-width: 768px) {
    .file-icon {
        width: 90px;
        height: 90px;
        padding: 8px;
    }
    .file-label {
        font-size: 10px;
    }
}

/* Animation on Interaction */
.file-icon:active {
    transform: scale(0.95); /* Slight shrink on click */
    transition: transform 0.1s ease-in-out;
}

/* Accessibility Enhancements */
.file-icon[aria-label] {
    outline: none;
}
.file-icon:focus-visible {
    outline: 2px solid #2563eb; /* Blue focus outline */
    outline-offset: 4px;
}

/* File Icon Styles Based on File Type */
.file-icon[data-file-type="pdf"]::before {
    content: "\f1c1"; /* Font Awesome PDF icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 48px;
    color: #e53e3e; /* Red for PDFs */
}
.file-icon[data-file-type="doc"], .file-icon[data-file-type="docx"]::before {
    content: "\f1c2"; /* Font Awesome Word icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 48px;
    color: #3182ce; /* Blue for Word documents */
}
.file-icon[data-file-type="xls"], .file-icon[data-file-type="xlsx"]::before {
    content: "\f1c3"; /* Font Awesome Excel icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 48px;
    color: #38a169; /* Green for Excel files */
}
.file-icon[data-file-type="image"]::before {
    content: "\f1c5"; /* Font Awesome Image icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 48px;
    color: #dd6b20; /* Orange for images */
}
.file-icon[data-file-type="text"]::before {
    content: "\f15c"; /* Font Awesome Text icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 48px;
    color: #718096; /* Gray for text files */
}

/* Center the icon inside the file container */
.file-icon::before {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Hide buttons by default */
.file-buttons {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

/* Blur the icon and show buttons on hover */
.file-icon:hover::before {
    filter: blur(50%);
    transition: filter 0.2s ease-in-out;
}
.file-icon:hover .file-buttons {
    opacity: 1; /* Show buttons */
}

.file-icon:hover .file-label {
    opacity: 0; /* Fade out the file name on hover */
}

.file-icon:hover .file-buttons {
    opacity: 1; /* Show buttons on hover */
}

/* Adjust button styles */
.file-buttons button {
    width: 32px; /* Slightly larger button size */
    height: 32px;
    border-radius: 20%; 
    background-color: #ffffff;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px; /* Adjusted icon size */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.file-buttons button:hover {
    transform: scale(1.15); /* Slight enlargement on hover */
    background-color: #2563eb; /* Blue for hover */
    color: white;
}
.file-buttons button#deleteBtn:hover {
    background-color: #e53e3e; /* Red for delete */
}

.file-icon .file-type-icon {
    position: relative;
    align-items: center;
    bottom: 5px;
    font-size: 64px; /* Small icon size */
    color: #4a5568; /* Neutral color for the icon */
    opacity: 0.8; /* Slightly transparent */
    pointer-events: none; /* Prevent interaction */
    cursor: pointer; /* Show pointer for hover effect */
}