/* Import Proxima Nova from Adobe Typekit */
@import url("https://use.typekit.net/emv3zbo.css");

/* SVG Icon General Styles */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    fill: currentColor;
}

/* General Body Styles */
body {
    font-family: "proxima-nova", sans-serif; /* Primary font */
    margin: 0;
    background-color: #ffffff; /* Main site uses white background */
    color: #333333; /* Default text color */
    line-height: 1.6;
    transition: background-color 0.3s ease; /* For smooth dimming */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.loading-active {
    overflow: hidden; /* Prevent scrolling when modal is up */
}

/* Dimming overlay for when loading message is active */
body.loading-active::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65); /* Slightly darker overlay */
    z-index: 9998; /* High, but below messages */
}


body.lightbox-open {
    overflow: hidden;
}

/* Header Styles */
header {
    background-color: #33367B; /* Primary corporate color */
    color: white;
    padding: 1em 2em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-left {
    display: flex;
    align-items: center;
}

#companyLogo {
    max-height: 45px;
    margin-right: 20px;
}

header h1 {
    margin: 0;
    font-family: "proxima-nova", sans-serif;
    font-size: 1.6em;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Auth Controls & New User Info in Header */
#authControls {
    display: flex; 
    align-items: center;
}

#userSessionInfo { 
    display: flex;
    align-items: center;
    gap: 15px; 
}

.user-details-header {
    display: flex;
    flex-direction: column;
    align-items: flex-end; 
    text-align: right;
    font-size: 0.9em;
    line-height: 1.3;
}

.header-user-name {
    font-weight: 600;
    color: #ffffff;
}

.header-access-level {
    font-size: 0.8em;
    color: #e0e0e0;
    font-style: italic;
}

.header-link {
    color: var(--color-light-text, #ffffff); /* Fallback to white */
    text-decoration: none;
    margin-left: 1em;
    font-size: 0.9em;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.header-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    text-decoration: underline;
}

#authControls .button-primary { 
    background-color: rgba(254, 193, 13, 0.95);
    color: #33367B;
    border: 1px solid #fec10d;
    padding: 0.6em 1.2em; 
    margin-left: 0; 
}
#authControls .button-primary:hover {
    background-color: #fec10d;
    border-color: #fec10d;
    color: #33367B;
}

/* Main Content Area */
main {
    padding: 2em; 
    max-width: 1300px; 
    margin: auto;
    flex-grow: 1;
    width: 100%; /* Ensure main takes full width */
    box-sizing: border-box; /* Include padding in width calculation */
}

/* Section Titles */
h2 {
    font-family: "proxima-nova", sans-serif;
    color: #33367B; 
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0.6em;
    margin-bottom: 1.25em;
    font-size: 1.8em; 
    font-weight: 700;
}

/* Two-Pane Layout Styles */
.app-layout {
    display: flex;
    gap: 2.5em;
    margin-top: 1.5em;
}

.folder-tree-pane {
    flex: 0 0 280px; 
    background-color: #f8f9fa; 
    padding: 1.5em;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
    max-height: 75vh; 
    overflow-y: auto;
}

.folder-tree-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em; 
}

.folder-tree-pane h3 {
    font-family: "proxima-nova", sans-serif;
    color: #33367B;
    font-size: 1.3em;
    margin-top: 0;
    margin-bottom: 0; 
    border-bottom: none; 
    padding-bottom: 0;
}

.button-icon { 
    padding: 0.3em 0.6em; 
    font-size: 1.2em;    
    line-height: 1;      
    min-width: auto;     
}

#createRootFolderButton {
    /* Uses .button-secondary and .button-icon */
}


.folder-tree ul {
    list-style: none;
    padding-left: 0; 
}
.folder-tree ul ul { 
    padding-left: 1.5em; 
}

.folder-tree li {
    margin-bottom: 0.5em;
}

.folder-tree-item {
    display: flex;
    align-items: center;
    padding: 0.7em 0.9em; /* Increased padding */
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.95em;
    color: #374151;
    width: 100%; 
    box-sizing: border-box;
    position: relative;
    padding-left: 2em; /* Increased indent */
    margin-bottom: 2px;
}
.folder-tree-item:hover {
    background-color: #e9eaf5;
    color: #33367B;
}
.folder-tree-item.active {
    background-color: #fec10d;
    color: #33367B; /* Updated for contrast */
    font-weight: 600;
}
.folder-icon {
    margin-right: 0.75em;
    font-size: 1.1em;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
}
.folder-tree-item.active .folder-icon {
    color: #33367B; /* Updated for contrast */
}

