.bp-file-explorer {
    width: 100%;
    height: 100%;
}

.bp-file-explorer-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* background: #fff; */
    border: 1px solid #999;
    font-family: "MS Sans Serif", Arial, sans-serif;
    font-size: 12px;
  }
  
  .bp-file-explorer-toolbar {
    padding: 4px 8px;
    /* background: #ece9d8; */
    border-bottom: 1px solid #999;
    display: flex;
    gap: 8px;
  }
  
  .bp-file-explorer-toolbar-buttons {
    display: flex;
    gap: 4px;
  }

  .bp-file-explorer-toolbar-buttons i {
    font-size: 22px;
  }
  
  .bp-file-explorer-btn {
    padding: 2px 8px;
    /* background: #ece9d8;*/
    border: 1px solid #999;
    border-radius: 3px;
    cursor: pointer;
  }
  
  .bp-file-explorer-btn:active {
    background: #dcd9c8;
  }
  
  .bp-file-explorer-address {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-grow: 1;
    padding-left: 103px;
  }
  
  .bp-file-explorer-address-input {
    flex-grow: 1;
    padding: 2px 4px;
    border: 1px solid #999;
  }
  
  .bp-file-explorer-content {
    display: flex;
    flex-grow: 1;
    min-height: 0;
  }
  
  .bp-file-explorer-sidebar {
    width: 200px;
    min-width: 100px;
    border-right: 1px solid #999;
    overflow: auto;
    /* hide the scrollbar */
    scrollbar-width: none; /* Firefox */
  }
  
  .bp-file-explorer-tree {
    padding-left: 10px;
    padding-top: 5px;
    height: 100%;
    /*
    background: #f5f5f5;
    color: #666;
    */
  }
  
  .bp-file-explorer-main {
    /* min-width: 500px; */
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  
  .bp-file-explorer-header {
    display: flex;
    padding: 4px 8px;
    /* background: #ece9d8; */
    border-bottom: 1px solid #999;
    font-weight: bold;
  }
  
  .bp-file-explorer-files {
    flex-grow: 1;
    /* overflow: auto; */
  }
  
  .bp-file-explorer-item {
    display: flex;
    padding: 2px 8px;
    cursor: pointer;
  }
  
  /*
  .bp-file-explorer-item:nth-child(odd) {
    background: #f5f5f5;
  }
  */
  
  /*
  .bp-file-explorer-item:hover {
    background: #e8e8e8;
  }
  */
  
  .bp-file-explorer-column {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 16px;
  }
  
  .bp-file-explorer-column:first-child {
    flex: 2;
  }
  
  .bp-file-explorer-statusbar {
    padding: 2px 8px;
    /* background: #ece9d8; */
    border-top: 1px solid #999;
    background: var(--desktop_element-background);
  }

  .bp-file-explorer-statusbar .usage-stats {
   margin-right: 20px;
  }

  .bp-file-explorer-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: start;
    padding: 20px;
    z-index: 1000;
  }
  
  .bp-file-explorer-upload-container {
    width: 100%;
    max-width: 800px;
    /* background: #fff; */
    border: 1px solid #999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 16px;
  }
  
  .bp-file-explorer-upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
  }
  
  .bp-file-explorer-upload-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
  }
  
  .bp-file-explorer-upload-quota {
    font-size: 12px;
    color: #666;
  }
  
  .bp-file-explorer-upload-files {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    margin-bottom: 16px;
  }
  
  .bp-file-explorer-upload-files-header {
    display: flex;
    /* background: #ece9d8; */
    padding: 8px;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
  }
  
  .bp-file-explorer-upload-column-name {
    flex: 2;
  }
  
  .bp-file-explorer-upload-column-size,
  .bp-file-explorer-upload-column-status {
    flex: 1;
    text-align: right;
  }
  
  .bp-file-explorer-upload-file-item {
    display: flex;
    padding: 8px;
    border-bottom: 1px solid #eee;
  }
  
  .bp-file-explorer-upload-file-item:last-child {
    border-bottom: none;
  }
  
  .bp-file-explorer-upload-total {
    text-align: right;
    margin-bottom: 16px;
    font-weight: bold;
  }
  
  .bp-file-explorer-upload-controls {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 16px;
  }
  
  .bp-file-explorer-upload-start {
    background: #0078d4;
    color: white;
    border: none;
  }
  
  .bp-file-explorer-upload-start:hover {
    background: #106ebe;
  }
  
  .bp-file-explorer-upload-progress-container {
    border: 1px solid #ddd;
    padding: 12px;
  }
  
  .bp-file-explorer-upload-progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
  }
  
  .bp-file-explorer-upload-progress-bar-container {
    height: 20px;
    /* background: #ddd; */
    border: 1px solid #999;
    margin-bottom: 4px;
  }
  
  .bp-file-explorer-upload-progress-bar {
    height: 100%;
    /* background: #0078d4; */
    transition: width 0.3s ease;
  }
  
  .bp-file-explorer-upload-progress-percentage {
    text-align: center;
    font-size: 12px;
    color: #666;
  }

  .bp-file-explorer-file-viewer {
    display: none;
    height: 100%;
  }
  
  .bp-file-explorer-drag-upload {
    position: absolute;
    top: 50%;  /* Center vertically */
    left: 50%;
    transform: translate(-50%, -50%); /* Center the element in both axes */
    width: 50%;
    height: 200px;
    /*
    background-color: rgba(255, 255, 255, 0.8);
    */
    z-index: 10;
    display: flex; /* Updated to be displayed on drag-over event */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* color: #333; */
    font-size: 16px;
    border: 2px dashed #007BFF;
    box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1); /* Adds a slight shadow for a 'pop' effect */
    border-radius: 20px; /* Adds rounded corners to mimic a postage stamp */
}

