/* Example CSS for directory listings */
body {
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  color: #333;
  padding: 20px;
  
}

main {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

h1 {
  color: #007acc;
}

/* Breadcrumb navigation */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 0;
  row-gap: 10px;
  padding: 12px 0;
  margin-bottom: 20px;
  font-size: 14pt;
  color: #666;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  color: #007acc;
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb-item:hover {
  color: #005a9e;
  text-decoration: underline;
}

.breadcrumb-item.current {
  color: #333;
  font-weight: 600;
  cursor: default;
}

.breadcrumb-separator {
  margin: 0 8px;
  color: #999;
  user-select: none;
}

/* ZIP download button */
.zip-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: #007acc;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-size: 18px;
  flex-shrink: 0;
  transition: background-color 0.2s;
  margin-right: 4px;
}

.zip-download-btn:hover {
  background-color: #005a9e;
}

/* Search box */
#searchBox {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  min-width: 200px;
  max-width: 300px;
  flex: 1;
  transition: border-color 0.2s;
}

#searchBox:focus {
  outline: none;
  border-color: #007acc;
}

.directory-table {
  padding: 0;
  display: table;
  width: 100%;
}

.directory-table .directory-table-row {
  display: table-row;
  margin-top: auto;
  margin-bottom: auto;
  padding: 8px;
  font-size: 16pt;
  color: #007acc;
  text-decoration: none;
}

.directory-table .directory-table-row:hover .directory-table-cell.item-filename {
  text-decoration: underline;
}

.directory-table .directory-table-row .directory-table-cell {
  padding: 8px;
  display: table-cell;
  margin-top: auto;
  margin-bottom: auto;
  vertical-align: middle;
}

.directory-table .directory-table-row:hover * {
  background-color: #eaeaea;
}

.directory-table .directory-table-row .directory-table-cell:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.directory-table .directory-table-row .directory-table-cell:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

.directory-table-row-divider {
  display: table-row;
  height: 1px;
  background-color: #f4f4f4;
  border-radius: 0px;
}

.directory-table-row-divider-item {
  display: table-cell;
  height: 1px;
  background-color: #f4f4f4;
  padding: 5px 0;
  border-radius: 0px;
  vertical-align: middle;
}

.directory-table-row-divider-item-line {
  height: 1px;
  background-color: #ddd;
  border-radius: 0px;
}

/* Highlighted item styling */
.directory-table-row.highlighted {
  background-color: #fff3cd !important;
  border-left: 4px solid #ffc107;
  padding-left: calc(8px - 4px); /* Adjust padding to compensate for border */
  animation: highlight-pulse 2s ease-in-out;
}

@keyframes highlight-pulse {
  0%, 100% { background-color: #fff3cd; }
  50% { background-color: #ffe69c; }
}

.item-icon {
  width: 32px;
  max-width: 32px;
  height: 32px;
}

/*.directory-table .directory-table-row:not(:last-child) {
  border-bottom: 1px solid #ddd;
}*/

i {
  width: 32px;
  max-width: 32px;
  text-align: center;
  margin-top: auto;
  margin-bottom: auto;
}

.item-icon {
  max-width: 32px;
  height: 32px;
  margin-right: 10px;
}

.item-filename {
  text-align: left;
}

.item-modified {
  text-align: right;
  min-width: max-content;
}

.item-filesize {
  text-align: right;
  width: 100px;
  min-width: max-content;
}

/* Hide mobile-only elements on desktop */
.mobile-only {
  display: none;
}

/* Show desktop-comma on desktop, hide on mobile */
.desktop-comma {
  display: inline;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  /* Show mobile-only elements on mobile */
  .mobile-only {
    display: inline;
  }

  /* Hide desktop-comma on mobile */
  .desktop-comma {
    display: none;
  }

  body {
    padding: 10px;
  }

  main {
    max-width: 100%;
  }

  h1 {
    font-size: 20pt;
    margin-bottom: 10px;
  }

  h3 {
    font-size: 12pt;
  }

  /* Make breadcrumbs smaller and more compact on mobile */
  .breadcrumb {
    font-size: 11pt;
    padding: 8px 0;
    margin-bottom: 15px;
    row-gap: 8px;
  }

  .breadcrumb-separator {
    margin: 0 4px;
  }
  
  /* Make search box full width on mobile */
  #searchBox {
    min-width: 0;
    max-width: none;
    flex: 1;
    font-size: 16px; /* Prevent zoom on iOS */
  }

  /* Convert table to block layout for mobile */
  .directory-table {
    display: block;
  }

  .directory-table-row {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    padding: 12px 8px !important;
    border-radius: 8px;
    margin-bottom: 4px;
  }

  .directory-table-row:hover * {
    background-color: transparent;
  }

  .directory-table-row:hover {
    background-color: #eaeaea;
  }

  .directory-table .directory-table-row .directory-table-cell {
    display: block;
    padding: 0;
  }

  .directory-table .directory-table-row .directory-table-cell:first-child,
  .directory-table .directory-table-row .directory-table-cell:last-child {
    border-radius: 0;
  }

  /* Icon column - fixed width */
  .item-icon {
    flex-shrink: 0;
    margin-right: 12px;
    width: 28px;
    max-width: 28px;
    height: 28px;
  }

  i {
    width: 28px;
    max-width: 28px;
    font-size: 14pt;
  }

  /* Filename column - takes remaining space */
  .item-filename {
    flex: 1;
    text-align: left;
    font-size: 14pt;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 8px;
  }

  /* Modified date - smaller font on mobile */
  .item-modified {
    font-size: 9pt;
    color: #666;
    flex-shrink: 0;
    width: auto;
    min-width: 80px;
    margin-right: 5px;
  }

  /* Size column - fixed width on right */
  .item-filesize {
    flex-shrink: 0;
    width: auto;
    min-width: 70px;
    text-align: right;
    font-size: 11pt;
    color: #666;
  }

  /* Dividers - make them simpler on mobile */
  .directory-table-row-divider {
    display: block;
    height: 0;
    padding: 2px 0;
    background-color: transparent;
  }

  .directory-table-row-divider-item {
    display: none;
  }

  .directory-table-row-divider-item:first-child {
    display: block;
  }

  .directory-table-row-divider-item-line {
    height: 1px;
    background-color: #ddd;
    margin: 0;
  }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
  h1 {
    font-size: 18pt;
  }

  .breadcrumb {
    font-size: 10pt;
  }

  .item-filename {
    font-size: 13pt;
  }

  .item-filesize {
    min-width: 60px;
    font-size: 10pt;
  }

  .directory-table-row {
    padding: 10px 6px !important;
  }
}