/* App-specific Styles */

/* App Layout */
.app-body {
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-secondary);
}

/* Sidebar Styles */
.selected-folders {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.selected-folder,
.selected-folder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.selected-folder-item .folder-icon {
  font-size: 16px;
  margin-right: var(--space-2);
  flex-shrink: 0;
  line-height: 1;
}

.selected-folder-item .folder-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-folder-item .remove-folder-btn {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast) var(--ease-in-out);
  flex-shrink: 0;
  margin-left: var(--space-2);
  font-size: 18px;
  line-height: 1;
  font-weight: bold;
}

.selected-folder-item .remove-folder-btn:hover {
  background-color: var(--bg-hover);
  color: var(--error);
}

.selected-folder button {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast) var(--ease-in-out);
}

.selected-folder button:hover {
  background-color: var(--bg-hover);
  color: var(--error);
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.filter-tab {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  background-color: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast) var(--ease-in-out);
}

.filter-tab:hover {
  background-color: var(--bg-secondary);
  border-color: var(--border-hover);
}

.filter-tab.active {
  background-color: var(--primary);
  color: var(--text-inverse);
  border-color: var(--primary);
}

/* File Type Options */
.file-type-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 200px;
  overflow-y: auto;
}

.file-type-option {
  display: flex;
  align-items: center;
  font-size: var(--text-sm);
}

.file-type-option input {
  margin-right: var(--space-2);
}

/* Custom Date Range */
.custom-date-range {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* Saved Searches */
.saved-searches {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.saved-search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast) var(--ease-in-out);
}

.saved-search-item:hover {
  background-color: var(--bg-hover);
  border-color: var(--primary);
}

.saved-search-name {
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.saved-search-delete {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast) var(--ease-in-out);
}

.saved-search-delete:hover {
  background-color: var(--bg-primary);
  color: var(--error);
}

/* Grid View */
.results-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-3);
  padding: var(--space-3);
}

.grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-3);
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast) var(--ease-in-out);
}

.grid-item:hover {
  background-color: var(--bg-secondary);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.grid-item-icon {
  font-size: 48px;
  margin-bottom: var(--space-2);
}

.grid-item-name {
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  margin-bottom: var(--space-2);
}

.grid-item-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* View Options */
.view-options {
  display: flex;
  gap: var(--space-1);
}

.view-btn {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  background-color: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-fast) var(--ease-in-out);
}

.view-btn:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.view-btn:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.view-btn:not(:first-child) {
  border-left: none;
}

.view-btn:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.view-btn.active {
  background-color: var(--primary);
  color: var(--text-inverse);
  border-color: var(--primary);
}

/* Column Selector */
.column-selector {
  position: relative;
}

.column-selector-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: var(--z-dropdown);
  min-width: 200px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  display: none;
}

.column-selector-dropdown.show {
  display: block;
}

.column-option {
  display: flex;
  align-items: center;
  padding: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast) var(--ease-in-out);
}

.column-option:hover {
  background-color: var(--bg-secondary);
}

.column-option input {
  margin-right: var(--space-2);
}

/* Results Table Specific */
.results-table {
  width: 100%;
  background-color: var(--bg-primary);
}

.results-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--bg-secondary);
}

.results-table th {
  padding: var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-align: left;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  user-select: none;
  white-space: nowrap;
}

.results-table th.sortable {
  cursor: pointer;
  transition: background-color var(--transition-fast) var(--ease-in-out);
}

.results-table th.sortable:hover {
  background-color: var(--bg-hover);
}

.sort-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: var(--space-1);
  opacity: 0.3;
  transition: opacity var(--transition-fast) var(--ease-in-out);
}

.results-table th.sort-asc .sort-icon,
.results-table th.sort-desc .sort-icon {
  opacity: 1;
}

.results-table th.sort-desc .sort-icon {
  transform: rotate(180deg);
}

.results-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition-fast) var(--ease-in-out);
}

.results-table tbody tr:hover {
  background-color: var(--bg-secondary);
}

.results-table tbody tr.selected {
  background-color: var(--primary-light);
}

.results-table td {
  padding: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.th-checkbox {
  width: 40px;
}

.th-icon {
  width: 40px;
}

.th-name {
  min-width: 200px;
}

.th-path {
  min-width: 300px;
}

.th-size {
  width: 100px;
}

.th-modified {
  width: 150px;
}

.th-type {
  width: 100px;
}

.th-match {
  min-width: 200px;
}

.th-actions {
  width: 100px;
}

/* File Icon */
.file-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-icon img {
  width: 100%;
  height: 100%;
}

/* File Name */
.file-name {
  font-weight: var(--font-medium);
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-fast) var(--ease-in-out);
}

.file-name:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* File Path */
.file-path {
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 400px;
}

/* Match Context */
.match-context {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  padding: var(--space-1) var(--space-2);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-highlight {
  background-color: var(--warning);
  color: var(--text-primary);
  padding: 0 var(--space-1);
  border-radius: var(--radius-sm);
}

/* No Results */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: var(--space-12);
  text-align: center;
}

.no-results img {
  width: 64px;
  height: 64px;
  opacity: 0.3;
  margin-bottom: var(--space-4);
}

.no-results p {
  font-size: var(--text-lg);
  color: var(--text-muted);
  margin: 0;
}

/* Preview Placeholder */
.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}

.preview-placeholder img {
  width: 48px;
  height: 48px;
  opacity: 0.3;
  margin-bottom: var(--space-3);
}

.preview-placeholder p {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin: 0;
}

/* Preview Content Types */
.preview-text {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.preview-pdf {
  width: 100%;
  height: 500px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.preview-audio,
.preview-video {
  width: 100%;
  border-radius: var(--radius-md);
}

/* File Properties */
.file-properties {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.property-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-1) 0;
}

.property-label {
  font-weight: var(--font-medium);
  color: var(--text-muted);
}

.property-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* Settings Sections */
.settings-section {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-section h4 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}