/* ==========================================================================
   UpscaleTool Studio - CSS Design System & Theme
   ========================================================================== */

:root {
  --bg-main: #0a0d14;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(24, 32, 51, 0.85);
  --bg-input: #121826;
  --border-color: rgba(255, 255, 255, 0.09);
  --border-focus: rgba(99, 102, 241, 0.5);
  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);

  --accent-stock: #10b981;
  --accent-stock-glow: rgba(16, 185, 129, 0.3);
  --accent-warn: #f59e0b;
  --accent-danger: #ef4444;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --transition-fast: 0.15s ease;
  --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* Ambient glow accents */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}
.bg-glow-1 {
  width: 500px;
  height: 500px;
  top: -100px;
  left: 10%;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
}
.bg-glow-2 {
  width: 450px;
  height: 450px;
  bottom: 5%;
  right: 5%;
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1 0%, #10b981 100%);
  color: #fff;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-text h1 span {
  background: linear-gradient(90deg, #818cf8, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  color: var(--text-main);
  background: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-ghost {
  color: var(--text-muted);
  font-size: 0.8rem;
}
.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.btn-glow {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-stock-glow);
  padding: 0.9rem 1.5rem;
  font-size: 0.95rem;
}
.btn-glow:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(16, 185, 129, 0.5);
}
.btn-glow:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-success {
  background: #10b981;
  color: #fff;
}
.btn-success:hover {
  background: #059669;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
}
.btn-block {
  width: 100%;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-icon:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Main Container */
.main-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem 2.5rem 3rem;
  position: relative;
  z-index: 10;
}

/* Banner */
.info-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.banner-badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: #10b981;
  color: #064e3b;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.banner-text {
  font-size: 0.85rem;
  color: #d1fae5;
  flex: 1;
}

.banner-link {
  background: none;
  border: none;
  color: #34d399;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* Workspace Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 1.75rem;
  align-items: start;
}

/* Panels */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

/* Dropzone */
.dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.03);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-smooth);
  position: relative;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.2);
}

.drop-icon {
  color: #818cf8;
  margin-bottom: 0.75rem;
}

.dropzone-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.dropzone-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* File Loaded Card */
.file-loaded-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
}

.file-thumb-wrap {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}
.file-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-info-block {
  flex: 1;
  min-width: 0;
}
.file-info-block h4 {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.35rem;
}

.file-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.pill {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--text-muted);
}

/* Settings Group */
.settings-group {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Preset Toggle Card */
.preset-toggle-card {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: all var(--transition-fast);
}
.preset-toggle-card.active {
  border-color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.toggle-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.toggle-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toggle-details {
  flex: 1;
}
.toggle-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
}
.toggle-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .2s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #10b981;
}
input:checked + .slider:before {
  transform: translateX(20px);
}

/* Form inputs & rows */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.label-val {
  color: #818cf8;
  font-size: 0.75rem;
  font-family: monospace;
}

.scale-btn-group, .mp-btn-group {
  display: flex;
  gap: 0.4rem;
}
.btn-chip {
  flex: 1;
  padding: 0.4rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}
.btn-chip.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: #6366f1;
  color: #c7d2fe;
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  transition: transform var(--transition-fast);
}
.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-unit input, .form-select {
  width: 100%;
  padding: 0.55rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
  outline: none;
}
.input-with-unit input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.input-with-unit .unit {
  position: absolute;
  right: 0.85rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  pointer-events: none;
}

.checkbox-row {
  justify-content: center;
}
.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.custom-checkbox input {
  accent-color: #10b981;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Spinner */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Result Panel */
.result-placeholder, .result-loading {
  min-height: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
}

.placeholder-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}
.result-placeholder h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.result-placeholder p {
  color: var(--text-muted);
  font-size: 0.875rem;
  max-width: 440px;
}

.loader-pulse {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #10b981);
  animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  margin-bottom: 1.5rem;
}
@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Result Header */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}
.result-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
}
.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.result-actions {
  display: flex;
  gap: 0.65rem;
}

/* Comparison Container (Split Slider) */
.comparison-container {
  position: relative;
  width: 100%;
  height: 420px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  user-select: none;
  cursor: ew-resize;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.comparison-image-before,
.comparison-image-after {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}
.comparison-image-before img,
.comparison-image-after img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #05070a;
}
.comparison-image-after {
  width: 50%;
  overflow: hidden;
  border-right: 2px solid #fff;
  z-index: 2;
}
.comparison-image-after img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  /* We will dynamically sync img width in JS */
}

.comp-label {
  position: absolute;
  top: 1rem;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
}
.comp-label-left { left: 1rem; }
.comp-label-right { right: 1rem; }

