/* Modern Responsive Design System for Requirement Form Generator */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* HSL Color Tokens */
  --bg-app: hsl(224, 25%, 10%);
  --bg-sidebar: hsl(224, 25%, 8%);
  --bg-card: hsla(224, 20%, 14%, 0.7);
  --bg-input: hsl(224, 20%, 18%);
  --border: hsl(224, 15%, 22%);
  --border-focus: hsl(22, 90%, 54%);
  --text-main: hsl(210, 40%, 98%);
  --text-muted: hsl(215, 20%, 70%);
  --primary: hsl(22, 90%, 54%);
  --primary-glow: hsla(22, 90%, 54%, 0.35);
  --accent: hsl(22, 90%, 54%);
  --danger: hsl(0, 85%, 60%);
  --warning: hsl(35, 100%, 55%);
  --sidebar-width: 250px;
  --preview-width: 300px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-mono: 'Fira Code', monospace;
}

/* Light Theme Variables Override */
body.light-theme {
  --bg-app: hsl(210, 30%, 96%);
  --bg-sidebar: hsl(210, 25%, 90%);
  --bg-card: hsla(0, 0%, 100%, 0.85);
  --bg-input: hsl(210, 30%, 98%);
  --border: hsl(210, 20%, 82%);
  --border-focus: hsl(22, 90%, 54%);
  --text-main: hsl(224, 25%, 12%);
  --text-muted: hsl(224, 15%, 45%);
  --primary: hsl(22, 90%, 54%);
  --primary-glow: hsla(22, 90%, 54%, 0.25);
  --accent: hsl(22, 90%, 48%);
  --danger: hsl(0, 75%, 50%);
  --warning: hsl(35, 90%, 45%);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  transition: background-color 0.3s ease;
}

/* App Container Layout */
.app-container {
  display: flex;
  width: 100%;
  height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-main) 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-header p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.nav-tabs {
  list-style: none;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-item {
  width: 100%;
}

.nav-button {
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

.nav-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: var(--transition);
}

.nav-button:hover {
  background-color: var(--bg-input);
  color: var(--text-main);
}

.nav-button.active {
  background-color: var(--primary);
  color: hsl(0, 0%, 100%);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.sidebar-footer {
  padding: 16px;
  margin-top: auto; /* Push to absolute bottom */
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px dashed var(--border);
}

/* Premium developer signature styling */
.developer-signature {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  user-select: none;
  cursor: default;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(0, 188, 255, 0.25);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), 0 0 15px rgba(0, 188, 255, 0.08);
  box-sizing: border-box;
  width: 100%;
}

.developer-signature span {
  background-image: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  transition: var(--transition);
  filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.35));
}

.developer-signature:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #ff007f;
  box-shadow: 0 6px 20px rgba(255, 0, 127, 0.25);
  transform: translateY(-1px);
}

.developer-signature:hover span {
  background-image: linear-gradient(135deg, #ff007f 0%, #7f00ff 100%);
  filter: drop-shadow(0 0 12px rgba(255, 0, 127, 0.6));
  letter-spacing: 4px;
}

body.light-theme .sidebar-footer {
  background: rgba(0, 0, 0, 0.03);
}

body.light-theme .developer-signature {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 102, 204, 0.22);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), 0 0 10px rgba(67, 100, 247, 0.1);
}

body.light-theme .developer-signature span {
  background-image: linear-gradient(135deg, #0052d4 0%, #4364f7 100%);
  filter: drop-shadow(0 0 6px rgba(67, 100, 247, 0.2));
}

body.light-theme .developer-signature:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: #d10056;
  box-shadow: 0 4px 15px rgba(209, 0, 86, 0.2);
}

body.light-theme .developer-signature:hover span {
  background-image: linear-gradient(135deg, #d10056 0%, #f20089 100%);
  filter: drop-shadow(0 0 10px rgba(242, 0, 137, 0.45));
}

/* Controls Panel */
.main-content {
  position: relative;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
}



.top-bar {
  position: relative;
  z-index: 100;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-card);
  backdrop-filter: blur(10px);
}

