:root {
  --bg-primary: #1e1e1e;
  --bg-secondary: #252526;
  --bg-tertiary: #333333;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #888888;
  --accent-primary: #0078d4;
  --accent-secondary: #005a9e;
  --border-color: #444444;
  --error-color: #f44336;
  --success-color: #4caf50;
  --warning-color: #ff9800;
  --info-color: #2196f3;
  --shadow-color: rgba(0, 0, 0, 0.5);
  --hover-bg: rgba(255, 255, 255, 0.05);
  --selected-bg: rgba(0, 120, 212, 0.15);
  --selected-border: rgba(0, 120, 212, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
}

.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 10;
}

.screen.active {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease-out;
}

#login-screen {
  justify-content: center;
  align-items: center;
  background-color: var(--bg-primary);
}

.login-container {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 12px var(--shadow-color);
}

.login-container h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--accent-primary);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  background-color: var(--accent-primary);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  background-color: var(--accent-secondary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  background-color: var(--text-muted);
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.btn:disabled:hover {
  background-color: var(--text-muted);
  transform: none;
}

.btn-block {
  display: block;
  width: 100%;
}

#file-manager-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.header {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #2a2a2b 100%);
  border-bottom: 1px solid var(--border-color);
  height: 70px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-right: 1.5rem;
  text-decoration: none;
  background: linear-gradient(45deg, var(--accent-primary), #00a2ed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.path-container {
  flex: 1;
  display: flex;
  align-items: center;
  background-color: var(--bg-tertiary);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  margin: 0 1.5rem;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  gap: 0.10rem;
}

.copy-path-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
}

.copy-path-btn:hover {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transform: scale(1.05);
}

.copy-path-btn.copied {
  color: var(--success-color);
}

.copy-path-btn.copied:hover {
  background-color: rgba(76, 175, 80, 0.1);
  color: var(--success-color);
}

.copy-path-btn i {
  transition: all 0.2s ease;
}

.copy-path-btn.copied i.fa-copy {
  display: none;
}

.copy-path-btn.copied i.fa-check {
  display: block !important;
}

.copy-path-btn:not(.copied) i.fa-check {
  display: none;
}

.path-container:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.static-path-text {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.path-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  padding: 0.25rem;
  outline: none;
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
}

.action-buttons .btn {
  padding: 0.75rem;
  min-width: 44px;
  border-radius: 8px;
}

.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-primary);
}

.file-list {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  max-height: calc(100vh - 140px);
}

.file-list::-webkit-scrollbar {
  width: 8px;
}

.file-list::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

.file-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.file-list-header {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 120px 200px 90px;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #2a2a2b 100%);
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.file-item {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 120px 200px 90px;
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border-left: 3px solid transparent;
  background: var(--bg-primary);
}

.file-item:hover {
  background: var(--hover-bg);
  border-left-color: rgba(0, 120, 212, 0.3);
  transform: translateX(2px);
}

.file-item.selected {
  background: var(--selected-bg) !important;
  border-left-color: var(--accent-primary) !important;
  box-shadow: inset 0 0 0 1px var(--selected-border);
}

.file-item.selected:hover {
  background: rgba(0, 120, 212, 0.25) !important;
}

.file-name {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

.file-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}

.file-item:hover .file-icon {
  transform: scale(1.1);
}

.file-icon i {
  transition: color 0.2s ease;
}

.file-icon .fa-folder {
  color: #ffd700;
}

.file-icon .fa-file-code {
  color: #61dafb;
}

.file-icon .fa-file-image {
  color: #ff6b6b;
}

.file-icon .fa-file-archive {
  color: var(--warning-color);
}

.file-icon .fa-file-pdf {
  color: #ff4757;
}

.file-size {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

.file-modified {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

.file-actions {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: none;
  width: 100%;
  padding: 0 0.5rem;
  box-sizing: border-box;
  min-width: 90px;
}

.file-item:hover .file-actions {
  opacity: 1;
}

.file-action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-action-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  transform: scale(1.1);
}

.toolbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #2a2a2b 100%);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.12);
  z-index: 1200;
}

.toolbar .btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  border-radius: 8px;
}

.context-menu {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 100;
  min-width: 180px;
  max-height: 80vh;
  overflow-y: auto;
  animation: contextMenuSlide 0.2s ease-out;
  backdrop-filter: blur(10px);
}

.dropdown-btn {
  transition: transform 0.2s ease-out !important;
}

.dropdown-btn:hover {
  transform: scale(1.1) !important;
}