/* New styles for toggle buttons and collapsible tree */
.folder-tree .has-children > .folder-tree-item .toggle-btn {
    position: absolute;
    left: 0.25em;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5em;
    height: 1.5em;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, background-color 0.2s ease;
    text-align: center;
    line-height: 1em;
    font-size: 1.2em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.folder-tree .has-children > .folder-tree-item .toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.folder-tree .has-children.expanded > .folder-tree-item .toggle-btn {
    transform: translateY(-50%) rotate(90deg);
}

.folder-tree .has-children > ul {
    display: none;
}

.folder-tree .has-children.expanded > ul {
    display: block;
}

/* This more specific selector is needed to override the default color */
.folder-tree .has-children > .folder-tree-item.active .toggle-btn {
    color: #33367B !important;
}

.content-display-pane {
    flex-grow: 1; 
    background-color: #ffffff;
    padding: 1.5em;
    border-radius: 3px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5em;
}

#multiSelectToolbar {
    display: flex;
    align-items: center;
    gap: 0.75em;
    background-color: #f8f9fa;
    padding: 0.5em 1em;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease-in-out;
}

#multiSelectToolbar label {
    font-size: 0.9em;
    cursor: pointer;
}

.selection-count {
    font-size: 0.9em;
    color: #555;
    font-style: italic;
}

.button-danger {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

.button-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.button-danger:disabled,
.button-secondary:disabled {
    background-color: #e9ecef;
    color: #adb5bd;
    border-color: #dee2e6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-icon {
    transition: all 0.2s ease-in-out;
}

.button-icon:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

#folderViewContainer { 
    margin-bottom: 2em; 
}

.search-container {
    margin-bottom: 1.5em; 
}

#folderSearchInput {
    width: 100%;
    padding: 0.9em 1.2em 0.9em 2.8em; /* Added left padding for icon */
    font-size: 1em;
    border: 1px solid #d0d3e8;
    border-radius: 4px;
    box-sizing: border-box;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236c757d'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 1.2em;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#folderSearchInput:focus {
    border-color: #33367B;
    box-shadow: 0 0 0 3px rgba(51, 54, 123, 0.15);
    outline: none;
}

#breadcrumbNav {
    margin-bottom: 1.5em;
    padding-bottom: 0.75em; 
    border-bottom: 1px solid #e0e0e0;
}
.breadcrumb-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap; 
    align-items: center;
    gap: 4px; /* Added gap */
}
.breadcrumb-list li {
    font-size: 0.9em;
    color: #555;
    display: flex;
    align-items: center;
}
.breadcrumb-list li a {
    color: #33367B;
    text-decoration: none;
    padding: 0.3em 0.8em;
    border-radius: 100px; /* Pill shape */
    background-color: #f0f2f5;
    transition: all 0.2s ease;
    font-weight: 600;
}
.breadcrumb-list li a:hover {
    background-color: #e2e5f0;
    color: #1a1c40;
    text-decoration: none;
}
.breadcrumb-list li + li::before { 
    content: "›";
    font-size: 1.2em;
    padding: 0 0.5em;
    color: #999;
    line-height: 1;
}
.breadcrumb-list li.active {
    font-weight: 600;
    color: #333;
}

#currentFolderName { 
    margin-top: 0;
    margin-bottom: 1em; 
}

#folderItemsDisplay { 
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5em; 
}

.item-thumbnail { 
    border: 1px solid #eaeaea;
    border-radius: 6px; /* Softer radius */
    padding: 1em;
    background-color: #ffffff;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative; 
    min-height: 180px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Subtler initial shadow */
}
.item-thumbnail:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.08); /* More elegant lift */
    transform: translateY(-3px);
    border-color: #fec10d;
}

.item-thumbnail .thumbnail-icon-area { 
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8em;
    border-radius: 2px;
    background-color: #f0f0f0;
    overflow: hidden; 
}