.top-bar-title h2 {
  font-size: 1.125rem;
  font-weight: 600;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Form Container */
.form-viewport {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

.form-tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
  max-width: 1000px;
  margin: 0 auto;
}

.form-tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card & Inputs Styling */
.section-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px hsla(0, 0%, 0%, 0.15);
  backdrop-filter: blur(8px);
}

.section-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-grid.full-width {
  grid-template-columns: 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.col-span-2 {
  grid-column: span 2;
}

label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* Switches & Toggles */
.switch-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.switch-label-wrapper {
  display: flex;
  flex-direction: column;
}

.switch-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.switch-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border);
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

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

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

/* Color Picker Container */
.color-picker-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

.color-input-picker {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: none;
}

.color-input-picker::-webkit-color-swatch {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.color-input-text {
  flex-grow: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-secondary {
  background-color: var(--bg-input);
  border-color: var(--border);
  color: var(--text-main);
}

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

.btn:disabled, .btn[disabled] {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  border: 1.5px solid #e74c3c !important;
  box-shadow: none !important;
}

.btn-danger {
  background-color: hsla(0, 85%, 60%, 0.15);
  border-color: hsla(0, 85%, 60%, 0.2);
  color: var(--danger);
}

.btn-danger:hover {
  background-color: var(--danger);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-full {
  width: 100%;
}

.icon-btn {
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.icon-btn:hover {
  background-color: var(--border);
  color: var(--text-main);
}

.icon-btn.delete:hover {
  background-color: var(--danger);
  border-color: var(--danger);
  color: white;
}

/* Dynamic Item Lists styles */
.dynamic-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dynamic-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.dynamic-item-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dynamic-item-fields {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.dynamic-item-fields.single-field {
  grid-template-columns: 1fr;
}

.dynamic-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.list-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Connectivity Section Custom Styles */
.connectivity-tab-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--bg-input);
  padding: 16px;
  margin-bottom: 16px;
}

.connectivity-tab-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

/* Pricing Section Custom Styles */
.pricing-phase-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background-color: var(--bg-card);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: inset 0 2px 8px hsla(0, 0%, 0%, 0.1);
}

.pricing-phase-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.pricing-phase-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.pricing-row-item {
  border: 1px solid var(--border);
  background-color: var(--bg-app);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.pricing-row-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

/* Split Pane Preview Panel */
.preview-pane {
  width: var(--preview-width);
  background-color: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  z-index: 10;
  transition: width 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.preview-pane.collapsed {
  width: 0;
  border-left: none;
  overflow: hidden;
}

.preview-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.preview-tabs {
  display: flex;
  background-color: var(--bg-app);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin: 16px 20px 8px 20px;
}

.preview-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.preview-tab-btn.active {
  background-color: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.code-viewer-container {
  flex-grow: 1;
  padding: 0 20px 20px 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.code-wrapper {
  background-color: hsl(224, 25%, 5%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  overflow: auto;
  flex-grow: 1;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre;
  color: hsl(120, 40%, 75%);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Utility alert info */
.form-tip {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.3;
}

.form-tip code {
  background-color: var(--border);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: var(--font-mono);
  color: var(--warning);
}

/* Dragging / Sorting indicator */
.sort-handle {
  cursor: grab;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
}

.sort-handle:hover {
  color: var(--text-main);
}

.sort-handle svg {
  width: 16px;
  height: 16px;
}

/* Animations and Responsive Styles */
@media(max-width: 1024px) {
  body {
    overflow: auto;
    height: auto;
  }
  
  .app-container {
    flex-direction: column;
    height: auto;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .nav-tabs {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px;
  }
  
  .nav-button {
    white-space: nowrap;
    padding: 8px 12px;
  }
  
  .preview-pane {
    width: 100%;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

@media(max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-group.col-span-2 {
    grid-column: span 1;
  }
}

/* Medium screen adjustments for 1366px and 1536px displays */
@media (min-width: 1025px) and (max-width: 1550px) {
  :root {
    --sidebar-width: 220px;
    --preview-width: 300px;
  }
  
  .sidebar-header {
    padding: 16px;
  }
  
  .sidebar-header h1 {
    font-size: 1.15rem;
  }
  
  .sidebar-header p {
    font-size: 0.7rem;
  }
  
  .nav-tabs {
    padding: 10px 4px;
    gap: 2px;
  }
  
  .nav-button {
    padding: 10px 12px;
    font-size: 0.8rem;
    gap: 8px;
    border-radius: 6px;
  }
  
  .sidebar-section {
    padding: 12px !important;
    margin: 6px 0 !important;
  }

  .top-bar {
    padding: 12px 18px;
  }
  
  .top-bar-title h2 {
    font-size: 1rem;
  }
  
  .btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  
  .form-viewport {
    padding: 16px;
  }
  
  .section-card {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
  }
  
  .section-card h3 {
    font-size: 0.9rem;
    margin-bottom: 14px;
    padding-bottom: 6px;
  }
  
  .form-grid {
    gap: 12px;
  }
}

/* Modal Fade-in Keyframes Animation */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Premium Glassmorphism Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 12, 24, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 60%;
  max-width: 800px;
  height: 60%;
  max-height: 550px;
  display: flex;
  flex-direction: column;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 
              0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  position: relative;
  animation: modalFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.icon-btn-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.icon-btn-close:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
  transform: rotate(90deg);
}

#ai-prompt-large {
  flex-grow: 1;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.95rem;
  padding: 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  resize: none;
  outline: none;
  transition: var(--transition);
  line-height: 1.6;
  box-sizing: border-box;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
}

#ai-prompt-large:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow), inset 0 2px 8px rgba(0,0,0,0.2);
}

/* AI Drag and Drop Inbox Styling */
.dropzone-wrapper {
  position: relative;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.dropzone-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(16, 163, 127, 0.15);
  border: 2px dashed #10a37f;
  border-radius: var(--radius-md);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  pointer-events: none; /* Let drag events pass through to wrapper */
  animation: fadeIn 0.2s ease-out;
}

.dropzone-overlay-inner {
  text-align: center;
  color: var(--text-main);
  font-weight: 600;
  font-size: 1rem;
}

.dropzone-overlay svg {
  margin-bottom: 12px;
  animation: bounce 1.5s infinite;
}

.ai-attached-thumbnail {
  position: relative;
  width: 64px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}

.ai-attached-thumbnail:hover {
  transform: scale(1.05);
}

.ai-attached-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-attached-thumbnail .delete-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.6);
  border: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: white;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.ai-attached-thumbnail .delete-btn:hover {
  background: var(--danger);
}

.ai-attached-thumbnail .loader {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(0,0,0,0.4);
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* AI Processor Panel Styling */
.ai-processor-panel {
  padding: 24px 20px;
  background-color: transparent;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.ai-processor-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-processor-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  font-weight: 700;
  margin: 0;
}

.ai-model-select-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-model-select-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  margin-bottom: 0;
  text-transform: none;
}

#openai-model {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.75rem;
  width: auto;
  max-width: 120px;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

#openai-model:focus {
  border-color: var(--border-focus);
}

.ai-prompt-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-prompt-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#ai-prompt {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 35px 12px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.8rem;
  min-height: 160px;
  height: 160px;
  font-family: inherit;
  resize: none;
  overflow-y: auto;
  cursor: pointer;
  line-height: 1.5;
  transition: var(--transition);
}

#ai-prompt:hover {
  border-color: var(--border-focus);
  background: var(--border);
}

#btn-expand-prompt {
  position: absolute;
  right: 12px;
  top: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  padding: 0;
  z-index: 5;
}

#btn-expand-prompt:hover {
  color: var(--text-main);
}

.btn-ai-submit {
  padding: 10px;
  font-size: 0.8rem;
  background: linear-gradient(135deg, #10a37f 0%, #0d8366 100%);
  color: white;
  font-weight: 700;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.25);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.btn-ai-submit:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 6px 16px rgba(16, 163, 127, 0.4);
}

.btn-ai-submit:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.ai-status-msg {
  font-size: 0.75rem;
  color: var(--accent);
  padding: 4px 0;
  display: none;
  line-height: 1.3;
  word-break: break-all;
  margin-top: -4px;
}

.state-actions-wrapper {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.state-actions-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.state-buttons-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.state-buttons-subgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Floating Code Preview Drawer (Chatbox style) */
.floating-code-drawer {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 480px;
  height: 600px;
  max-height: 80vh;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  display: flex;
  flex-direction: column;
  z-index: 999;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: drawerSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              height 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-code-drawer.expanded {
  width: 950px;
  max-width: calc(100vw - 48px);
  height: 750px;
  max-height: calc(100vh - 48px);
  z-index: 1001;
}

@keyframes drawerSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.drawer-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.drawer-title-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.drawer-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-main);
  margin: 0;
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn-close-drawer {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.icon-btn-close-drawer:hover {
  color: var(--danger);
  transform: scale(1.1);
}

/* Global Font Scaling and Viewport Adjustments for standard laptop displays */
@media (max-width: 1440px), (max-height: 850px) {
  html {
    font-size: 13.5px;
  }
}

@media (max-width: 1280px), (max-height: 720px) {
  html {
    font-size: 12.5px;
  }
  :root {
    --sidebar-width: 200px;
    --preview-width: 270px;
  }
}

/* AI API Key Input Styling */
.ai-key-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-key-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#openai-api-key {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.8rem;
  outline: none;
  transition: var(--transition);
}

#openai-api-key:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Hub Selection Screen Styling */
.hub-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-app);
  background-image: 
    radial-gradient(at 0% 0%, rgba(243, 112, 34, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(243, 112, 34, 0.06) 0px, transparent 50%);
  padding: 40px;
  box-sizing: border-box;
  overflow-y: auto;
}

.hub-header {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeInDown 0.6s ease;
}

.hub-logo {
  max-height: 60px;
  width: auto;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.4));
  background-color: #ffffff;
  padding: 8px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  box-sizing: border-box;
}