@keyframes contextMenuSlide {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.context-menu-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.context-menu-item:hover {
  background: var(--accent-primary);
  color: white;
}

.context-menu-item i {
  width: 16px;
  text-align: center;
}

.context-menu-separator {
  height: 1px;
  background-color: var(--border-color);
  margin: 0.5rem 0;
}

.context-menu-header {
  padding: 0.75rem 1rem;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

#editor-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #2a2a2b 100%);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.editor-title {
  font-size: 1.2rem;
  color: var(--text-primary);
  font-weight: 600;
}

.editor-actions {
  display: flex;
  gap: 0.75rem;
}

.editor-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

#monaco-editor {
  width: 100%;
  height: 100%;
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
  backdrop-filter: blur(5px);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-primary);
  animation: spin 1s ease-in-out infinite;
}

.upload-status .spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top: 3px solid var(--accent-primary);
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  animation: spin 1s linear infinite;
  margin-right: 6px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  color: white;
  width: 320px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: toastSlide 0.3s ease-out;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes toastSlide {
  from {
    transform: translateX(100%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

.toast.success {
  background: linear-gradient(135deg, var(--success-color), #45a049);
}

.toast.error {
  background: linear-gradient(135deg, var(--error-color), #d32f2f);
}

.toast.info {
  background: linear-gradient(135deg, var(--info-color), #1976d2);
}

.toast.warning {
  background: linear-gradient(135deg, var(--warning-color), #f57c00);
}

.toast-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.toast-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.drag-drop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 120, 212, 0.1), rgba(0, 162, 237, 0.1));
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 50;
  pointer-events: none;
  animation: fadeIn 0.3s ease-out;
  backdrop-filter: blur(5px);
}

.drag-drop-overlay.active {
  display: flex;
}

.drag-drop-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 3rem;
  text-align: center;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.3);
  border: 2px dashed var(--accent-primary);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.drag-drop-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  color: var(--accent-primary);
  animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.drag-drop-info {
  display: none;
}

.folder-loading, .file-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.editor-header-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.2s;
}

.editor-header-close:hover {
  color: var(--text-primary);
}

#upload-screen {
  background-color: var(--bg-primary);
  padding: 2rem;
}

.upload-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #2a2a2b 100%);
  border-bottom: 1px solid var(--border-color);
  border-radius: 8px;
}

.upload-header h2 {
  margin: 0;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.upload-path {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.close-btn {
  padding: 0.75rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
}

.close-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

.upload-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  height: calc(100vh - 200px);
}

.upload-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  transition: all 0.3s ease;
  background: var(--bg-secondary);
}

.upload-dropzone.drag-over {
  border-color: var(--accent-primary);
  background: rgba(0, 120, 212, 0.1);
  transform: scale(1.02);
}

.upload-dropzone i {
  font-size: 4rem;
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
}

.upload-dropzone p {
  margin: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.upload-list {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.upload-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.upload-list-header h3 {
  font-weight: 600;
}

.upload-items {
  flex: 1;
  overflow-y: auto;
}

.upload-item {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.upload-item:hover {
  border-color: var(--border-color);
  transform: translateY(-1px);
}

.upload-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.upload-item-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 1rem;
}

.upload-item-status {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.upload-progress {
  height: 6px;
  background-color: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
  margin: 0.75rem 0;
}

.upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 0.3s ease;
  border-radius: 3px;
}

.upload-item-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}

.upload-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.upload-status.success { color: var(--success-color); }
.upload-status.error { color: var(--error-color); }
.upload-status.cancelled { color: var(--warning-color); }

.file-list-loading {
  display: none;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(30, 30, 30, 0.9);
  z-index: 5;
  backdrop-filter: blur(5px);
}

.file-list-loading.active {
  display: flex;
}

.file-list-loading .spinner {
  width: 40px;
  height: 40px;
  margin: 10px;
}

.action-loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.3);
  z-index: 1101;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-width: 250px;
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
}

.action-loading.active {
  display: flex;
}

.action-loading .spinner {
  width: 40px;
  height: 40px;
}

.action-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.action-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.action-text {
  font-weight: 500;
  color: var(--text-secondary);
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(5px);
}

.modal-overlay.show {
  opacity: 1;
}

.modal {
  background: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  transform: translateY(-20px) scale(0.95);
  opacity: 0;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.modal.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-content {
  padding: 2rem;
}

.modal-content h3 {
  margin: 0 0 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.modal-content p {
  margin: 0 0 1.5rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: border-color 0.2s ease;
}

.modal-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.custom-prompt-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,0.8);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	backdrop-filter: blur(5px);
}