.item-thumbnail img { 
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.item-thumbnail .file-icon {
    font-size: 4em;
    color: #6c757d;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.item-thumbnail.folder-type .file-icon {
    color: #fec10d;
    font-size: 5em;
}

.item-thumbnail.file-type-pdf .file-icon { color: #D93025; }
.item-thumbnail.file-type-doc .file-icon { color: #2A5699; }
.item-thumbnail.file-type-xls .file-icon { color: #1D6F42; }
.item-thumbnail.file-type-ppt .file-icon { color: #D04423; }
.item-thumbnail.file-type-eps .file-icon { color: #7E57C2; }
.item-thumbnail.file-type-image .file-icon { color: #6c757d; } /* Default for images if thumb fails */


.item-thumbnail .item-name {
    font-weight: 500;
    color: #333333;
    font-size: 0.95em; 
    word-wrap: break-word;
    line-height: 1.3;
    margin-top: auto;
    max-height: 3.9em; 
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-thumbnail.folder-type .item-name { 
    font-weight: 700;
    color: #33367B;
    font-size: 1.05em; 
}

/* Item Actions Container (for rename, move, delete etc. buttons on THUMBNAILS in content pane) */
.item-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    flex-direction: column; 
    gap: 5px;
    background-color: rgba(255, 255, 255, 0.85); 
    padding: 4px;
    border-radius: 3px;
    opacity: 0; 
    transition: opacity 0.2s ease-in-out;
    z-index: 10; 
}

.item-thumbnail:hover .item-actions {
    opacity: 1;
}

.item-action-button {
    background: none;
    border: 1px solid transparent; 
    cursor: pointer;
    font-size: 1em; 
    padding: 3px 5px; 
    color: #33367B;
    border-radius: 2px;
    display: flex; 
    align-items: center;
    justify-content: center;
    min-width: 24px; 
    min-height: 24px;
}
.item-action-button:hover {
    background-color: #e0e0e0; 
    color: #fec10d;
    border-color: #ccc; 
}
/* Icons are now SVGs, so no ::before content needed */


/* Button Styles - General */
.button-primary, .button-secondary {
    padding: 0.75em 1.5em;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95em;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.button-primary {
    background-color: #fec10d;
    color: #33367B; /* Improved contrast for accessibility */
    border-color: #fec10d;
}
.button-primary:hover {
    background-color: #e4a80b;
    border-color: #e4a80b;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.12);
}

.button-secondary {
    background-color: #f0f2f5;
    color: #33367B;
    border: 1px solid #d0d3e8;
}
.button-secondary:hover {
    background-color: #e2e5f0;
    border-color: #b9bfd9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}
.button-secondary:disabled {
    background-color: #e9ecef;
    color: #adb5bd;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.7;
}

#galleryContainer { /* Vestigial */ }
#galleryContainer h2 { /* Vestigial */ }

.scroll-loading-indicator {
    text-align: center;
    padding: 1em;
    font-style: italic;
    color: #666;
}

.lightbox-modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    padding-top: 20px; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(30, 30, 50, 0.95); 
}

.lightbox-actions {
    text-align: center;
    padding: 5px 0 15px 0; 
    position: relative; 
    z-index: 1001; 
}

.lightbox-button {
    margin: 0 8px; 
    padding: 0.5em 1em; 
    font-size: 0.85em; 
    background-color: rgba(255, 255, 255, 0.15); 
    color: #f0f0f0;
    border-color: rgba(255, 255, 255, 0.4);
    line-height: 1.2; 
}

.lightbox-button:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}
.lightbox-button:disabled {
    background-color: rgba(100, 100, 100, 0.2);
    color: #888;
    border-color: rgba(120, 120, 120, 0.3);
    cursor: not-allowed;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 85%;
    max-height: 70vh; 
    animation-name: lightboxZoom;
    animation-duration: 0.3s;
}

@keyframes lightboxZoom {
    from {transform:scale(0.9); opacity: 0.7;}
    to {transform:scale(1); opacity: 1;}
}

.lightbox-close {
    position: absolute;
    top: 15px; 
    right: 30px;
    color: #f1f1f1;
    font-size: 35px; 
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    line-height: 1;
    z-index: 1002; 
}
.lightbox-close:hover, .lightbox-close:focus { color: #fec10d; }

#lightboxCaption {
    margin: 10px auto 0; 
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #dddddd;
    padding: 5px 0; 
    height: auto; 
    font-size: 1em; 
}

.lightbox-prev, .lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%; 
    transform: translateY(-50%); 
    width: auto;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.4s ease;
    border-radius: 0 3px 3px 0;
    -webkit-user-select: none;
    user-select: none;
    background-color: rgba(51, 54, 123, 0.3); 
    z-index: 1001; 
}
.lightbox-next { right: 10px; border-radius: 3px 0 0 3px; } 
.lightbox-prev { left: 10px; }
.lightbox-prev:hover, .lightbox-next:hover { background-color: #fec10d; }


/* Message Styles */
#loadingMessage {
    display: none; /* Hidden by default */
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 2em 3em;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    z-index: 10000;
    text-align: center;
    min-width: 250px;
    max-width: 90%;
    background-color: #fff;
    border: none;
    color: #33367B;
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1em;
}

/* Spinner for loading state */
#loadingMessage::before {
    content: "";
    display: block;
    width: 30px;
    height: 30px;
    border: 3px solid #e0e0e0;
    border-top-color: #fec10d; /* Brand yellow */
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

#errorMessage {
    display: none; /* Keep hidden by default */
    position: relative; /* Sits inside the content area */
    width: 100%;
    padding: 1em;
    padding-right: 50px; /* Make space for the close button */
    margin-bottom: 1.5em;
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
    border-radius: 5px;
    box-sizing: border-box;
    text-align: left;
}

.no-results-message {
    display: none; /* Initially hidden */
    grid-column: 1 / -1; /* Span all columns in the grid */
    text-align: center;
    padding: 4em 1em;
    margin-top: 1em;
    background-color: #f9f9fb;
    border-radius: 6px;
    border: 1px dashed #d0d3e8;
    color: #6c757d;
    font-size: 1.1em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1em;
}

.no-results-message::before {
    content: "";
    display: block;
    width: 48px;
    height: 48px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%239ca3af'%3E%3Cpath d='M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.5;
}


/* Upload Section Styles */
/* Upload Section Toggle */
#uploadToggleContainer {
    /* Styles for the container of the toggle button, if needed */
    /* For example, to add some margin or align the button */
    /* display: none; /* Controlled by JS based on user role */
}

#toggleUploadSectionButton {
    /* Uses .button-secondary by default, add specific overrides if needed */
    /* Example: make it wider */
    /* width: 100%; */
    /* text-align: left; */
    /* padding-left: 1em; */
    margin-bottom: 1em; /* Space before the actual upload section if visible */
}

#toggleUploadSectionButton .arrow {
    display: inline-block;
    margin-left: 8px;
    transition: transform 0.3s ease;
}

#toggleUploadSectionButton.expanded .arrow {
    transform: rotate(90deg);
}


/* Styling for the Upload Section as a panel */
#uploadSection {
    background-color: #f8f9fa; /* Light background like the folder tree */
    padding: 1.5em;
    border-radius: 3px; 
    border: 1px solid #e0e0e0;
    margin-bottom: 2em;
    /* display: none; /* Controlled by JS */
}