/* Display the drag upload indicator on file drag-over */
.bp-file-explorer-files.drag-over .bp-file-explorer-drag-upload {
    display: flex;
}

.bp-file-explorer-file-viewer-content {
  height: 100%;
}


.bp-file-explorer-upload-errors {
  color: red;
  font-size: 1.4rem;
  display: none; /* Hidden by default */
}

.bp-file-explorer-storage-warning {
  display: none; /* Hidden by default */
}

/* TODO import jstree css class unminified and modify it */
.jstree-contextmenu {
  z-index: 9999 !important;
}


.bp-file-explorer-tos {
  margin-bottom: 10px; /* Space between terms and buttons */
  font-size: 14px; /* Font size for readability */
  color: #333; /* Text color for readability */
  width: 100%;
}

.bp-file-explorer-tos input[type="checkbox"] {
  margin-right: 5px; /* Space between checkbox and text */
}

.bp-file-explorer-tos label {
  display: inline-block;
}

.bp-file-explorer-tos a {
  color: #0066cc; /* BuddyPond brand color or any link color */
  text-decoration: none; /* Optional: Removes underline */
}

.bp-file-explorer-tos a:hover {
  text-decoration: underline; /* Adds underline on hover */
}

.editorContainer {
  width: 100%;      /* Responsive width */
  height: 100vh;    /* Responsive height, adjust as necessary */
  position: absolute; /* Helps fill the parent container */
}

.bp-file-explorer-update-overlay {
  position: absolute;
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  height: 100%;
  opacity: 1;
  font-size: 48px;
}

.toggle-tree {
  display: none;
}

.spinner {
  width: 100px;
  height: 100px;
  border: 8px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  position: relative;
  opacity: 0.7;
}

.spinner::after {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border: 8px solid transparent;
  border-radius: 50%;
  border-top-color: rgba(255, 255, 255, 0.3);
  animation: spin 2s linear infinite;
}

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

.upload-message {
  text-align: center;
}