.hub-header h2 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-main) 30%, #f37022 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

.hub-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 500px;
  margin: 0 auto;
}

.hub-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  margin-bottom: 40px;
  animation: fadeInUp 0.7s ease;
}

.hub-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hub-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #f37022 0%, #ff8838 100%);
  opacity: 0;
  transition: var(--transition);
}

.hub-card:hover {
  transform: translateY(-8px);
  border-color: rgba(243, 112, 34, 0.4);
  box-shadow: 0 20px 40px rgba(243, 112, 34, 0.1), 0 0 25px rgba(0, 0, 0, 0.3);
}

.hub-card:hover::before {
  opacity: 1;
}

.hub-card-icon {
  width: 48px;
  height: 48px;
  background: rgba(243, 112, 34, 0.1);
  color: #f37022;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.hub-card:hover .hub-card-icon {
  background: #f37022;
  color: #ffffff;
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(243, 112, 34, 0.3);
}

.hub-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
}

.hub-card p {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
  flex-grow: 1;
}

.hub-card-action {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f37022;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.hub-card:hover .hub-card-action {
  transform: translateX(6px);
  color: #ff8838;
}

.hub-footer {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Copy Workspace Layout */
.copy-workspace-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-app);
}

.copy-top-bar {
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-sidebar);
}