#uploadSection h2 {
    margin-top: 0;
    font-size: 1.5em; /* Slightly smaller H2 for the panel */
    border-bottom: 1px solid #d0d3e8;
    padding-bottom: 0.5em;
}
/*
#uploadSection {
    background-color: #ffffff;
    padding: 1.5em;
    border-radius: 3px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
    margin-bottom: 2em;
}

#uploadSection h2 { margin-top: 0; }
*/
.upload-form label {
    display: block;
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 500;
    color: #374151;
}
.upload-form input[type="text"],
.upload-form input[type="file"],
.upload-form select {
    width: 100%;
    padding: 0.9em 1.2em; 
    font-size: 1em;
    border: 1px solid #cccccc; 
    border-radius: 3px; 
    box-sizing: border-box;
    margin-bottom: 1em;
}
.upload-form input[type="file"] {
    padding: 0.7em; 
}
.upload-form input[type="text"]:focus,
.upload-form select:focus {
    border-color: #33367B;
    box-shadow: 0 0 0 3px rgba(51, 54, 123, 0.15);
    outline: none;
}
#uploadButton { margin-top: 1.5em; }
#uploadStatus {
    margin-top: 1.5em; 
    font-size: 0.95em;
}
#uploadStatus .file-progress {
    margin-bottom: 0.5em;
    padding: 0.75em 1em; 
    border-radius: 3px;
    background-color: #e9ecef; 
    color: #495057;
}
#uploadStatus .file-success {
    background-color: #d1e7dd; 
    color: #0f5132;
    border: 1px solid #badbcc;
    padding: 0.75em 1em;
    margin-bottom: 0.5em;
    border-radius: 3px;
}

