@import url('./design-tokens.css');
/**
 * @fileoverview User Repository CSS Styles
 * Central document storage window with glassmorphism design
 */

@import url('./design-tokens.css');

/* =============================================================================
   REPOSITORY WINDOW CONTAINER
   ============================================================================= */

#repository-window {
  position: fixed;
  top: 100px;
  left: calc(50% - 750px);
  width: 1500px !important;
  max-width: 95vw;
  height: 80vh;
  max-height: 90vh;
  display: none;
  flex-direction: column;
  z-index: 1050;
  background: var(--glass-bg-dark);
  backdrop-filter: blur(var(--glass-blur-xl));
  -webkit-backdrop-filter: blur(var(--glass-blur-xl));
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-xl);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 0 60px -20px var(--color-primary-dark);
  overflow: hidden;
}

#repository-window.fullscreen {
  position: fixed;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0;
  z-index: var(--z-dropdown);
}

#repository-window.picker-mode .repo-file-actions {
  opacity: 1 !important;
}

#repository-window.picker-mode {
  z-index: 1200;
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.6),
    0 0 0 2px var(--color-primary),
    0 0 80px -20px var(--color-primary);
}

.repo-picker-cancel-btn {
  margin-left: 12px;
  padding: 4px 12px;
  background: var(--status-error-alpha);
  border: 1px solid var(--status-error);
  color: #ff6b6b;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  pointer-events: auto !important;
  transition: all 0.2s ease;
}

.repo-picker-cancel-btn:hover {
  background: var(--status-error);
  color: white;
}

/* =============================================================================
   UNIFIED HEADER
   ============================================================================= */

#repository-window .unified-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--glass-bg-elevated);
  border-bottom: 1px solid var(--glass-border-light);
  cursor: move;
  flex-shrink: 0;
}

#repository-window .unified-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-heading);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
}

#repository-window .unified-header-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px var(--color-primary-alpha));
}

#repository-window .unified-header-controls {
  display: flex;
  gap: 6px;
}

#repository-window .unified-ctrl-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-light);
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

#repository-window .unified-ctrl-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
  transform: scale(1.05);
}

#repository-window .unified-close-btn:hover {
  background: var(--status-error-alpha);
  color: var(--status-error);
}

/* =============================================================================
   TOOLBAR
   ============================================================================= */

.repo-toolbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 15px 25px;
  background: var(--bg-surface-dim);
  border-bottom: 1px solid var(--glass-border-light);
  flex-shrink: 0;
}

.repo-search-container {
  flex: 0 0 350px;
  position: relative;
}

.repo-search-input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-md);
  background: var(--bg-surface-dark);
  color: var(--text-main);
  font-size: 16px; /* Increased font size */
  transition: all 0.2s ease;
}

.repo-search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 12px var(--color-primary-alpha);
}

.repo-search-input::placeholder {
  color: var(--text-dim);
}

.repo-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  font-size: 18px;
}

.repo-filters {
  display: flex;
  gap: 15px;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}

.repo-filter-select {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-md);
  background: var(--bg-surface-dark); /* Ensure dark background for system design */
  color: var(--text-main);
  font-size: 15px; /* Increased font size */
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.repo-filter-select:hover {
  border-color: var(--color-primary-alpha);
  background: var(--bg-surface-elevated);
}

.repo-filter-select option {
  background: #1a1a2a; /* Force dark background for options */
  color: #fff;
}

.repo-add-btn {
  padding: 8px 20px;
  background: var(--btn-primary-bg, rgba(0, 255, 255, 0.2));
  border: 1px solid var(--btn-primary-border, rgba(0, 255, 255, 0.4));
  border-radius: var(--radius-md);
  color: var(--btn-primary-text, #0ff);
  font-size: 16px; /* Increased font size for + Neu button */
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.repo-add-btn:hover {
  background: var(--btn-primary-hover-bg, rgba(0, 255, 255, 0.3));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--color-primary-alpha);
}

/* Empty state styling */
.repo-empty-state,
.repo-item-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 40px;
  opacity: 0.8; /* Increased opacity from 0.5 */
  color: var(--text-dim);
}

