/* Kirin Web UI - shadcn/ui inspired styling */

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */

:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary: 221.2 83.2% 53.3%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96%;
  --secondary-foreground: 222.2 84% 4.9%;
  --muted: 210 40% 96%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96%;
  --accent-foreground: 222.2 84% 4.9%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 221.2 83.2% 53.3%;
  --radius: 0.5rem;
}

.dark {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;
  --popover: 222.2 84% 4.9%;
  --popover-foreground: 210 40% 98%;
  --primary: 217.2 91.2% 59.8%;
  --primary-foreground: 222.2 84% 4.9%;
  --secondary: 217.2 32.6% 17.5%;
  --secondary-foreground: 210 40% 98%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 210 40% 98%;
  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
  --ring: 224.3 76.3% 94.1%;
}

* {
  border-color: hsl(var(--border));
}

/* ============================================
   UTILITY CLASSES (Layout, Spacing, Typography)
   ============================================ */

/* Layout - Flexbox */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.flex-1 {
  flex: 1;
  min-width: 0;
}

/* Spacing - Gap */
.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

/* Spacing - Margin */
.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* Spacing - Padding */
.p-4 {
  padding: 1rem;
}

.pt-6 {
  padding-top: 1.5rem;
}

.py-8 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.py-12 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

/* Typography - Font Size */
.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
}

/* Typography - Font Weight */
.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

/* Typography - Text Color */
.text-muted-foreground {
  color: hsl(var(--muted-foreground));
}

.text-primary {
  color: hsl(var(--primary));
}

.text-destructive {
  color: hsl(var(--destructive));
}

/* Typography - Text Alignment */
.text-center {
  text-align: center;
}

/* Typography - Text Decoration */
.underline {
  text-decoration: underline;
}

.hover\:underline:hover {
  text-decoration: underline;
}

/* Display */
.hidden {
  display: none;
}

.block {
  display: block;
}

.inline {
  display: inline;
}

.inline-flex {
  display: inline-flex;
}

/* Opacity */
.opacity-60 {
  opacity: 0.6;
}