.upload-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
}

.overall-progress {
    margin: 0;
    font-weight: 500;
}

.details-toggle {
    font-size: 0.9em;
    color: #33367B;
    cursor: pointer;
    text-decoration: underline;
}

.upload-details-container {
    max-height: 30vh;
    overflow-y: auto;
    border-top: 1px solid #e0e0e0;
    padding-top: 1em;
}

.hidden {
    display: none;
}
#uploadStatus .file-error {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
    padding: 0.75em 1em;
    margin-bottom: 0.5em;
    border-radius: 3px;
}

/* Drag and Drop Zone Styles */
.drop-zone {
    border: 2px dashed #33367B;
    border-radius: 6px;
    padding: 2em;
    text-align: center;
    color: #555;
    background-color: #f9f9fb;
    margin-top: 1em;
    margin-bottom: 1.5em;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.drop-zone.dragover {
    background-color: #e9eaf5;
    border-color: #fec10d;
    transform: scale(1.02);
}
.drop-zone p {
    margin: 0;
    font-size: 1.1em;
}

/* Drag and Drop Styling for Move Operations */
.draggable {
    /* cursor: grab; */ /* Optional visual cue */
}
.draggable:active {
    /* cursor: grabbing; */ /* Optional visual cue */
}

.drop-target-folder-tree.dragover,
.drop-target-thumbnail.dragover {
    background-color: #d0e0ff !important; 
    border-style: dashed !important;
    border-color: #33367B !important;
}
/* Custom Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Dimming overlay */
    z-index: 10000; /* High z-index */
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    background-color: #ffffff;
    padding: 25px 30px;
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15), 0 5px 15px rgba(0,0,0,0.1);
    width: auto;
    min-width: 320px;
    max-width: 500px;
    z-index: 10001; /* Above overlay */
    text-align: left;
    display: flex;
    flex-direction: column;
}

.modal-hidden {
    display: none !important; /* Use important to ensure it overrides other display styles if needed */
}

.modal-title {
    color: #33367B;
    font-size: 1.6em;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.modal-message {
    font-size: 1em;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.6;
}

.modal-input-container {
    margin-bottom: 20px;
}
.modal-input-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #454545;
}
.modal-input-field {
    width: 100%;
    padding: 10px 12px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
.modal-input-field:focus {
    border-color: #33367B;
    box-shadow: 0 0 0 2px rgba(51, 54, 123, 0.2);
    outline: none;
}

.modal-lg {
    max-width: 800px;
    max-height: 85vh; /* Set a max height relative to the viewport */
    display: flex; /* Use flexbox to manage internal layout */
    flex-direction: column;
}

.modal-close-button {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2em;
    cursor: pointer;
    color: #6c757d;
}

.modal-content {
    text-align: left;
    overflow-y: auto; /* Make content scrollable if it overflows */
    padding-right: 15px; /* Add padding to prevent content from hiding under the scrollbar */
}

.guide-section {
    margin-bottom: 2em;
    padding-bottom: 1em;
    border-bottom: 1px solid #e0e0e0;
}

.guide-section:last-child {
    border-bottom: none;
}

.guide-section h3 {
    font-size: 1.4em;
    color: #33367B;
    margin-bottom: 0.75em;
}

.guide-section h4 {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 0.5em;
}


.modal-button-container {
    text-align: right; /* Align buttons to the right */
    margin-top: 25px;
}

.modal-button-container button {
    margin-left: 10px;
    padding: 0.6em 1.2em; /* Using existing button styles */
    font-size: 0.95em;
}

/* Style for the close button on the error banner */
.close-message-btn {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.6em;
    font-weight: bold;
    color: #842029;
    cursor: pointer;
    padding: 0.2em 0.5em;
    line-height: 1;
    opacity: 0.6;
}

.close-message-btn:hover {
    color: #333;
    background-color: #e0e0e0;
    border-radius: 50%;
    opacity: 1;
}

/* Ensure message banners with this button can contain it */
#noResultsMessage {
    position: relative; /* Let it sit in the flow of the content pane */
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1.5em;
    padding-right: 50px; /* Make space for the close button */
    text-align: left;
}

