/*
 * Files — extends the press theme for file management.
 * Minimal additions: file list, breadcrumbs, upload area, share dialog.
 */

/* Breadcrumbs */
#breadcrumbs {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  margin-bottom: var(--space);
  color: var(--text-light);
}

#breadcrumbs a {
  color: var(--text-light);
  text-decoration: none;
}

#breadcrumbs a:hover {
  color: var(--accent);
}

#breadcrumbs .separator {
  margin: 0 0.3em;
  color: var(--border);
}


/* File list */
#file-list {
  margin-bottom: var(--space);
}

.file-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
}

.file-item:first-child {
  border-top: 1px solid var(--border);
}

.file-item a {
  flex: 1;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: 500;
}

.file-item a:hover {
  color: var(--accent);
}

.file-item .file-icon {
  width: 1.5em;
  text-align: center;
  flex-shrink: 0;
}

.file-item .file-size {
  font-size: 0.85rem;
  color: var(--text-light);
  white-space: nowrap;
}

.file-item .file-modified {
  font-size: 0.85rem;
  color: var(--text-light);
  white-space: nowrap;
}

.file-item .file-actions {
  display: flex;
  gap: 0.25em;
}

.file-item .file-actions button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 0.85rem;
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

.file-item .file-actions button:hover {
  background: var(--border);
  color: var(--text);
}

.empty-dir {
  color: var(--text-light);
  font-style: italic;
  padding: var(--space) 0;
}


/* Upload area */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 6px;
  padding: var(--space);
  text-align: center;
  margin-bottom: var(--space);
  color: var(--text-light);
  transition: border-color 0.15s, background 0.15s;
}

.upload-area.dragover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.upload-area button {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.3em 0.8em;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.9rem;
}

.upload-area button:hover {
  background: var(--accent);
  color: var(--background);
}

#upload-progress {
  margin-top: var(--space-sm);
  font-size: 0.85rem;
}


/* New folder */
#new-folder {
  margin-bottom: var(--space);
}

#new-folder summary {
  cursor: pointer;
  color: var(--text-light);
  font-family: var(--font-heading);
  font-size: 0.9rem;
}

#new-folder-form {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

#new-folder-form input {
  flex: 1;
  padding: 0.4em 0.6em;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--background);
  color: var(--text);
}

#new-folder-form button {
  padding: 0.4em 0.8em;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.9rem;
}


/* Share dialog */
#share-dialog {
  max-width: 28em;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--space);
  font-family: var(--font-body);
  color: var(--text);
  background: var(--background);
}

#share-dialog::backdrop {
  background: rgba(0, 0, 0, 0.3);
}

#share-dialog h2 {
  margin-top: 0;
  font-size: 1.25rem;
  border: none;
}

#share-dialog label {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: 0.9rem;
}

#share-dialog select,
#share-url {
  width: 100%;
  padding: 0.4em 0.6em;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
  background: var(--background);
  color: var(--text);
}

#share-url {
  margin-bottom: var(--space-sm);
}

.dialog-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space);
}

.dialog-actions button {
  padding: 0.4em 0.8em;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  background: var(--background);
  color: var(--text);
}

#create-share-btn {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}


/* Loading state */
.loading {
  color: var(--text-light);
  font-style: italic;
}


/* Responsive: hide modified date on small screens */
@media (max-width: 600px) {
  .file-item .file-modified {
    display: none;
  }
}