/* Width */
.w-full {
  width: 100%;
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

/* ============================================
   BASE STYLES & LAYOUT
   ============================================ */

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.space-y-6 > * + * {
  margin-top: 1.5rem;
}

.header {
  padding: 2rem 0;
  border-bottom: 1px solid hsl(var(--border));
}

.header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

.header p {
  color: hsl(var(--muted-foreground));
  margin: 0.5rem 0 0 0;
}

.nav-bar {
  padding: 1rem 0;
  border-bottom: 1px solid hsl(var(--border));
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.breadcrumb a {
  color: hsl(var(--primary));
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  color: hsl(var(--muted-foreground));
}

/* ============================================
   COMPONENTS (Reusable UI Elements)
   ============================================ */

/* Cards and Panels */
.panel {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
}

.panel-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.panel-content {
  padding: 1.5rem;
}

.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.2s;
}

.card:hover {
  border-color: hsl(var(--ring));
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.card-header {
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.card-description {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  margin: 0;
}

.card-content {
  margin-bottom: 1rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  box-sizing: border-box;
  line-height: 1.5;
  height: 2.5rem;
  vertical-align: top;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.btn-primary:hover:not(:disabled) {
  background: hsl(var(--primary) / 0.9);
}

.btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border-color: hsl(var(--border));
}

.btn-secondary:hover:not(:disabled) {
  background: hsl(var(--secondary) / 0.8);
}

.btn-ghost {
  background: transparent;
  color: hsl(var(--foreground));
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: hsl(var(--accent));
}

.btn-destructive {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  border-color: hsl(var(--destructive));
}

.btn-destructive:hover:not(:disabled) {
  background: hsl(var(--destructive) / 0.9);
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: hsl(var(--foreground));
}

.form-label.required::after {
  content: " *";
  color: hsl(var(--destructive));
}

.input {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  margin: 0;
  vertical-align: middle;
  line-height: 1;
  height: fit-content;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background-color: hsl(var(--input));
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  top: 2px;
  background-color: hsl(var(--background));
  border-radius: 50%;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.toggle-input:checked + .toggle-slider {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
}

.toggle-input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-input:focus + .toggle-slider {
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.toggle-label {
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  user-select: none;
  line-height: 1;
  display: flex;
  align-items: center;
}

.select {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  cursor: pointer;
}

.textarea {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  resize: vertical;
  min-height: 4rem;
}

/* File Items */
.file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  transition: all 0.2s;
}

.file-item:hover {
  border-color: hsl(var(--ring));
  background: hsl(var(--accent));
}

.file-icon {
  width: 16px;
  height: 16px;
  color: hsl(var(--muted-foreground));
  opacity: 0.6;
}

.file-name {
  flex: 1;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.file-size {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.file-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex: 1;
}

/* Commit Items */
.commit-item {
  padding: 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  margin-bottom: 0.5rem;
}

.commit-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.commit-hash {
  font-family: monospace;
  font-size: 0.875rem;
  background: hsl(var(--muted));
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  color: hsl(var(--muted-foreground));
}

.commit-message {
  font-weight: 500;
  color: hsl(var(--foreground));
}

.commit-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.commit-timestamp {
  margin-right: auto;
}

.commit-stats {
  display: flex;
  gap: 0.5rem;
}

.commit-stat {
  background: hsl(var(--secondary));
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
}

/* Tabs */
.tabs {
  border-bottom: 1px solid hsl(var(--border));
  margin-bottom: 1.5rem;
}

.tab-list {
  display: flex;
  gap: 0;
}

.tab {
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

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

.tab.active {
  color: hsl(var(--primary));
  border-bottom-color: hsl(var(--primary));
}

.tab-content {
  padding: 1.5rem 0;
}

/* Status indicators */
.status-connected {
  color: hsl(142 76% 36%);
}

.status-error {
  color: hsl(var(--destructive));
}

.status-testing {
  color: hsl(38 92% 50%);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.25rem;
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.badge-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.badge-destructive {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.alert-success {
  background: hsl(142 76% 36% / 0.1);
  border: 1px solid hsl(142 76% 36% / 0.2);
  color: hsl(142 76% 36%);
}

.alert-error {
  background: hsl(var(--destructive) / 0.1);
  border: 1px solid hsl(var(--destructive) / 0.2);
  color: hsl(var(--destructive));
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 90vw;
  max-height: 90vh;
  width: 800px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0; /* Allow flex item to shrink */
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
  gap: 1rem;
}

.modal-header .flex-1 {
  flex: 1;
  min-width: 0;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0;
}

.modal-body {
  flex: 1;
  overflow-x: auto; /* Allow horizontal scrolling */
  overflow-y: auto;
  padding: 1.5rem;
  max-height: 60vh;
  min-width: 0; /* Allow flex item to shrink */
}

.modal-body > * + * {
  margin-top: 1.5rem;
}

#preview-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#preview-content > .panel {
  margin-bottom: 0;
}

#preview-content > .panel + .panel {
  margin-top: 1.5rem;
}

/* Image preview wrapper */
.image-preview-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0; /* Allow flex item to shrink below content size */
  width: 100%;
}

.image-view-toggle {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap; /* Allow buttons to wrap if needed */
  min-width: 0;
}

.image-view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.image-view-toggle-btn:hover {
  background: hsl(var(--accent));
  border-color: hsl(var(--ring));
  color: hsl(var(--foreground));
}

.image-view-toggle-btn.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.image-view-toggle-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Image preview container */
.image-preview-container {
  width: 100%;
  min-width: 0; /* Allow flex item to shrink */
  max-width: none; /* Don't constrain width */
  padding: 1rem;
  background: hsl(var(--muted) / 0.3);
  border-radius: var(--radius);
  max-height: 70vh;
  transition: all 0.2s;
  box-sizing: border-box;
}

/* Fit mode - auto-resize to fit container */
.image-preview-container[data-mode="fit"] {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview-container[data-mode="fit"] .preview-image {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Scroll mode - show full size with scrolling */
.image-preview-container[data-mode="scroll"] {
  overflow: auto;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.image-preview-container[data-mode="scroll"] .preview-image {
  display: block;
  max-width: none;
  width: auto;
  height: auto;
  margin: 0;
}

.preview-image {
  border-radius: var(--radius);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  transition: all 0.2s;
}

/* Ensure panel-content doesn't constrain image container */
.panel-content .image-preview-wrapper {
  margin: -1.5rem;
  width: calc(100% + 3rem);
  padding: 1.5rem;
  box-sizing: border-box;
  min-width: 0;
  max-width: none; /* Don't constrain width */
}

.panel-content .image-preview-wrapper:first-child {
  margin-top: -1.5rem;
}

.panel-content .image-preview-wrapper:last-child {
  margin-bottom: -1.5rem;
}

/* Ensure modal-body allows horizontal scrolling when needed */
.modal-body {
  overflow-x: auto; /* Allow horizontal scrolling */
  overflow-y: auto;
  min-width: 0;
}

/* Ensure panel doesn't constrain width */
.panel {
  min-width: 0;
  width: 100%;
  max-width: none; /* Don't constrain width */
  overflow: visible; /* Allow content to overflow */
}

.panel-content {
  min-width: 0;
  width: 100%;
  max-width: none; /* Don't constrain width */
  box-sizing: border-box;
  overflow: visible; /* Allow content to overflow */
}

/* Ensure preview-content allows overflow */
#preview-content {
  min-width: 0;
  max-width: none;
  overflow: visible;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.5rem;
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.5);
}

.alert-warning {
  background: hsl(38 92% 50% / 0.1);
  border: 1px solid hsl(38 92% 50% / 0.2);
  color: hsl(38 92% 50%);
}

.alert strong {
  font-weight: 600;
}

.alert .mt-2 {
  margin-top: 0.5rem;
}

/* Grid layouts */
.grid {
  display: grid;
  gap: 1rem;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Responsive grid classes */
@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Override for smaller screens */
@media (max-width: 767px) {
  .md\:grid-cols-2,
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

/* Spacing */
.space-y-2 > * + * {
  margin-top: 0.5rem;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

.space-y-6 > * + * {
  margin-top: 1.5rem;
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid hsl(var(--border));
  border-top: 2px solid hsl(var(--primary));
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* File upload area */
.upload-area {
  border: 2px dashed hsl(var(--border));
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  background: hsl(var(--muted) / 0.5);
  transition: all 0.2s;
  cursor: pointer;
}

.upload-area:hover {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.05);
}

.upload-area.dragover {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
}

/* Responsive design */
@media (max-width: 640px) {
  .container {
    padding: 0 0.5rem;
  }

  .header {
    padding: 1rem 0;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .panel-content {
    padding: 1rem;
  }

  .card {
    padding: 1rem;
  }

  .file-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .file-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* File removal checkbox improvements */
.file-remove-checkbox {
  width: 24px;
  height: 24px;
  cursor: pointer;
  accent-color: hsl(var(--destructive));
  flex-shrink: 0;
  border-radius: 6px;
  margin: 0;
  display: inline-block;
  transition: all 0.2s ease;
}

.file-remove-checkbox:focus {
  outline: 2px solid hsl(var(--destructive));
  outline-offset: 2px;
}

/* Ensure proper flexbox layout for file removal items */
.file-remove-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px hsl(var(--border) / 0.1);
}

.file-remove-item .file-icon {
  display: inline-block;
  flex-shrink: 0;
  color: hsl(var(--muted-foreground));
  opacity: 0.8;
  transition: all 0.2s ease;
}

.file-remove-item:hover .file-icon {
  opacity: 1;
  color: hsl(var(--foreground));
}

/* Visual feedback for the container when checked */
.file-remove-item:has(input:checked) {
  background-color: hsl(var(--destructive) / 0.08);
  border-color: hsl(var(--destructive));
  box-shadow: 0 2px 4px hsl(var(--destructive) / 0.1);
}

.file-remove-item:has(input:checked) .file-icon {
  color: hsl(var(--destructive));
  opacity: 1;
}

.file-remove-item:hover {
  border-color: hsl(var(--border));
  box-shadow: 0 2px 8px hsl(var(--border) / 0.2);
  transform: translateY(-1px);
}

.file-remove-item:has(input:checked):hover {
  border-color: hsl(var(--destructive));
  background-color: hsl(var(--destructive) / 0.12);
  box-shadow: 0 4px 12px hsl(var(--destructive) / 0.15);
}

/* File name styling */
.file-remove-item .font-medium {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  color: hsl(var(--foreground));
}

.file-remove-item .text-sm {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}

/* Utility classes */
.hidden {
  display: none;
}

/* Code snippet styles */
.code-snippet {
  position: relative;
  background-color: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
}

.code-snippet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background-color: hsl(var(--muted));
  border-bottom: 1px solid hsl(var(--border));
}

.code-snippet-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.code-snippet-title svg {
  width: 16px;
  height: 16px;
  color: hsl(var(--muted-foreground));
}

.code-snippet-content {
  padding: 0;
  background-color: hsl(var(--background));
}

.code-snippet pre {
  margin: 0;
  padding: 1rem;
  background-color: hsl(var(--muted) / 0.3);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  color: hsl(var(--foreground));
  overflow-x: auto;
  white-space: pre;
}

.code-snippet code {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  background-color: transparent;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--muted));
  border-color: hsl(var(--border));
}

.copy-btn:active {
  transform: translateY(1px);
}

.copy-btn svg {
  width: 14px;
  height: 14px;
}

.copy-btn.copied {
  color: hsl(var(--primary));
  background-color: hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary));
}

/* Collapsible code snippet */
.code-snippet.collapsed .code-snippet-content {
  display: none;
}

.code-snippet-toggle {
  cursor: pointer;
  user-select: none;
}

.code-snippet-toggle svg {
  transition: transform 0.2s ease;
}

.code-snippet.collapsed .code-snippet-toggle svg {
  transform: rotate(-90deg);
}


/* Commit navigation styles */
.commit-nav-info {
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.commit-nav-position {
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.commit-nav-position.commit-latest {
  color: hsl(var(--primary));
  font-weight: 600;
}

.commit-nav-position.commit-oldest {
  color: hsl(var(--muted-foreground));
}

.commit-nav-position.commit-middle {
  color: hsl(var(--muted-foreground));
}

.commit-nav-details {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.commit-hash {
  font-family: monospace;
  font-size: 0.8125rem;
  color: hsl(var(--primary));
  background-color: hsl(var(--muted));
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
}

.commit-message {
  color: hsl(var(--foreground));
  font-weight: 500;
}

.commit-nav-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.commit-nav-buttons .btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.commit-nav-buttons .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Tags and Metadata Styles */
.commit-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.badge-tag {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  border: 1px solid hsl(var(--primary) / 0.3);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 500;
}

.metadata-section {
  margin-top: 0.75rem;
  border-top: 1px solid hsl(var(--border));
  padding-top: 0.75rem;
}

.metadata-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius);
  transition: all 0.2s;
  margin: 0;
  font-family: inherit;
}

.metadata-toggle:hover {
  background: hsl(var(--accent));
  border-color: hsl(var(--ring));
  color: hsl(var(--foreground));
}

.metadata-toggle:active {
  transform: translateY(1px);
}

.metadata-toggle svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.metadata-section.expanded .metadata-toggle svg {
  transform: rotate(90deg);
}

.metadata-content {
  display: none;
  margin-top: 0.75rem;
}

.metadata-section.expanded .metadata-content {
  display: block;
}

.json-viewer {
  background: hsl(var(--muted) / 0.3);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

.json-viewer pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.json-key {
  color: hsl(var(--primary));
  font-weight: 500;
}

.json-string {
  color: hsl(142 76% 36%);
}

.json-number {
  color: hsl(38 92% 50%);
}

.json-boolean {
  color: hsl(221.2 83.2% 53.3%);
}

.json-null {
  color: hsl(var(--muted-foreground));
  font-style: italic;
}