.repo-empty-title,
.repo-item-empty strong {
  font-size: 20px; /* Increased from 1.2em */
  color: var(--text-main);
  margin-bottom: 12px;
  display: block;
}

.repo-empty-subtitle,
.repo-item-empty {
  font-size: 16px; /* Increased from default */
  line-height: 1.6;
}

.repo-empty-icon {
  font-size: 64px;
  margin-bottom: 24px;
  opacity: 0.3;
}

.repo-filter-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-alpha);
}

/* Dropdown Options - Shared Styles */
.repo-filter-select option {
  background-color: var(--bg-elevated) !important;
  color: var(--text-main) !important;
  padding: 10px 12px !important;
}

.repo-filter-select option:checked {
  background: var(--color-primary-gradient) !important;
  color: white !important;
}

.repo-upload-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-primary-gradient);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.repo-upload-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 4px 12px var(--color-primary-alpha);
}

.repo-upload-status {
  font-size: 11px;
  color: var(--status-success);
  margin-left: 4px;
}

/* =============================================================================
   STATS BAR
   ============================================================================= */

.repo-stats-bar {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: 8px 16px;
  background: var(--bg-surface-dim);
  border-bottom: 1px solid var(--glass-border-light);
  font-size: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.repo-stat-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.repo-stat-value {
  font-weight: 600;
  color: var(--color-primary-light);
}

/* =============================================================================
   FILE LIST
   ============================================================================= */

.repo-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}



.repo-content::-webkit-scrollbar-track {
  background: rgba(30, 40, 60, 0.3);
  border-radius: 3px;
}

.repo-content::-webkit-scrollbar-thumb {
  background: rgba(100, 150, 255, 0.3);
  border-radius: 3px;
}

.repo-content::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 150, 255, 0.5);
}

/* Empty State */
.repo-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  padding: 40px;
  color: rgba(180, 190, 220, 0.6);
  text-align: center;
}

.repo-empty-icon {
  font-size: 48px;
  opacity: 0.5;
}

.repo-empty-title {
  font-size: 16px;
  font-weight: 500;
  color: rgba(180, 190, 220, 0.8);
}

.repo-empty-subtitle {
  font-size: 13px;
}

/* File Card */
.repo-file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--glass-bg-elevated, rgba(30, 40, 65, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.08); /* More subtle border */
  border-radius: var(--radius-lg, 12px);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  backdrop-filter: blur(var(--glass-blur-md));
  position: relative;
  overflow: hidden;
}

.repo-file-card:hover {
  background: rgba(45, 60, 95, 0.6);
  border-color: var(--color-primary-alpha, rgba(121, 211, 255, 0.5));
  transform: translateY(-3px) scale(1.01);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.4),
    0 0 20px var(--color-primary-alpha),
    inset 0 0 10px rgba(255, 255, 255, 0.05);
}

.repo-file-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top left, var(--color-primary-alpha), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.repo-file-card:hover::before {
  opacity: 0.2;
}

.repo-file-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px; /* Top indicator line */
  background: transparent;
  transition: background 0.3s ease;
}