.custom-prompt-modal {
	background: var(--bg-secondary);
	padding: 2rem;
	border-radius: 12px;
	box-shadow: 0 16px 64px rgba(0,0,0,0.3);
	color: var(--text-primary);
	max-width: 90%;
	width: 400px;
	border: 1px solid var(--border-color);
}

.custom-prompt-modal h2 {
	margin-top: 0;
	font-size: 1.3rem;
	font-weight: 600;
	margin-bottom: 1.5rem;
}

.custom-prompt-input {
	width: 100%;
	padding: 0.75rem 1rem;
	margin: 1rem 0;
	background: var(--bg-tertiary);
	border: 1px solid var(--border-color);
	color: var(--text-primary);
	border-radius: 8px;
	font-size: 1rem;
	transition: border-color 0.2s ease;
}

.custom-prompt-input:focus {
	outline: none;
	border-color: var(--accent-primary);
}

.custom-prompt-buttons {
	text-align: right;
	margin-top: 1.5rem;
	display: flex;
	gap: 1rem;
	justify-content: flex-end;
}

.custom-prompt-buttons button {
	background: var(--bg-tertiary);
	border: 1px solid var(--border-color);
	padding: 0.75rem 1.5rem;
	color: var(--text-primary);
	cursor: pointer;
	border-radius: 8px;
	font-weight: 500;
	transition: all 0.2s ease;
}

.custom-prompt-buttons button:hover {
	background: var(--text-muted);
	transform: translateY(-1px);
}

.custom-prompt-ok {
	background: var(--accent-primary) !important;
	color: white !important;
	border-color: var(--accent-primary) !important;
}

.custom-prompt-ok:hover {
	background: var(--accent-secondary) !important;
}

