/* ==========================================================================
   ADMIN SUBTITRES PAGE STYLES - Ultra Compact Tree Table Format
   ========================================================================== */

.admin-content--subtitles {
  padding: var(--space-lg);
  max-width: 100%;
  overflow-x: auto;
}

/* Header */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.admin-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.admin-count {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  background: var(--color-surface);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 500;
}

/* Filters */
.subtitles-filters {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-group label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select,
.filter-input {
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: white;
  transition: all 0.2s ease;
  min-width: 140px;
  height: 32px;
}

.filter-group--search {
  flex: 1;
  min-width: 150px;
}

.filter-group--search .filter-input {
  width: 100%;
  min-width: unset;
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(201, 169, 97, 0.1);
}

/* Tree Table Container */
.subtitles-tree-table-container {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Tree Table - Compact */
.subtitles-tree-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.subtitles-tree-table--compact {
  font-size: 0.8rem;
}

.subtitles-tree-table thead {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 1px solid var(--color-border);
}

.subtitles-tree-table th {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.subtitles-tree-table th.col-path {
  width: 45%;
}

.subtitles-tree-table th.col-quality {
  width: 15%;
  text-align: center;
}

.subtitles-tree-table th.col-proposals {
  width: 40%;
  text-align: left;
}

/* Tree Rows - Compact */
.tree-row--compact {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.subtitles-tree-table tbody tr {
  transition: all 0.15s ease;
}

.subtitles-tree-table tbody tr:hover {
  background: rgba(201, 169, 97, 0.04);
}

.subtitles-tree-table tbody tr:last-child {
  border-bottom: none;
}

.subtitles-tree-table td {
  padding: 6px var(--space-sm);
  vertical-align: middle;
  line-height: 1.3;
}

/* Tree Cell with Indentation */
.tree-cell {
  --indent: 0px;
  transition: padding-left 0.2s ease;
}

.tree-cell--compact {
  padding: 4px var(--space-sm);
}

.tree-content {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.tree-content--compact {
  gap: 4px;
}

/* Folder Row */
.tree-folder-row {
  background: rgba(248, 249, 250, 0.3);
}

.tree-folder-row:hover {
  background: rgba(201, 169, 97, 0.06) !important;
}

.tree-toggle {
  cursor: pointer;
  font-size: 0.65rem;
  color: var(--color-primary);
  user-select: none;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.tree-toggle--compact {
  width: 12px;
  height: 12px;
  font-size: 0.6rem;
}

.tree-toggle:hover {
  background: rgba(201, 169, 97, 0.2);
}

.folder-icon {
  font-size: 0.9rem;
  opacity: 0.7;
  flex-shrink: 0;
}

.folder-icon--compact {
  font-size: 0.8rem;
}

.folder-name {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.85rem;
}

.folder-name--compact {
  font-size: 0.8rem;
}

/* Video Row */
.tree-video-row {
  cursor: pointer;
}

.tree-video-row:hover {
  background: rgba(201, 169, 97, 0.08) !important;
}

.video-icon {
  font-size: 0.85rem;
  opacity: 0.6;
  flex-shrink: 0;
}

.video-icon--compact {
  font-size: 0.75rem;
}

.video-name {
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.85rem;
}

.video-name--compact {
  font-size: 0.8rem;
}

.subtitle-lang-compact {
  font-size: 0.65rem;
  color: #27ae60;
  background: rgba(39, 174, 96, 0.1);
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
  font-weight: 600;
}

/* Path Cell */
.cell-path {
  font-size: 0.85rem;
}

/* Quality Slider Ultra Compact */
.cell-quality {
  text-align: center;
}

.quality-slider-ultra-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.quality-dots-compact {
  display: flex;
  gap: 2px;
}

.quality-dot-compact {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddd;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quality-dot-compact:hover {
  transform: scale(1.4);
  box-shadow: 0 0 0 2px rgba(201, 169, 97, 0.3);
}

.quality-dot-compact--active {
  background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
}

.quality-letter {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted);
  min-width: 16px;
}

.quality-none {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

/* Proposals Ultra Compact */
.cell-proposals {
  text-align: left;
}

.proposals-none {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-style: italic;
}

.proposals-list-ultra-compact {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.proposals-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  background: #f39c12;
  color: white;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.proposals-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.proposal-item-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 2px 6px;
  background: rgba(241, 196, 15, 0.08);
  border-radius: 3px;
  border-left: 2px solid #f39c12;
  cursor: help;
  overflow: hidden;
}

.proposal-clickable {
  cursor: pointer;
  transition: all 0.15s ease;
}

.proposal-clickable:hover {
  background: rgba(241, 196, 15, 0.2);
  border-left-color: #d4ac0d;
  transform: translateX(2px);
}

.proposal-time {
  color: var(--color-text-muted);
  font-family: monospace;
  font-size: 0.7rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.proposal-change {
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.proposal-change::before {
  content: '→';
  color: #f39c12;
  font-weight: 700;
  margin: 0 4px;
}

.proposal-votes-compact {
  color: #27ae60;
  font-weight: 600;
  font-size: 0.7rem;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Loading & Empty States */
.loading-row,
.empty-row,
.error-row {
  background: transparent !important;
}

.loading-cell,
.empty-cell,
.error-cell {
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
}

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.loader--compact {
  font-size: 0.85rem;
  gap: var(--space-xs);
}

.loader::before {
  content: '';
  width: 32px;
  height: 32px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader--compact::before {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

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

.empty-message,
.error-message {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.error-message {
  color: #e74c3c;
}

/* Responsive */
@media (max-width: 1200px) {
  .admin-content--subtitles {
    padding: var(--space-md);
  }
}

@media (max-width: 768px) {
  .subtitles-filters {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .filter-group {
    width: 100%;
  }

  .filter-select,
  .filter-input {
    width: 100%;
  }

  .subtitles-tree-table-container {
    overflow-x: auto;
  }

  .subtitles-tree-table {
    min-width: 600px;
  }

  .proposals-list-ultra-compact {
    flex-direction: column;
    gap: 4px;
  }
}
