/* Eclipse Forge Pro - Production Styles */
/* Tailwind-inspired utility classes + custom components */

/* ===== Base Resets & Typography ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  background: #18181f;
  color: #e2e8f0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Utility Classes ===== */
.hidden { display: none !important; }
.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; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.w-full { width: 100%; }
.h-screen { height: 100vh; }
.min-h-\[40px\] { min-height: 40px; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-gray-200 { color: #e2e8f0; }
.text-gray-300 { color: #cbd5e1; }
.text-gray-400 { color: #94a3b8; }
.text-gray-500 { color: #64748b; }
.text-blue-400 { color: #60a5fa; }
.text-green-400 { color: #4ade80; }
.text-red-400 { color: #f87171; }
.text-yellow-400 { color: #facc15; }
.text-purple-400 { color: #a78bfa; }
.text-orange-400 { color: #fb923c; }

.bg-\[\#1e293b\] { background: #1e293b; }
.bg-\[\#0f172a\] { background: #0f172a; }
.bg-\[\#1a1a25\] { background: #1a1a25; }
.bg-\[\#252530\] { background: #252530; }
.bg-\[\#1e1e2a\] { background: #1e1e2a; }
.bg-\[\#1e1e2e\] { background: #1e1e2e; }

.border { border-width: 1px; border-style: solid; }
.border-\[\#334155\] { border-color: #334155; }
.border-\[\#353540\] { border-color: #353540; }
.border-\[\#3e3e4a\] { border-color: #3e3e4a; }
.border-\[\#4a4a5a\] { border-color: #4a4a5a; }

.rounded { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); }

.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; }
.duration-200 { transition-duration: 200ms; }

.hover\:bg-\[\#334155\]:hover { background-color: #334155; }
.hover\:bg-blue-500:hover { background-color: #3b82f6; }
.hover\:bg-green-500:hover { background-color: #22c55e; }
.hover\:bg-red-500:hover { background-color: #ef4444; }
.hover\:bg-purple-500:hover { background-color: #a855f7; }
.hover\:text-white:hover { color: #fff; }

.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:border-blue-500:focus { border-color: #3b82f6; }

.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); }
.from-\[\#1a1a2e\] { --tw-gradient-from: #1a1a2e; --tw-gradient-to: rgba(26, 26, 46, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.to-\[\#16213e\] { --tw-gradient-to: #16213e; }

.max-w-md { max-width: 28rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ===== Custom Components ===== */

/* File Tree Items */
.file-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
}
.file-item:hover {
  background: #2a2a36;
}
.file-item.active {
  background: #3b82f6/15;
  border-left: 2px solid #3b82f6;
}
.file-item.dir {
  color: #fbbf24;
}
.file-item .icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
}
.file-item .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Editor Tabs */
.tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  border-right: 1px solid #3e3e4a;
  background: #252530;
  white-space: nowrap;
}
.tab.active {
  background: #2d2d3a;
  border-bottom: 2px solid #3b82f6;
}
.tab .filename {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab .modified {
  color: #eab308;
  margin-left: 0.25rem;
  font-size: 0.75rem;
}

/* Console Log Entries */
.log-entry {
  display: flex;
  gap: 0.5rem;
  padding: 0.125rem 0;
  font-family: monospace;
  font-size: 0.75rem;
}
.log-time {
  color: #6b7280;
  min-width: 3.5rem;
  flex-shrink: 0;
}
.log-info { color: #3b82f6; }
.log-success { color: #10b981; }
.log-warning { color: #f59e0b; }
.log-error { color: #ef4444; }

/* Context Chips */
.context-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  background: #374151;
  border-radius: 9999px;
  font-size: 0.625rem;
  margin: 0.125rem;
}
.context-chip .remove {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.context-chip .remove:hover {
  opacity: 1;
  color: #ef4444;
}

/* API Key Cards */
.api-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.75rem;
  transition: border-color 0.2s;
}
.api-card.saved {
  border-left: 4px solid #10b981;
}
.api-card.error {
  border-left: 4px solid #ef4444;
}
.api-card .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.api-card .provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 600;
}
.api-card .provider-badge.gemini {
  background: #4285f4/20;
  color: #4285f4;
  border: 1px solid #4285f4/40;
}
.api-card .provider-badge.anthropic {
  background: #d97757/20;
  color: #d97757;
  border: 1px solid #d97757/40;
}
.api-card .provider-badge.groq {
  background: #f59e0b/20;
  color: #f59e0b;
  border: 1px solid #f59e0b/40;
}
.api-card .tier-badge {
  background: #10b981/20;
  color: #10b981;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.625rem;
}
.api-card .tier-badge.premium {
  background: #f59e0b/20;
  color: #f59e0b;
}
.api-card .key-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.625rem;
}
.api-card .key-status::before {
  content: "•";
  color: #6b7280;
}
.api-card .key-status.valid::before {
  content: "✓";
  color: #10b981;
}
.api-card .key-status.invalid::before {
  content: "✗";
  color: #ef4444;
}
.api-card .models-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
}
.api-card .model-tag {
  background: #374151;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.625rem;
}

/* Plan Preview */
.plan-preview {
  font-family: monospace;
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
}

/* Diff Visualization */
.diff-view {
  font-family: monospace;
  font-size: 0.75rem;
  line-height: 1.4;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  padding: 0.5rem;
  margin-top: 0.5rem;
}
.diff-line {
  padding: 0.125rem 0.5rem;
}
.diff-add {
  background: #10b981/20;
  color: #6ee7b7;
}
.diff-remove {
  background: #ef4444/20;
  color: #fca5a5;
  text-decoration: line-through;
  opacity: 0.8;
}

/* Toast Notifications */
.toast {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  max-width: 350px;
  animation: slideIn 0.3s ease-out;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.toast.success {
  border-left: 4px solid #10b981;
}
.toast.error {
  border-left: 4px solid #ef4444;
}
.toast.warning {
  border-left: 4px solid #f59e0b;
}
.toast.info {
  border-left: 4px solid #3b82f6;
}
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Loading Spinner */
.loading-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid #3e3e4a;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #1e1e2e;
}
::-webkit-scrollbar-thumb {
  background: #4a4a5a;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #6b6b7e;
}

/* Monaco Editor Overrides */
.monaco-editor .margin {
  background: #1e1e2e !important;
}
.monaco-editor .view-overlays .current-line {
  border: none !important;
  background: #2a2a3a !important;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .file-tree-container {
    width: 200px;
  }
  .settings-container {
    width: 300px;
  }
}

@media (max-width: 768px) {
  .main-layout {
    flex-direction: column;
  }
  .file-tree-container,
  .settings-container {
    width: 100%;
    max-height: 200px;
  }
  .console-panel {
    height: 200px;
  }
}