/* Skeleton Loading Styles */
.skeleton-item {
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 1em;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 220px;
}

.skeleton-item .skeleton-icon-area {
    width: 100%;
    height: 150px;
    margin-bottom: 1em;
    border-radius: 2px;
    background-color: #e9ecef;
}

.skeleton-item .skeleton-name {
    height: 1.3em;
    background-color: #e9ecef;
    border-radius: 3px;
    width: 85%;
}

@keyframes skeleton-loading {
    0% {
        background-color: hsl(210, 20%, 90%);
    }
    50% {
        background-color: hsl(210, 20%, 95%);
    }
    100% {
        background-color: hsl(210, 20%, 90%);
    }
}

.skeleton-item .skeleton-icon-area,
.skeleton-item .skeleton-name {
    animation: skeleton-loading 1.5s infinite ease-in-out;
}

/* Login View Styles */
#loginView {
    max-width: 450px;
    margin: 4em auto; /* Centered with top margin */
    padding: 2.5em;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}
.login-logo {
    max-width: 200px;
    margin-bottom: 1.5em;
}
#loginView h2 {
    font-size: 1.7em;
    color: #33367B;
    margin-bottom: 0.5em;
    border-bottom: none;
}
#loginView p {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 2em;
}
#loginView .button-primary {
    width: 100%;
    padding: 0.9em 1.5em;
    font-size: 1.1em;
}

/* Styles for Upload Modal */
#uploadModalDialog {
    max-width: 600px; /* Wider modal for upload */
    max-height: 85vh;
}

.upload-form {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 15px; /* For scrollbar */
    margin-right: -15px; /* Counteract padding */
}

#uploadDestinationPath {
    font-family: monospace;
    background-color: #e9ecef;
    padding: 0.2em 0.5em;
    border-radius: 3px;
    font-size: 0.95em;
}

.upload-form {
    margin-top: 1.5em;
}

.upload-form label.button-secondary {
    margin-right: 10px;
    margin-bottom: 1em;
}

#filePreview {
    margin-top: 1em;
    max-height: 20vh;
    overflow-y: auto;
    font-size: 0.9em;
    text-align: left;
    border: 1px solid #e0e0e0;
    padding: 1em;
    border-radius: 3px;
    background-color: #f8f9fa;
}

#filePreview ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#filePreview li {
    padding: 0.4em 0.6em;
    margin-bottom: 0.5em;
    background-color: #fff;
    border-radius: 2px;
    border: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upload-progress-bar-container {
    width: 100px;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.upload-progress-bar {
    width: 0%;
    height: 100%;
    background-color: #33367B;
    transition: width 0.2s ease-in-out;
}

#contentActions {
    margin-bottom: 1.5em; /* Add space below the action bar */
}

/* Footer Styles */
footer {
    background-color: #33367B; /* Primary corporate color */
    color: #ffffff;
    text-align: center;
    padding: 1.5em 2em;
    margin-top: 2em;
    font-size: 0.9em;
}

footer p {
    margin: 0;
}

.thumbnail-icon-area .processing-icon {
    opacity: 0.3;
}
.processing-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 0.8em;
    padding: 0.3em 0;
    text-align: center;
    font-weight: 500;
}

.progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 4px;
    margin: 0.5em 0;
    overflow: hidden;
    height: 20px;
    border: 1px solid #dee2e6;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: #33367B;
    transition: width 0.2s ease-in-out;
    text-align: center;
    line-height: 20px;
    color: white;
    font-size: 0.8em;
}

.progress-text {
    font-size: 0.9em;
    font-weight: 500;
    color: #33367B;
    margin: 0;
    text-align: center;
}