.copy-title-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.copy-bar-logo {
  max-height: 36px;
  width: auto;
  background-color: #ffffff;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  box-sizing: border-box;
}

.copy-top-bar h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
}

.copy-main-content {
  flex-grow: 1;
  padding: 32px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.copy-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: fit-content;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.copy-intro-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.copy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.btn-copy-submit {
  width: 100%;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(135deg, #f37022 0%, #d85c14 100%);
  border-color: #f37022;
  box-shadow: 0 4px 15px rgba(243, 112, 34, 0.2);
  margin-top: 10px;
}

.btn-copy-submit:hover {
  background: linear-gradient(135deg, #d85c14 0%, #f37022 100%);
  box-shadow: 0 6px 20px rgba(243, 112, 34, 0.35);
}

/* Terminal Card Styling */
.terminal-card {
  background: #06090e;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  height: 550px;
}

.terminal-header {
  background: #121820;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terminal-buttons {
  display: flex;
  gap: 8px;
}

.t-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.t-btn.close { background: #ff5f56; }
.t-btn.minimize { background: #ffbd2e; }
.t-btn.maximize { background: #27c93f; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.terminal-body {
  flex-grow: 1;
  padding: 16px;
  position: relative;
}

#copy-terminal-output,
#restore-terminal-output {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  resize: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #00ff66;
  line-height: 1.6;
  outline: none;
  scrollbar-width: thin;
  padding: 0;
  margin: 0;
}

#copy-terminal-output::placeholder,
#restore-terminal-output::placeholder {
  color: rgba(0, 255, 102, 0.25);
}

/* Animations */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .copy-main-content {
    grid-template-columns: 1fr;
  }
  .hub-cards-grid {
    grid-template-columns: 1fr;
    max-width: 450px;
  }
  .hub-container {
    padding: 20px;
  }
}

/* Diff Modal Value Styling for contrast/theme compatibility */
.diff-old-val {
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.25);
  color: #ff8888;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  text-decoration: line-through;
  word-break: break-all;
}
body.light-theme .diff-old-val {
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.2);
  color: #c0392b;
}