.repo-file-card:hover::after {
  background: var(--color-primary, #79d3ff);
}

.repo-file-card.selected {
  border-color: var(--color-primary);
  background: rgba(50, 80, 130, 0.5);
  box-shadow: 0 0 20px var(--color-primary-alpha);
}

.repo-file-icon {
  width: 48px; /* Slightly larger */
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: var(--glass-bg-light);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.repo-file-card:hover .repo-file-icon {
  transform: scale(1.1) rotate(5deg);
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--glass-border-light);
}

.repo-file-info {
  flex: 1;
  min-width: 150px; /* Ensure space for text */
}

.repo-file-name {
  font-size: 17px; /* Scaled up */
  font-weight: 600;
  color: #ffffff !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.repo-file-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(180, 190, 220, 0.6);
}

.repo-file-size {
  color: rgba(100, 180, 255, 0.8);
}

.repo-file-date {
  color: rgba(180, 190, 220, 0.5);
}

.repo-file-summary {
  font-size: 12px;
  color: rgba(180, 190, 220, 0.7);
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.repo-file-tags {
  display: flex;
  gap: var(--spacing-xs);
  margin-top: 6px;
  flex-wrap: wrap;
}

.repo-file-tag {
  padding: 2px 8px;
  background: rgba(100, 180, 255, 0.15);
  border-radius: var(--radius-sm);
  font-size: 10px;
  color: rgba(150, 200, 255, 0.9);
}

.repo-file-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.repo-file-card:hover .repo-file-actions {
  opacity: 1;
}

.repo-file-action-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--glass-bg-light);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.repo-file-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.repo-file-action-btn.delete:hover {
  background: rgba(255, 80, 80, 0.25);
  color: #ff6b6b;
}

/* Picker Mode - Primary "Wählen" Button */
.repo-file-action-btn.primary.pick {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  width: auto; /* Allow button to grow for text */
  min-width: 80px;
  height: 32px;
  animation: repo-btn-pulse 2s infinite;
}

@keyframes repo-btn-pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--color-secondary-rgb), 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(var(--color-secondary-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--color-secondary-rgb), 0); }
}

.repo-file-action-btn.primary.pick:hover {
  background: linear-gradient(135deg, #4da6ff 0%, var(--color-primary) 100%);
  transform: scale(1.05);
}

/* Picker Mode File Card Styling */
.repo-file-card.picker-mode {
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.repo-file-card.picker-mode:hover {
  border-color: var(--color-primary);
  background: rgba(var(--color-secondary-rgb), 0.1);
}

/* Generated badge */
.repo-generated-badge {
  padding: 2px 6px;
  background: linear-gradient(135deg, rgba(160, 100, 255, 0.25) 0%, rgba(100, 150, 255, 0.25) 100%);
  border-radius: var(--radius-sm);
  font-size: 9px;
  color: rgba(180, 150, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =============================================================================
   DROP ZONE
   ============================================================================= */

.repo-dropzone {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 30, 50, 0.95);
  border: 3px dashed rgba(100, 180, 255, 0.5);
  border-radius: var(--radius-xl);
  z-index: 100;
}

.repo-dropzone.active {
  display: flex;
}

.repo-dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
  color: rgba(180, 200, 255, 0.9);
  text-align: center;
}

.repo-dropzone-icon {
  font-size: 56px;
  animation: repo-bounce 1s ease infinite;
}

@keyframes repo-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.repo-dropzone-text {
  font-size: 18px;
  font-weight: 500;
}

.repo-dropzone-hint {
  font-size: 13px;
  color: rgba(150, 170, 200, 0.7);
}

/* =============================================================================
   PREVIEW MODAL
   ============================================================================= */

.repo-preview-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 15, 30, 0.9);
  backdrop-filter: blur(var(--glass-blur-md));
  z-index: var(--z-dropdown);
}

.repo-preview-modal.active {
  display: flex;
}

.repo-preview-container {
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  background: rgba(25, 32, 50, 0.98);
  border: 1px solid rgba(120, 180, 255, 0.2);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.repo-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(40, 50, 80, 0.5);
  border-bottom: 1px solid rgba(120, 180, 255, 0.15);
}

.repo-preview-title {
  font-size: 15px;
  font-weight: 500;
  color: #e8eeff;
}

.repo-preview-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--glass-bg-light);
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.repo-preview-close:hover {
  background: rgba(255, 80, 80, 0.25);
  color: #ff6b6b;
}

.repo-preview-content {
  flex: 1;
  overflow: auto;
  padding: 20px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(200, 210, 230, 0.9);
  white-space: pre-wrap;
  font-family: var(--font-mono, monospace);
}

.repo-preview-content img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.repo-preview-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(40, 50, 80, 0.3);
  border-top: 1px solid rgba(120, 180, 255, 0.1);
}

.repo-preview-btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: rgba(100, 150, 255, 0.2);
  color: #e8eeff;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.repo-preview-btn:hover {
  background: rgba(100, 150, 255, 0.35);
}

.repo-preview-btn.primary {
  background: linear-gradient(135deg, rgba(100, 180, 255, 0.35) 0%, rgba(60, 120, 200, 0.45) 100%);
}