.comparison-slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 40px;
  height: 100%;
  margin-left: -20px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.handle-line {
  position: absolute;
  width: 2px;
  height: 100%;
  background: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.handle-circle {
  width: 36px;
  height: 36px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  z-index: 6;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-top: 1.25rem;
}
.metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}
.metric-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}
.metric-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}
.metric-val.highlight {
  color: #34d399;
}
.metric-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Checklist Card */
.stock-checklist-card {
  margin-top: 1.25rem;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.card-head h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: #e2e8f0;
}
.checklist-summary {
  font-size: 0.75rem;
  color: #34d399;
  font-weight: 600;
}
.checklist-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
}
.chk-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #cbd5e1;
}
.chk-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #10b981;
  color: #064e3b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
}
.chk-item.fail .chk-icon {
  background: #ef4444;
  color: #fff;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-window {
  width: 100%;
  max-width: 820px;
  max-height: 85vh;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.modal-header {
  padding: 1.5rem 1.75rem 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}
.modal-title-wrap h2 {
  font-size: 1.25rem;
  font-weight: 800;
}
.modal-title-wrap p {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition-fast);
}
.modal-close-btn:hover {
  color: #fff;
}

.modal-tabs {
  display: flex;
  padding: 0 1.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}
.tab-btn {
  padding: 0.85rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.tab-btn:hover {
  color: #fff;
}
.tab-btn.active {
  color: #10b981;
  border-bottom-color: #10b981;
}

.modal-body {
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
  flex: 1;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
}
.tab-pane.active {
  display: flex;
}

.guideline-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.guideline-card h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: #f1f5f9;
}
.guideline-card ul {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.guideline-card code {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  color: #e2e8f0;
}
.guideline-card a {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
}
.guideline-card a:hover {
  text-decoration: underline;
}

.modal-footer {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  justify-content: flex-end;
}

/* Panel Mode Switcher */
.panel-mode-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-color);
}
.mode-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.mode-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.mode-tab.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(16, 185, 129, 0.25) 100%);
  color: #fff;
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Gemini Status Card */
.gemini-status-card {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.gemini-status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: #c7d2fe;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-ring 1.5s infinite;
}
.gemini-status-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Form Textarea & Prompt Chips */
.form-textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  line-height: 1.4;
}
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Catalog Accordion */
.catalog-accordion {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.85rem;
  overflow: hidden;
}
.catalog-header {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.02);
  transition: background var(--transition-fast);
}
.catalog-header:hover {
  background: rgba(255, 255, 255, 0.05);
}
.cat-head-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #e0e7ff;
}
.cat-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-chip-action {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
}
.btn-chip-action:hover {
  background: #6366f1;
  color: #fff;
}
.chevron-icon {
  font-size: 0.8rem;
  color: var(--text-dim);
  transition: transform var(--transition-fast);
}
.catalog-accordion.open .chevron-icon {
  transform: rotate(180deg);
}

.catalog-body {
  padding: 0.85rem;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.15);
}

.catalog-cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.cat-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
}
.cat-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.cat-pill.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #a7f3d0;
  font-weight: 700;
}

.catalog-cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.cat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cat-card:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: #6366f1;
  transform: translateX(2px);
}
.cat-card-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cat-card-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}
.cat-card-prompt {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}
.chip-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.25rem 0.55rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.chip-item:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: #6366f1;
  color: #fff;
}

/* AI Metadata Card */
.ai-metadata-card {
  margin-top: 1.25rem;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.ai-meta-title-wrap h4 {
  font-size: 0.9rem;
  font-weight: 800;
  color: #e0e7ff;
}
.ai-meta-title-wrap p {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.meta-field-group {
  margin-top: 0.85rem;
}
.meta-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.3rem;
}
.meta-value-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  color: #fff;
  font-weight: 600;
}
.keywords-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 120px;
  overflow-y: auto;
  padding: 0.4rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.keyword-tag {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.keyword-tag:nth-child(-n+10) {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  font-weight: 700;
}

/* Saved File Alert Banner */
.saved-file-alert {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 78, 59, 0.3));
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.alert-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #34d399;
  flex-shrink: 0;
}
.alert-content {
  flex: 1;
  min-width: 0;
}
.alert-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #a7f3d0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}
.alert-path-wrap {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alert-path {
  font-family: 'Fira Code', monospace;
  font-size: 0.875rem;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.alert-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Educational MP vs MB Card */
.edu-card-info {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.edu-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.edu-icon {
  font-size: 1.1rem;
}
.edu-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #a5b4fc;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.edu-body p {
  font-size: 0.825rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.edu-body p:last-child {
  margin-bottom: 0;
}
.edu-body strong {
  color: #ffffff;
}

/* Responsive */
@media (max-width: 1080px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .navbar {
    padding: 1rem 1.25rem;
  }
  .main-container {
    padding: 1rem;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .saved-file-alert {
    flex-direction: column;
    align-items: flex-start;
  }
  .alert-actions {
    width: 100%;
    margin-top: 0.5rem;
  }
}