.diff-new-val {
  background: rgba(52, 152, 219, 0.12);
  border: 1px solid rgba(52, 152, 219, 0.25);
  color: #74b9ff;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  word-break: break-all;
}
body.light-theme .diff-new-val {
  background: rgba(52, 152, 219, 0.08);
  border: 1px solid rgba(52, 152, 219, 0.2);
  color: #2980b9;
}

.profile-detecting-info {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.search-backdrop-blur {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(9, 13, 22, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999; /* Overlay sidebar and top-bar */
  transition: var(--transition);
  animation: fadeIn 0.25s ease;
}
.state-diff-old {
  color: #ff6b6b;
  font-weight: 600;
  background: rgba(231, 76, 60, 0.05);
  display: block;
  padding: 2px 4px;
  border-radius: 2px;
  border-left: 3px solid #e74c3c;
  margin: 2px 0;
}
body.light-theme .state-diff-old {
  color: #c0392b;
  background: rgba(231, 76, 60, 0.03);
}

.state-diff-new {
  color: #54a0ff;
  font-weight: 600;
  background: rgba(52, 152, 219, 0.05);
  display: block;
  padding: 2px 4px;
  border-radius: 2px;
  border-left: 3px solid #3498db;
  margin: 2px 0;
}
body.light-theme .state-diff-new {
  color: #2980b9;
  background: rgba(52, 152, 219, 0.03);
}

/* Floating Search Popup Dropdown */
.top-bar-actions {
  position: relative;
}

.search-popup-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  max-width: 90%;
  background-color: rgba(22, 28, 45, 0.85); /* Premium glassmorphism dark */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 24px rgba(0, 188, 255, 0.15); /* glowing cyan shadow */
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 10000; /* Sit above the backdrop */
  padding: 24px;
  display: none; /* Toggled via JS */
  flex-direction: column;
  gap: 16px;
  animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.search-popup-container.active {
  display: flex;
}

body.light-theme .search-popup-container {
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 24px rgba(33, 138, 177, 0.1);
  color: var(--text-main);
}

.icon-btn-close-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.icon-btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  transform: scale(1.05);
}
body.light-theme .icon-btn-close-modal {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
}
body.light-theme .icon-btn-close-modal:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #000;
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: translate(-50%, -45%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.search-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.search-popup-header h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

/* Profile Badges */
.profile-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: var(--transition);
}

.profile-badge.badge-none {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.profile-badge.badge-neon {
  background: rgba(0, 188, 255, 0.15);
  color: #00d2ff;
  border: 1px solid rgba(0, 188, 255, 0.3);
  box-shadow: 0 0 10px rgba(0, 188, 255, 0.1);
}

.profile-badge.badge-onion {
  background: rgba(243, 112, 34, 0.15);
  color: #f37022;
  border: 1px solid rgba(243, 112, 34, 0.3);
  box-shadow: 0 0 10px rgba(243, 112, 34, 0.1);
}

.profile-badge.badge-arda {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.3);
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.1);
}