/* =============================================================================
   LOADING STATE
   ============================================================================= */

.repo-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: rgba(150, 170, 200, 0.7);
}

.repo-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(100, 150, 255, 0.2);
  border-top-color: rgba(100, 150, 255, 0.8);
  border-radius: 50%;
  animation: repo-spin 0.8s linear infinite;
}

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

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 700px) {
  #repository-window {
    width: 100%;
    max-width: none;
    right: 0;
    left: 0;
    border-radius: 0;
    top: 60px;
    height: calc(100vh - 60px);
  }

  .repo-toolbar {
    padding: 10px 12px;
    gap: var(--spacing-sm);
  }

  .repo-search-box {
    min-width: 150px;
  }

  .repo-file-card {
    padding: 10px 12px;
  }

  .repo-file-actions {
    opacity: 1;
  }
}

/* =============================================================================
   VIEW TOGGLE (List/Grid)
   ============================================================================= */

.repo-view-toggle {
  display: flex;
  gap: 2px;
  background: rgba(30, 40, 60, 0.5);
  border-radius: var(--radius-md);
  padding: 2px;
  flex-shrink: 0;
}

.repo-view-btn {
  width: 32px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: rgba(180, 190, 220, 0.6);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.repo-view-btn:hover {
  color: rgba(200, 210, 230, 0.9);
  background: rgba(100, 150, 255, 0.1);
}

.repo-view-btn.active {
  color: #fff;
  background: rgba(100, 150, 255, 0.3);
}

/* =============================================================================
   GRID VIEW
   ============================================================================= */

.repo-file-list.repo-view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  padding: 25px;
}

.repo-file-list.repo-view-grid .repo-file-card {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 15px;
  min-height: 200px;
  max-width: none;
}

.repo-file-list.repo-view-grid .repo-file-icon {
  width: 64px;
  height: 64px;
  font-size: 32px;
  margin-bottom: 12px;
}

.repo-file-list.repo-view-grid .repo-file-info {
  width: 100%;
  min-width: 0;
}

.repo-file-list.repo-view-grid .repo-file-name {
  font-size: 15px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  height: 2.4em;
  margin-bottom: 8px;
}

.repo-file-list.repo-view-grid .repo-file-meta {
  font-size: 12px;
  justify-content: center;
}

.repo-view-grid .repo-file-summary {
  display: none;
}

.repo-view-grid .repo-file-actions {
  justify-content: center;
  margin-top: 8px;
  opacity: 1;
}

.repo-view-grid .repo-file-action-btn {
  width: 28px;
  height: 28px;
  font-size: 14px;
}

/* =============================================================================
   STORAGE BAR
   ============================================================================= */

.repo-storage-bar {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-left: auto;
  padding-left: 16px;
}

.repo-storage-label {
  font-size: 11px;
  color: rgba(150, 170, 200, 0.8);
  white-space: nowrap;
}

.repo-storage-track {
  width: 100px;
  height: 6px;
  background: rgba(40, 50, 70, 0.8);
  border-radius: 3px;
  overflow: hidden;
}

.repo-storage-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(100, 180, 255, 0.8), rgba(80, 150, 220, 0.9));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.repo-storage-fill.warning {
  background: linear-gradient(90deg, rgba(255, 180, 100, 0.8), rgba(255, 150, 80, 0.9));
}

.repo-storage-fill.critical {
  background: linear-gradient(90deg, rgba(255, 100, 100, 0.8), rgba(255, 80, 80, 0.9));
}

.repo-storage-text {
  font-size: 10px;
  color: rgba(150, 170, 200, 0.7);
  white-space: nowrap;
  min-width: 80px;
}

/* =============================================================================
   FAVORITES & TAGS
   ============================================================================= */

.repo-file-action-btn.favorite {
  color: rgba(180, 180, 180, 0.5);
  transition: all 0.2s ease;
}

.repo-file-action-btn.favorite:hover {
  color: rgba(255, 200, 100, 0.8);
}

.repo-file-action-btn.favorite.active {
  color: #ffc107;
  text-shadow: 0 0 8px rgba(255, 193, 7, 0.5);
}

