:root {
  --bg-dark: #1e1e1e;
  --bg-panel: #252526;
  --border: #3c3c3c;
  --text-main: #cccccc;
  --text-muted: #858585;
  --accent: #0e639c;
  --accent-hover: #1177bb;
  --accent-fg: #ffffff;
  --list-hover: #2a2d2e;
  --input-bg: #3c3c3c;
  --input-fg: #cccccc;
  --input-border: #3c3c3c;
  --tree-guide: #404040;
  --danger: #d9534f;
  --success: #5cb85c;
  --warning: #f0ad4e;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  padding: 0;
  margin: 0;
  font-family: var(--font-family);
  background-color: var(--bg-panel);
  color: var(--text-main);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

#app {
  width: 100%;
  height: 100%;
}

.view { display: none; }
.view.active { display: flex; }

/* --- View 1: Upload Hero --- */
#upload-view {
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.hero-container {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.hero-container h1 { 
    text-align: center; 
    color: var(--text-main); 
    margin: 0; 
    font-size: 2rem; 
}

/* --- View 2: Workspace Layout --- */
#workspace-view {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  #workspace-view.active {
      display: grid;
      grid-template-columns: 350px 1fr;
      gap: 20px;
      padding: 20px;
      height: 100vh;
      overflow: hidden; 
  }
  
  .left-panel {
      display: flex;
      flex-direction: column;
      gap: 15px;
      overflow-y: auto; 
      padding-right: 5px;
  }
  
  .right-panel {
      display: flex;
      flex-direction: column;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: var(--bg-dark);
      overflow: hidden; 
  }
}

@media (max-width: 767px) {
  #workspace-view.active {
      display: flex;
      flex-direction: column;
      padding: 15px;
      gap: 15px;
      max-width: 550px;
      margin: 0 auto; 
      height: 100vh;
      overflow-y: auto;
  }
  
  .left-panel {
      display: flex;
      flex-direction: column;
      gap: 15px;
      flex-shrink: 0;
  }

  .right-panel {
      display: flex;
      flex-direction: column;
      height: 500px; 
      border: 1px solid var(--border);
      border-radius: 6px;
      background: var(--bg-dark);
      flex-shrink: 0;
      margin-bottom: 20px;
  }
}

/* --- Components --- */
.header-row {
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.header-row h2 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-main);
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    background: var(--bg-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drop-zone.compact {
    padding: 15px;
    margin-bottom: 0;
}

.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(14, 99, 156, 0.1);
}

.drop-zone:hover { border-color: var(--text-muted); }

.hidden { display: none !important; }

.export-settings-group {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.export-settings-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
}

.export-system-prompt {
    width: 100%;
    box-sizing: border-box;
    height: 60px;
    resize: none;
    background: var(--input-bg);
    color: var(--input-fg);
    border: 1px solid var(--input-border);
    padding: 8px;
    border-radius: 2px;
    font-family: var(--font-family);
    font-size: 0.85rem;
}

.export-system-prompt:focus, .custom-ignore-input:focus {
    border-color: var(--accent);
    outline: none;
}

.export-mode-select, .custom-ignore-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--input-bg);
    color: var(--input-fg);
    border: 1px solid var(--input-border);
    padding: 6px;
    border-radius: 2px;
    font-family: var(--font-family);
    font-size: 0.85rem;
    outline: none;
}

/* Ignored Files Component */
.ignored-info-container {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ignored-header {
    padding: 8px 10px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ignored-list {
    max-height: 120px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    list-style: none;
    padding: 5px 10px;
    margin: 0;
}

.ignored-list li {
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-header {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label { font-weight: 600; font-size: 0.9rem; }
.stat-value { 
    color: var(--text-main); 
    font-weight: bold; 
    font-family: monospace; 
    font-size: 1rem; 
}

.tree-header {
  padding: 10px 15px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.file-tree {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
}

ul.tree-list { list-style: none; padding-left: 0; margin: 0; }
ul.tree-list ul {
    padding-left: 12px;
    margin-left: 10px;
    border-left: 1px solid var(--tree-guide);
}

.tree-item-row {
    display: flex;
    align-items: center;
    padding: 3px 6px;
    font-size: 0.85rem;
    color: var(--text-main);
}

.spacer { width: 20px; display: inline-block; flex-shrink: 0;}
.label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: 6px;}

.badge {
    background: var(--accent);
    color: var(--accent-fg);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: bold;
}
.badge.warning { background: var(--danger); }

.mini-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.mini-btn:hover { background: var(--list-hover); color: var(--text-main); border-color: var(--text-main); }
.mini-btn.icon-only { padding: 2px 6px; border: none; }
.mini-btn.icon-only:hover { border: none; background: transparent; transform: scale(1.1); }

.actions { display: flex; gap: 8px; flex-shrink: 0; }

button.primary {
  cursor: pointer;
  border: none;
  padding: 10px 12px;
  border-radius: 4px;
  font-weight: 600;
  flex: 1;
  background-color: var(--accent); 
  color: var(--accent-fg);
  transition: background-color 0.2s;
}

button.primary:hover { background-color: var(--accent-hover); }
button.primary:disabled { opacity: 0.5; cursor: not-allowed; }

.empty-state { padding: 20px; text-align: center; color: var(--text-muted); font-style: italic; font-size: 0.9rem; }