.button-group-search {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.button-group-search button {
  flex: 1;
  padding: 10px;
  font-size: 0.8rem;
}

.search-status-box {
  padding: 10px;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  line-height: 1.4;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  max-height: 120px;
  overflow-y: auto;
}

body.light-theme .search-status-box {
  background: hsl(224, 15%, 20%);
  border-color: hsl(224, 15%, 30%);
}

/* Loader Overlays & Progress Bars */
.loader-overlay-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  width: 100%;
  height: 100%;
  background-color: var(--bg-app);
  padding: 40px;
  box-sizing: border-box;
  animation: fadeIn 0.3s ease;
}

.loader-card {
  max-width: 480px;
  width: 100%;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loader-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

.loader-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Spinner Animation */
.loader-spinner-wrapper {
  position: relative;
  width: 70px;
  height: 70px;
  margin-bottom: 10px;
}

.loader-spinner {
  width: 100%;
  height: 100%;
  border: 4px solid rgba(243, 112, 34, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-spinner.deploy-spin {
  border-top-color: #3b82f6; /* Blue for deploy */
}

.loader-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  background-color: rgba(243, 112, 34, 0.1);
  border-radius: 50%;
  animation: pulse 1.5s ease-out infinite;
}

.loader-pulse.deploy-pulse {
  background-color: rgba(59, 130, 246, 0.1);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

/* Progress Bar */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #ff8c42 100%);
  border-radius: 4px;
  width: 0%;
  transition: width 0.4s ease;
}

.progress-bar-fill.deploy-fill {
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

.progress-bar-fill.animated-fill {
  /* Animate gradient shimmer */
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes slideDown {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(0); }
}

/* Glassmorphic Floating Toast Notification for Backup Status */
.backup-toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 245px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.backup-toast.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.backup-toast-content {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.backup-toast-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-grow: 1;
  min-width: 0;
}

.backup-toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  flex-shrink: 0;
}

.backup-toast-close:hover {
  background: var(--border);
  color: var(--text-main);
}

.backup-toast-body {
  font-size: 0.72rem;
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.backup-toast-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--bg-input);
  overflow: hidden;
}

.backup-toast-progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.3s ease;
}

/* Pulse shimmer during background work */
.backup-toast.running .backup-toast-progress-fill {
  background: linear-gradient(90deg, var(--primary) 0%, #3498db 50%, var(--primary) 100%);
  background-size: 200% 100%;
  animation: toastPulse 1.5s infinite linear;
}

@keyframes toastPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Monokai Theme for Code Editor and Preview */
.monokai-theme {
  background-color: #272822 !important;
  color: #f8f8f2 !important;
  font-family: 'Fira Code', var(--font-mono), monospace !important;
  font-size: 0.75rem !important;
  border: 1px solid #1e1f1c !important;
  border-radius: var(--radius-md) !important;
  text-shadow: none !important;
}

/* Pre-wrapper needs to use innerHTML instead of textContent if highlighted */
pre.code-wrapper.monokai-theme {
  white-space: pre !important;
  word-wrap: normal !important;
  color: #f8f8f2 !important;
}

/* Textarea editor in Monokai theme */
textarea#code-editor.monokai-theme {
  background-color: #272822 !important;
  color: #f8f8f2 !important;
  caret-color: #f8f8f2 !important;
  border: 1px solid #1e1f1c !important;
  outline: none !important;
}

/* Syntax highlight colors */
.mt-comment {
  color: #75715e !important;
  font-style: italic !important;
}
.mt-string {
  color: #e6db74 !important;
}
.mt-variable {
  color: #fd971f !important;
}
.mt-keyword {
  color: #f92672 !important;
  font-weight: bold !important;
}
.mt-tag {
  color: #a6e22e !important;
}
.mt-number {
  color: #ae81ff !important;
}