.repo-file-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-top: 6px;
}

.repo-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: rgba(100, 150, 255, 0.15);
  border: 1px solid rgba(100, 150, 255, 0.2);
  border-radius: var(--radius-lg);
  font-size: 10px;
  color: rgba(180, 200, 255, 0.9);
}

.repo-view-grid .repo-file-tags {
  display: none;
}

/* =============================================================================
   ENHANCED PREVIEW MODAL
   ============================================================================= */

.repo-preview-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 25, 0.95);
  backdrop-filter: blur(var(--glass-blur-md));
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.repo-preview-container {
  width: 100%;
  max-width: 90%;
  max-height: 90%;
  background: rgba(25, 30, 45, 0.98);
  border: 1px solid rgba(100, 150, 255, 0.2);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.repo-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(40, 50, 80, 0.4);
  border-bottom: 1px solid rgba(100, 150, 255, 0.15);
}

.repo-preview-title {
  font-size: 14px;
  font-weight: 600;
  color: #e8eeff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.repo-preview-actions {
  display: flex;
  gap: var(--spacing-sm);
}

.repo-preview-action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-md);
  background: rgba(100, 150, 255, 0.15);
  color: rgba(200, 210, 230, 0.9);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.repo-preview-action-btn:hover {
  background: rgba(100, 150, 255, 0.3);
  color: #fff;
}

.repo-preview-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.repo-preview-loading {
  color: rgba(150, 170, 200, 0.7);
  font-size: 14px;
}

.repo-preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.repo-preview-pdf {
  width: 100%;
  height: 100%;
  min-height: 500px;
  border: none;
  border-radius: var(--radius-md);
  background: #fff;
}

.repo-preview-text {
  width: 100%;
  max-height: 100%;
  overflow: auto;
  padding: 16px;
  background: rgba(20, 25, 35, 0.8);
  border-radius: var(--radius-md);
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  line-height: 1.5;
  color: rgba(200, 210, 230, 0.9);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.repo-preview-audio-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px;
}

.repo-preview-audio-icon {
  font-size: 64px;
  opacity: 0.6;
}

.repo-preview-audio {
  width: 100%;
  max-width: 400px;
}

.repo-preview-unsupported {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
  padding: 40px;
  color: rgba(150, 170, 200, 0.7);
}

.repo-preview-unsupported-icon {
  font-size: 48px;
  opacity: 0.5;
}

.repo-preview-unsupported-text {
  font-size: 14px;
}

.repo-preview-unsupported-hint {
  font-size: 12px;
  opacity: 0.6;
}

.repo-preview-error {
  color: rgba(255, 100, 100, 0.8);
  font-size: 14px;
}

/* =============================================================================
   RELATED FILES
   ============================================================================= */

.repo-related-list {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.repo-related-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 14px;
  background: rgba(40, 50, 75, 0.5);
  border: 1px solid rgba(100, 150, 255, 0.15);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.repo-related-item:hover {
  background: rgba(50, 65, 95, 0.6);
  border-color: rgba(100, 150, 255, 0.3);
  transform: translateX(4px);
}

.repo-related-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(100, 150, 255, 0.1);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.repo-related-info {
  flex: 1;
  min-width: 0;
}

.repo-related-name {
  font-size: 13px;
  font-weight: 500;
  color: #e8eeff;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.repo-related-meta {
  font-size: 11px;
  color: rgba(150, 170, 200, 0.7);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.repo-related-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 600;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
}

.repo-related-badge.ai {
  background: linear-gradient(135deg, rgba(130, 100, 255, 0.4), rgba(180, 100, 255, 0.3));
  color: rgba(200, 180, 255, 0.95);
}

.repo-related-shared {
  color: rgba(100, 180, 150, 0.9);
}

/* =============================================================================
   DRAG & DROP EXPORT
   ============================================================================= */

.repo-file-card[draggable="true"] {
  cursor: grab;
}

.repo-file-card[draggable="true"]:active {
  cursor: grabbing;
}

.repo-file-card.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

/* Drop target indicator for other windows */
[data-accepts-repo-files] {
  transition: all 0.2s ease;
}

[data-accepts-repo-files].repo-drop-target {
  outline: 2px dashed rgba(100, 180, 255, 0.6);
  outline-offset: 4px;
  background: rgba(100, 180, 255, 0.05);
}

/* =============================================================================
   FEATURE CONTEXT STYLES
   ============================================================================= */

.repo-file-contexts {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.repo-context-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-light);
  border: 1px solid var(--glass-border-light);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.repo-context-badge:hover {
  background: var(--color-primary-alpha);
  border-color: var(--color-primary);
  transform: scale(1.1);
}

/* Context Menu */
.repo-context-menu {
  position: fixed;
  z-index: var(--z-dropdown);
  min-width: 280px;
  background: var(--glass-bg-dark);
  backdrop-filter: blur(var(--glass-blur-lg));
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  padding: 8px 0;
  animation: fadeIn 0.15s ease;
}

.repo-context-menu-header {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-heading);
  border-bottom: 1px solid var(--glass-border-light);
  margin-bottom: 4px;
}