@media (max-width: 767px) and (pointer: coarse) and (hover: none) {
    html {
        font-size: 16px; /* Base font size */
    }

    .bp-file-explorer-container {
        margin-bottom: 4rem; /* ~64px, clears taskbar (~48px + 8px) */
        font-size: 0.875rem; /* ~14px, was 12px */
        box-sizing: border-box;
    }

    .bp-file-explorer-toolbar {
        padding: 0.5rem; /* ~8px */
        gap: 0.5rem; /* ~8px */
        flex-wrap: wrap;
    }

    .bp-file-explorer-toolbar-buttons {
        gap: 0.25rem; /* ~4px */
        flex-wrap: wrap;
    }

    .bp-file-explorer-toolbar-buttons i {
        font-size: 1.25rem; /* ~20px, was 22px */
    }

    .bp-file-explorer-btn {
        padding: 0.25rem 0.5rem; /* ~4px 8px */
        min-height: 2.75rem; /* ~44px, touch-friendly */
        min-width: 2.75rem;
        border-radius: 0.25rem; /* ~4px */
    }

    .bp-file-explorer-address {
        padding-left: 0; /* Remove desktop padding */
        flex-grow: 1;
        gap: 0.25rem; /* ~4px */
    }

    .bp-file-explorer-address-input {
        padding: 0.25rem; /* ~4px */
        font-size: 0.875rem; /* ~14px */
        min-height: 2.75rem; /* ~44px */
    }

    .bp-file-explorer-content {
        flex-direction: column; /* Stack sidebar and main */
        overflow-y: auto;
    }

    .bp-file-explorer-sidebar {
        width: 100%; /* Full width */
        max-height: 0; /* Hidden by default */
        overflow: hidden; /* Hide when collapsed */
        transition: max-height 0.3s ease;
        border-right: none;
        border-bottom: 1px solid #999;
    }

    .bp-file-explorer-sidebar.active {
        max-height: 15rem; /* ~240px, enough for tree */
        min-height: 15rem;
        overflow-y: auto;
        scrollbar-width: none; /* Hide scrollbar */
    }

    .bp-file-explorer-sidebar.active::-webkit-scrollbar {
        display: none;
    }

    .bp-file-explorer-tree {
        padding: 0.5rem; /* ~8px */
    }

    .bp-file-explorer-main {
        flex-grow: 1;
        min-width: 0;
    }

    .bp-file-explorer-header {
        padding: 0.25rem 0.5rem; /* ~4px 8px */
        font-size: 0.75rem; /* ~12px */
    }

    .bp-file-explorer-column {
        padding-right: 0.5rem; /* ~8px */
        flex: 1;
    }

    .bp-file-explorer-column:first-child {
        flex: 2; /* Name column wider */
    }

    /* Hide less critical columns (e.g., date, type) */
    .bp-file-explorer-column:not(:first-child):not(:nth-child(2)) {
        display: none;
    }

    .bp-file-explorer-files {
        overflow-y: auto;
        scrollbar-width: none;
    }

    .bp-file-explorer-files::-webkit-scrollbar {
        display: none;
    }

    .bp-file-explorer-item {
        /* padding: 0.5rem; */
        /* min-height: 2.75rem; */
        font-size: 0.875rem; /* ~14px */
    }

    .bp-file-explorer-statusbar {
        padding: 0.25rem 0.5rem; /* ~4px 8px */
        font-size: 0.75rem; /* ~12px */
    }

    .bp-file-explorer-statusbar .usage-stats {
        margin-right: 0.5rem; /* ~8px */
    }

    .bp-file-explorer-upload-overlay {
        padding: 0.5rem; /* ~8px */
        align-items: center;
    }

    .bp-file-explorer-upload-container {
        max-width: calc(100% - 1rem); /* ~355px */
        padding: 0.75rem; /* ~12px */
    }

    .bp-file-explorer-upload-header {
        margin-bottom: 0.75rem; /* ~12px */
        padding-bottom: 0.5rem; /* ~8px */
    }

    .bp-file-explorer-upload-header h2 {
        font-size: 1rem; /* ~16px */
    }

    .bp-file-explorer-upload-quota {
        font-size: 0.75rem; /* ~12px */
    }

    .bp-file-explorer-upload-files {
        max-height: 10rem; /* ~160px */
        overflow-y: auto;
        scrollbar-width: none;
    }

    .bp-file-explorer-upload-files::-webkit-scrollbar {
        display: none;
    }

    .bp-file-explorer-upload-files-header {
        padding: 0.5rem; /* ~8px */
        font-size: 0.75rem; /* ~12px */
    }

    .bp-file-explorer-upload-file-item {
        padding: 0.5rem; /* ~8px */
        font-size: 0.75rem; /* ~12px */
    }

    .bp-file-explorer-upload-total {
        margin-bottom: 0.75rem; /* ~12px */
        font-size: 0.75rem; /* ~12px */
    }

    .bp-file-explorer-upload-controls {
        gap: 0.5rem; /* ~8px */
    }

    .bp-file-explorer-upload-start {
        padding: 0.25rem 0.5rem; /* ~4px 8px */
        min-height: 2.75rem; /* ~44px */
        font-size: 0.875rem; /* ~14px */
    }

    .bp-file-explorer-upload-progress-container {
        padding: 0.5rem; /* ~8px */
    }

    .bp-file-explorer-upload-progress-bar-container {
        height: 1rem; /* ~16px */
    }

    .bp-file-explorer-upload-progress-percentage {
        font-size: 0.75rem; /* ~12px */
    }

    .bp-file-explorer-drag-upload {
        width: 80%; /* ~284px on 355px */
        height: 8rem; /* ~128px */
        font-size: 0.875rem; /* ~14px */
        border-radius: 0.75rem; /* ~12px */
    }

    .bp-file-explorer-upload-errors {
        font-size: 0.875rem; /* ~14px */
    }

    .bp-file-explorer-tos {
        font-size: 0.75rem; /* ~12px */
        margin-bottom: 0.5rem; /* ~8px */
    }

    .bp-file-explorer-update-overlay {
        font-size: 1.5rem; /* ~24px, was 48px */
    }

    .spinner {
        width: 2.5rem; /* ~40px */
        height: 2.5rem;
        border-width: 0.25rem; /* ~4px */
    }

    .spinner::after {
        top: -0.25rem;
        left: -0.25rem;
        right: -0.25rem;
        bottom: -0.25rem;
        border-width: 0.25rem;
    }

    .toggle-tree {
      display: block;
    }
}