:root {
  --primary-color: #4a86e8;
  --secondary-color: #f1f1f1;
  --border-color: #ddd;
  --hover-color: #e6f2ff;
  --active-color: #337ab7;
  --text-color: #333;
  --filename-font: 'Cascadia Mono', 'Segoe UI Mono', 'Fira Code', 'Menlo', 'Consolas', 'Liberation Mono', monospace;
  font-family: Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 20px;
  background-color: #f8f8f8;
  color: var(--text-color);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.message-box {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  border-width: 0;
  padding: 0;
}

.message-box form {
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.message-box form .buttons {
  align-self: flex-end;
}

::backdrop {
  background-color: rgba(0, 0, 0, 0.4);  
  backdrop-filter: grayscale(0.7);
}

.header {
  background-color: var(--primary-color);
  color: white;
  padding: 20px;
  text-align: center;
}

.header h1 {
  margin: 0;
  font-size: 24px;
}

/* Main tabs styling */
.tabs {
  display: flex;
  background-color: var(--secondary-color);
  border-bottom: 1px solid var(--border-color);
  padding: 5px 0 0 5px;
}

.tab {
  padding: 15px 20px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-weight: bold;
}

.tab:hover {
  background-color: var(--hover-color);
}

.tab.active {
  background-color: white;
  border-bottom: 3px solid var(--primary-color);
}

/* Tab content */
.tab-content {
  display: none;
  padding: 20px;
}

.tab-content.active {
  display: block;
}

/* Section styling */
.section {
  margin-bottom: 25px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.section-header {
  background-color: var(--secondary-color);
  padding: 12px 15px;
  font-weight: bold;
  border-bottom: 1px solid var(--border-color);
}

.section-content {
  padding: 15px;
}

/* Inner tabs */
.inner-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background-color: #f8f8f8;
  padding: 3px 0 0 5px;
}

.inner-tab {
  padding: 10px 15px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 14px;
}

.inner-tab:hover {
  background-color: var(--hover-color);
}

.inner-tab.active {
  background-color: white;
  border-bottom: 2px solid var(--primary-color);
}

.inner-tab-content {
  display: none;
  padding: 15px;
}

.inner-tab-content.active {
  display: block;
}

/* File dropzone */
.dropzone {
  border: 2px dashed #ccc;
  border-radius: 6px;
  padding: 30px;
  text-align: center;
  background-color: #fafafa;
  transition: border-color 0.3s, background-color 0.3s;
}

.dropzone.drop-hovering {
  border-color: var(--primary-color);
  background-color: var(--hover-color);
}

.dropzone p {
  margin: 0;
  color: #666;
}

.dropzone .icon {
  font-size: 40px;
  color: #aaa;
  margin-bottom: 10px;
}

/* File browser button */
button, .file-browser-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 15px;
  transition: background-color 0.3s;
}

button, .file-browser-btn:hover {
  background-color: var(--active-color);
}

/* File list styling */
.file-list {
  margin-top: 15px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  max-height: 300px;
  overflow-y: auto;
}

.select-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
}

.select-list li {
  padding: 10px 15px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.2s;
  border-radius: 3px;
  box-shadow: -2px -3px 6px inset var(--border-color);
  font-family: var(--filename-font);
  font-size: small;
}

.select-list li:hover {
  background-color: var(--hover-color);
}

.select-list li:last-child {
  border-bottom: none;
}

.select-list li.selected {
  background-color: var(--hover-color);
  font-weight: bold;
}

/* Tree view styling */
.tree-view {
  margin-top: 15px;
  font-family: var(--filename-font);
  font-size: small;
}

.tree-item {
  transition: background-color 0.2s;
}

.tree-item:hover {
  background-color: var(--hover-color);
}

.tree-toggle {
  margin-right: 5px;
  width: 20px;
  text-align: center;
}

.tree-children {
  margin-left: 1em;
  display: none;
}

.tree-children.expanded {
  display: block;
}

.tree-item .icon {
  margin-right: 8px;
  font-size: 14px;
}

.tree-item.folder > .title::before {
  content: "📁";
}

.tree-item.file > .title::before {
  content: "📄";
}

.tree-item.archive > .title::before {
  content: "🗃️";
}

/* For side by side file trees in Create Patch */
.side-by-side {
  display: flex;
  gap: 20px;
}

.side-by-side > div {
  flex: 1;
}

.patch-section:not(.patch-selected) .selected-patch, .patch-section.patch-selected .patch-selection {
  display: none;
}

.patch-filename {
  font-family: var(--filename-font);
  font-weight: bold;
}

.loading {
  opacity: 0.5;
  cursor: wait;
}