.repo-context-menu-item {
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.repo-context-menu-item:hover {
  background: var(--bg-surface-hover);
}

.repo-context-icon {
  font-size: 16px;
  margin-bottom: 2px;
}

.repo-context-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

.repo-context-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.repo-context-menu-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
}

.repo-context-menu-close:hover {
  background: var(--status-error-alpha);
  color: var(--status-error);
}

/* Context Details Modal */
.repo-context-details {
  padding: 16px;
}

.repo-context-meta {
  display: flex;
  gap: var(--spacing-md);
  padding: 8px 12px;
  background: var(--bg-surface-dim);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.repo-context-json {
  background: var(--bg-surface-dark);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 12px;
  font-family: var(--font-mono, monospace);
  color: var(--text-main);
  overflow-x: auto;
  max-height: 400px;
  white-space: pre-wrap;
}

/* Sidebar Styles - Quick Win */
.repo-sidebar {
  width: 260px;
  background: rgba(0, 0, 0, 0.15);
  padding: 24px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.repo-side-section {
  margin-bottom: 30px;
}

.repo-side-section h4 {
  padding: 0 24px;
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--color-primary, #79d3ff);
  opacity: 0.6;
  margin-bottom: 16px;
}

.repo-side-item {
  margin: 4px 12px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 17px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-dim, rgba(255,255,255,0.7));
  border: 1px solid transparent;
  font-weight: 500;
}

.repo-side-item:hover {
  background: var(--glass-bg-light);
  color: var(--text-main, #fff);
  transform: translateX(5px);
}

.repo-side-item.active {
  background: linear-gradient(90deg, rgba(var(--color-secondary-rgb), 0.2), rgba(var(--color-secondary-rgb), 0.05));
  color: #fff;
  font-weight: 600;
  border-left: 4px solid var(--color-primary, #79d3ff);
  background-color: rgba(255, 255, 255, 0.03);
}

.repo-side-item span {
  font-size: 1.3em;
}

/* Badge colors - Quick Win */
.repo-generated-badge {
  padding: 2px 8px;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #d8b4fe;
  border-radius: var(--radius-sm);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
}

/* FOOTER & VIEW TOGGLES */
.repo-footer-bar {
    padding: 15px 25px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(var(--glass-blur-md));
}

#repo-stats-bar {
    display: flex;
    gap: 30px;
    font-size: 16px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
}

.view-toggle {
    background: var(--glass-bg-light);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.5em;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.view-toggle.active {
    background: var(--color-primary);
    color: black;
    border-color: var(--color-primary);
    box-shadow: 0 0 15px var(--color-primary-glow);
}

/* REPO LAYOUT & MAIN AREA */
.repo-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.repo-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(0,0,0,0.15);
}

.repo-file-list {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    align-content: start;
}

/* SIDEBAR UL & FILTER GROUPS */
.repo-side-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.repo-side-filters {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.repo-side-filters label {
    display: block;
    font-size: 14px;
    opacity: 0.6;
    margin-bottom: 8px;
    font-weight: 500;
}

.repo-side-filters select {
    width: 100%;
}

.repository-content {
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}