.selection-indicator {
  position: fixed;
  bottom: 100px;
  left: 20px;
  background: var(--bg-secondary);
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  font-size: 0.9rem;
  color: var(--text-secondary);
  z-index: 50;
  display: none;
  animation: slideUp 0.3s ease-out;
  backdrop-filter: blur(10px);
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.selection-indicator.show {
  display: block;
}

.selection-indicator.fade-out {
  opacity: 0;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.file-item {
  animation: fileItemFadeIn 0.3s ease-out;
}

@keyframes fileItemFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .file-list-header,
  .file-item {
    grid-template-columns: 1fr 100px 140px 100px;
    padding: 0.75rem 1rem;
  }
  
  .toolbar {
    flex-wrap: wrap;
    justify-content: center;
    padding: 1rem;
  }
  
  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  .header {
    flex-wrap: wrap;
    height: auto;
    padding: 1rem;
  }
  
  .logo {
    width: 100%;
    text-align: center;
    margin-bottom: 1rem;
  }
  
  .path-container {
    margin: 0.75rem 0;
  }
  
  .upload-container {
    grid-template-columns: 1fr;
  }
  
  .upload-dropzone {
    height: 300px;
  }
  
  .file-action-btn {
    padding: 0.75rem;
    min-width: 44px;
    height: 44px;
  }
  
  .file-item {
    padding: 1rem;
  }
  
  .btn {
    min-height: 44px;
  }
  
  .context-menu {
    min-width: 200px;
  }
  
  .context-menu-item {
    padding: 1rem;
    font-size: 1rem;
  }
  
  .selection-indicator {
    bottom: 90px;
    left: 10px;
    right: 10px;
    text-align: center;
  }
}

@media (max-width: 576px) {
  .file-list-header,
  .file-item {
    grid-template-columns: 1fr 80px;
  }
  
  .file-modified,
  .file-size {
    display: none;
  }
  
  .toast {
    width: calc(100% - 40px);
    right: 20px;
  }
  
  .editor-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .editor-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

.token-expiry {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: var(--bg-secondary);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--warning-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 100;
  display: none;
  min-width: 360px;
  padding-right: 3rem;
  position: fixed;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
}

.token-expiry.show {
  display: block;
  animation: slideUp 0.3s ease-out;
}

.token-expiry-close {
  background: var(--warning-color);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 0.5rem;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  line-height: 1;
  transition: all 0.2s ease;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.token-expiry-close:hover {
  background: #e65100;
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.token-expiry p {
  margin-right: 3rem;
  line-height: 1.5;
}

.page-transition {
  animation: fadeIn 0.3s ease-out;
}

.progress-modal .modal-content {
  min-width: 450px;
  max-width: 550px;
}

.progress-container {
  margin: 1.5rem 0;
}

.progress-bar {
  width: 100%;
  height: 24px;
  background-color: var(--bg-tertiary);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-color);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 0.3s ease;
  border-radius: 12px;
}

.progress-text {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.current-file {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  min-height: 1.2rem;
}

.folder-content-warning {
  background: linear-gradient(135deg, var(--warning-color), #f57c00);
  color: #000;
  padding: 1.25rem;
  border-radius: 8px;
  margin: 1rem 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.folder-content-list {
  max-height: 200px;
  overflow-y: auto;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
  margin: 0.75rem 0;
}

.folder-content-item {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.folder-content-item i {
  width: 16px;
  text-align: center;
}

.compress-modal {
  width: 450px;
  max-width: 90vw;
}

.compress-info {
  margin: 1rem 0;
  padding: 1.25rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border-left: 3px solid var(--accent-primary);
}

.compress-info p {
  margin: 0 0 0.75rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.file-list-preview {
  max-height: 140px;
  overflow-y: auto;
}

.file-preview-item {
  padding: 0.25rem 0;
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-preview-item:before {
  content: "📄";
  font-size: 0.8rem;
}

.file-preview-more {
  padding: 0.25rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.name-preview {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.name-preview span {
  color: var(--accent-primary);
  font-weight: 600;
}

.name-rules {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.custom-prompt-input:invalid,
.custom-prompt-input[style*="border-color: var(--error-color)"] {
  border-color: var(--error-color) !important;
  box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.2);
}

.custom-prompt-ok:disabled {
  background-color: var(--text-muted) !important;
  color: var(--text-secondary) !important;
  cursor: not-allowed !important;
  opacity: 0.5 !important;
}

.custom-prompt-ok:disabled:hover {
  background-color: var(--text-muted) !important;
  transform: none !important;
}

.compress-modal .custom-prompt-buttons {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.compress-modal .custom-prompt-ok {
  background-color: var(--accent-primary);
  transition: all 0.2s ease;
}

.compress-modal .custom-prompt-ok:hover:not(:disabled) {
  background-color: var(--accent-secondary);
  transform: translateY(-1px);
}

.compress-modal .custom-prompt-cancel {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
}

.compress-modal .custom-prompt-cancel:hover {
  background-color: var(--text-muted);
}

@media (max-width: 768px) {
  .compress-modal {
    width: 95vw;
    margin: 10px;
  }
  
  .file-list-preview {
    max-height: 100px;
  }
  
  .custom-prompt-buttons {
    flex-direction: column;
  }
  
  .custom-prompt-buttons button {
    width: 100%;
    margin: 0.5rem 0;
    padding: 1rem;
  }
}

.compress-loading {
  position: relative;
}

.compress-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

@keyframes compressSuccess {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.compress-success {
  animation: compressSuccess 0.5s ease-in-out;
}

#close-upload-btn.disabled,
#close-upload-btn:disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.btn:active::after {
  opacity: 0.3;
  animation: ripple 0.4s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0) translate(-50%, -50%);
    opacity: 0.5;
  }
  100% {
    transform: scale(20, 20) translate(-50%, -50%);
    opacity: 0;
  }
}


.file-list-ad {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 1rem;
  box-sizing: border-box;
  margin: 1rem 0;
  min-height: 250px;
  max-height: 400px;
  overflow: hidden;
}

.file-list-ad .adsbygoogle,
.file-list-ad ins.adsbygoogle {
  display: block;
  width: clamp(300px, 90%, 980px);
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  min-height: 250px;
  max-height: 400px;
}

.file-list-ad ins.adsbygoogle > iframe {
  width: 100% !important;
  height: auto !important;
  min-height: 250px !important;
  max-height: 400px !important;
}

.file-list-container {
  height: 100%;
  overflow-y: auto;
  scroll-behavior: smooth;
  max-height: calc(100vh - 140px);
}
.btn:focus,
.file-action-btn:focus,
.custom-prompt-input:focus,
.modal-input:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.loading-overlay .loading-text {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.permissions-grid {
  display: grid;
  grid-template-columns: 100px repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.permissions-header {
  display: contents;
  font-weight: bold;
  color: var(--text-secondary);
}

.permissions-header > div {
  padding: 8px;
  text-align: center;
}

.permissions-row {
  display: contents;
}

.permissions-row > div {
  padding: 8px;
  color: var(--text-primary);
}

.perm-checkbox {
  justify-self: center;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.numeric-permissions {
  margin: 20px 0;
}

.numeric-permissions input {
  width: 80px;
  padding: 5px;
  margin-left: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 4px;
}

.numeric-permissions input:focus {
  border-color: var(--accent-primary);
  outline: none;
}

.recursive-option {
  margin: 15px 0;
}

.recursive-option label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.recursive-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.file-info {
  margin-bottom: 15px;
  padding: 10px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  color: var(--text-secondary);
}


.software-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.software-modal {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px var(--shadow-color);
}

.software-modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.software-modal-header h2 {
  color: var(--text-primary);
  margin: 0;
}

.software-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.software-modal-close:hover {
  background-color: var(--hover-bg);
  color: var(--text-primary);
}

.software-modal-content {
  padding: 20px;
}

.software-section {
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 15px;
}

.software-section h3 {
  color: var(--text-primary);
  margin-bottom: 10px;
}

.software-section p {
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.btn.primary {
  background-color: var(--accent-primary);
  color: white;
}

.btn.primary:hover {
  background-color: var(--accent-secondary);
}

.paper-installer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  z-index: 1001;
  animation: fadeIn 0.3s ease-out;
}

.paper-installer {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.paper-installer-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-secondary);
}

.paper-installer-header h2 {
  color: var(--text-primary);
  margin: 0;
}

.paper-installer-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.paper-installer-close:hover {
  background-color: var(--hover-bg);
  color: var(--text-primary);
}

.paper-installer-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.installer-step {
  max-width: 800px;
  margin: 0 auto;
}

.installer-step h3 {
  color: var(--text-primary);
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.version-loading, .build-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px;
  color: var(--text-secondary);
}

.version-list, .build-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.version-item, .build-item {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.version-item:hover, .build-item:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

.version-item.selected, .build-item.selected {
  background-color: var(--selected-bg);
  border-color: var(--selected-border);
}

.version-item h4, .build-item h4 {
  color: var(--text-primary);
  margin-bottom: 5px;
}

.version-item p, .build-item p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.build-item .build-info {
  margin-top: 10px;
}

.build-item .build-channel {
  display: inline-block;
  background-color: var(--accent-primary);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-bottom: 5px;
}

.build-item .build-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.progress-container {
  max-width: 600px;
  margin: 40px auto;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background-color: var(--bg-tertiary);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 15px;
}

.progress-fill {
  height: 100%;
  background-color: var(--accent-primary);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 10px;
}

.progress-text {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.installer-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
}

.installer-actions .btn {
  padding: 12px 24px;
  font-size: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner {
  border: 3px solid var(--bg-tertiary);
  border-top: 3px solid var(--accent-primary);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}


.version-group {
  margin-bottom: 30px;
}

.version-group-title {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.version-group-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.error-message {
  text-align: center;
  padding: 40px;
  color: var(--error-color);
}

.error-message i {
  font-size: 3rem;
  margin-bottom: 20px;
  display: block;
}

.error-message p {
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.error-message .btn {
  background-color: var(--error-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.error-message .btn:hover {
  background-color: #d32f2f;
}

.build-size {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
}

@media (max-width: 768px) {
  .version-list, .build-list {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
  
  .version-group-items {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
  
  .paper-installer-content {
    padding: 15px;
  }
  
  .software-modal {
    width: 95%;
    margin: 10px;
  }
}


.installation-success, .installation-error {
  text-align: center;
  padding: 40px;
  max-width: 600px;
  margin: 0 auto;
}

.installation-success i {
  font-size: 4rem;
  color: var(--success-color);
  margin-bottom: 20px;
  display: block;
}

.installation-error i {
  font-size: 4rem;
  color: var(--error-color);
  margin-bottom: 20px;
  display: block;
}

.installation-success h3, .installation-error h3 {
  color: var(--text-primary);
  margin-bottom: 15px;
  font-size: 1.8rem;
}

.installation-success p, .installation-error p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.success-details {
  background-color: var(--bg-secondary);
  border-radius: 6px;
  padding: 20px;
  margin: 25px 0;
  text-align: left;
}

.success-details p {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.success-details strong {
  color: var(--text-primary);
}

.success-actions, .error-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
}

.success-actions .btn, .error-actions .btn {
  padding: 12px 24px;
  font-size: 1rem;
}

.installation-success, .installation-error {
  animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .installation-success, .installation-error {
    padding: 30px 20px;
  }
  
  .success-actions, .error-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .success-actions .btn, .error-actions .btn {
    width: 100%;
  }
}




.velocity-installer-overlay {
  z-index: 1000;
}