/* --- Background Task Notifier --- */
.background-task-notifier {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.task-notification {
    background-color: #ffffff;
    color: #333;
    padding: 12px 18px;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 350px;
    border-left: 5px solid #6c757d;
    transition: all 0.3s ease-in-out;
    opacity: 0;
    transform: translateX(20px);
    animation: slideIn 0.5s forwards;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.task-notification.closing {
    animation: slideOut 0.5s forwards;
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
        height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-bottom: 0;
    }
}


.task-notification-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-left-color: #33367B;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

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

.task-notification-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.task-notification-content {
    flex-grow: 1;
    font-size: 0.95em;
}

.task-notification-content strong {
    display: block;
    margin-bottom: 3px;
    color: #000;
}

/* Status-specific styles */
.task-notification.in-progress {
    border-left-color: #33367B;
}

.task-notification.success {
    border-left-color: #28a745;
}
.task-notification.success .task-notification-icon {
    color: #28a745;
}

.task-notification.error {
    border-left-color: #dc3545;
}
.task-notification.error .task-notification-icon {
    color: #dc3545;
}


/* --- Responsive Design --- */

/* Medium screens (e.g., tablets and small laptops) */
@media (max-width: 1024px) {
    main {
        padding: 1.5em;
    }

    #folderItemsDisplay {
        grid-template-columns: repeat(3, 1fr);
        gap: 1em;
    }

    /* We no longer force vertical stacking here, keeping side-by-side until mobile */
}

/* Small screens (e.g., mobile phones) */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: center; /* Center items for a cleaner look */
        padding: 1em; /* Reduced padding to match main */
        gap: 1em; /* Add gap between header sections */
    }

    .header-left {
        flex-direction: column; /* Stack logo and title */
        align-items: center;   /* Center them within their container */
        gap: 0.5em;            /* Add a small gap */
        text-align: center;    /* Center title text if it wraps */
        margin-bottom: 0;      /* Remove bottom margin as header gap is used */
    }

    header h1 {
        font-size: 1.3em;
    }

    #companyLogo {
        max-height: 35px;
        margin-right: 0; /* Remove margin, alignment handled by flex */
    }

    #authControls {
        width: 100%;
        justify-content: center; /* Center content now that it might stack */
    }

    #userSessionInfo {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    main {
        padding: 1em;
    }

    /* Off-canvas sidebar styles */
    .folder-tree-pane {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 2000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }

    .sidebar-open .folder-tree-pane {
        transform: translateX(0);
    }

    .mobile-only {
        display: inline-flex !important;
    }

    .app-layout {
        display: block; /* Remove flex behavior that might interfere */
    }

    /* Navigation Header Styles for Mobile */
    .navigation-wrapper {
        display: flex;
        align-items: center;
        gap: 0.8em;
        margin-bottom: 1.5em;
        border-bottom: 1px solid #e0e0e0;
        padding-bottom: 0.75em;
        flex-wrap: wrap; /* Allow wrapping if path is very long */
    }

    #breadcrumbNav {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        flex-grow: 1;
    }

    #mobileSidebarToggle {
        margin-bottom: 0; /* Remove any default button margin */
        flex-shrink: 0; /* Prevent button from shrinking */
    }

    #folderItemsDisplay {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1em;
    }

    #contentActions {
        margin-left: 0;
        width: 100%;
    }

    #showUploadModalButton {
        width: 100%;
    }

    #multiSelectToolbar {
        flex-wrap: wrap;
        width: 100%;
    }

    .lightbox-content {
        max-width: 95%;
    }

    .lightbox-prev, .lightbox-next {
        padding: 12px;
        font-size: 20px;
    }

    .modal-dialog {
        width: 90%;
        padding: 20px;
    }
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    display: none; /* Toggled via JS/CSS logic */
}

@media (max-width: 480px) {
    #folderItemsDisplay {
        grid-template-columns: 1fr; /* Single column */
    }

    .user-details-header {
        display: none; /* Hide for very small screens to save space */
    }

    header h1 {
        display: none; /* Hide title on very small screens for space */
    }

    #companyLogo {
        max-height: 30px;
        margin-right: 15px;
    }

    .button-primary, .button-secondary {
        padding: 0.6em 1.2em;
        font-size: 0.9em;
    }
}

/* frontend/style.css */

/* Restricted Folder Badge */
.restricted-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #ffd700; /* Gold color for the lock */
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
    pointer-events: none; /* Let clicks pass through */
}

/* Add a visual hint when a folder is selected for permission change */
.item-thumbnail.selected {
    border-color: #0078d4;
    background-color: #f0f8ff;
}