body {
  font-family: Arial, sans-serif;
  color: #333;
  background-color: #343a40;
  background-color: #425257;
}
html, body {
  margin: 0;
  overscroll-behavior: none;
}
nav {
  background-color: #0F1F24;
  display: flex;
  justify-content: center;
}
nav > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  color: #E6E6E6;
  height: 71px;
  width: 100%;
  max-width: 60rem;
}
main {
  display: flex;
  justify-content: center;
  position: relative;
  min-height: 100vh;
  align-items: flex-start;
}
main > div {
  margin: 0 15px 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 60rem;
}
.breadcrumb {
  margin: 20px 0 10px;
  padding: 10px;
  background-color: #E6E6E6;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}
#add-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 36px;
  height: 115.5px;
  width: 150px;
  overflow: visible;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  flex-direction: column;
  align-items: center;
  background-color: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  z-index: 1000;
}
#add-dropdown.show-dropdown {
  display: flex;
}
#add-dropdown > div {
  height: calc(100% / 3);
  width: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
#add-dropdown > div:hover {
  background-color: #f0f0f0;
  cursor: pointer;
}

.breadcrumb a {
  color: #000;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb #add-new {
  font-size: 24px;
}
.breadcrumb #add-new:hover {
  cursor: pointer;
  font-weight: bold;
}

main.dragover #fulldropzone {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(255,255,255,0.25);
  height: 100%;
}
.drop-zone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  background-color: rgba(248, 249, 250, 0.25);
  margin: 10px 0;
  transition: all 0.3s ease;
  cursor: pointer;
  box-sizing: border-box;
}

.drop-zone:hover {
  border-color: #425257;
  /*background: #f1f3f5;*/
  background-color: (248, 249, 250, 0.75)
}
/*
.drop-zone.dragover {
  background: #e9ecef;
  border-color: #4CAF50;
}
*/
.drop-zone i {
  color: #333;
  margin-bottom: 10px;
}

.drop-zone p {
  margin: 5px 0;
  color: #fff;
}

.drop-zone button {
  margin-top: 10px;
  padding: 8px 16px;
  background-color: #0F1F24;
  color: #E6E6E6;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.drop-zone button:hover {
  background-color: #425257;
}

.upload-progress {
  margin: 20px 0;
  display: none;
}
.upload-progress h3 {
  color: #fff;
}


.progress-item {
  margin: 10px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.progress-item .filename {
  margin-bottom: 8px;
  font-weight: 500;
}

.progress-bar {
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: #1ABFA5;
  width: 0%;
  transition: width 0.3s ease;
}

.error {
  color: #dc3545;
  margin-top: 8px;
  font-size: 0.9em;
}
.file-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(237.48px, 1fr));
  box-sizing: border-box;
  margin-top: 10px;
}

.folder-item {
  transition: all 0.3s ease;
  width: 237.48px;
  height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  box-sizing: border-box;
  position: relative;
  background-image: url("/static/img/folder.svg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

a.folder-link {
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: #333;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}

i.fas.fa-folder {
  font-size: 24px;
  color: #333;
}

.folder-name {
  padding: 15px;
  color: #fff;
}

.file-item {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  transition: all 0.3s ease;
  aspect-ratio: 1.3193333333;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  padding: 10px 0;
  position: relative;
}
a.file-link {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    flex-direction: column;
    text-decoration: none;
    color: #333;
}
a.file-link i {
    font-size: 1.75rem;
}
.file-item .file-name {
    word-break: break-word;
    margin-top: 5px;
    text-align: center;
}
.file-item .file-info {
  font-size: 0.8em;
  margin-bottom: 10px;
  color: #333;
}

.subfolder-contents {
  margin-top: 50px;
  width: 100%;
  overflow-y: auto;
  padding: 10px 0;
  text-align: left;
  pointer-events: none;
  position: relative;
  overflow-y: scroll; /* Enable vertical scrolling */
  mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent); /* For Safari */
}

a.sub-item {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  padding: 6px 0;
  width: 100%;
  text-decoration: none;
  color: #fff;
  pointer-events: all;
}
a.sub-item:hover {
  background-color: #879CA3;
}

.sub-item i {
  margin:0 5px 0 10px;
}

.actions {
  margin-top: 10px;
  display: flex;
  gap: 5px;
  width: 100%;
}

.actions a {
  color: #666;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.actions a:hover {
  color: #000;
}

dialog {
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  padding: 20px;
  width: 50vw;
  max-width: 600px;
  height: auto;
  max-height: 40vh;
  overflow-y: auto;
}
dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}
dialog > div {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}
#closeModal {
  color: #333;
  cursor: pointer;
  position: absolute;
  right: -10px;
  top: -10px;
  font-weight: bold;
}
#closeModal:hover {
  color: #000;
}
dialog > div > form {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}
dialog > div > form input[name='folder_name'] {
  margin-bottom: 30px;
  outline: none;
  border: 0.8px solid #707070;
  height: 41.55px;
  box-sizing: border-box;
  border-radius: 5px;
  padding: 0 10px;
}
form.new-folder-form button[type='submit'] {
  cursor: pointer;
}

@media (max-width: 400px) {
  .file-grid {
    grid-template-columns: 1fr;
  }

  .file-item {
    width: 100%;
    height: 100%;
  }
  .folder-item {
    aspect-ratio: 1.3193333333;
    width: 100%;
    height: auto;
  }
}
@media (min-width: 401px) {
  .folder-item {
    aspect-ratio: 1.3193333333;
  }
  .file-item {
    width: 237.48px;
    height: 180px;
  }
}