/* JetBrains Mono Font */
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/JetBrainsMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/JetBrainsMono-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/JetBrainsMono-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

:root {
  /* Soft pastel colors inspired by noahstokes.com */
  --primary: hsl(25, 85%, 75%);
  --primary-dark: hsl(25, 85%, 65%);
  --secondary: hsl(200, 75%, 70%);
  --accent: hsl(340, 75%, 75%);
  --bg: hsl(30, 30%, 97%);
  --surface: hsl(0, 0%, 100%);
  --border: hsl(30, 15%, 88%);
  --text: hsl(30, 10%, 20%);
  --text-muted: hsl(30, 8%, 50%);
  --success: hsl(145, 60%, 55%);
  --error: hsl(5, 75%, 65%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --radius: 0.5rem;
  --radius-sm: 0.375rem;
}

[data-theme="dark"] {
  --primary: hsl(25, 75%, 65%);
  --primary-dark: hsl(25, 75%, 55%);
  --secondary: hsl(200, 65%, 60%);
  --accent: hsl(340, 65%, 65%);
  --bg: hsl(240, 10%, 10%);
  --surface: hsl(240, 8%, 14%);
  --border: hsl(240, 8%, 22%);
  --text: hsl(30, 10%, 92%);
  --text-muted: hsl(30, 5%, 60%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.7);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter",
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
  min-height: 100vh;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

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

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover {
  background: var(--bg);
  border-color: var(--text-muted);
}

.btn.active {
  background: var(--primary);
  color: hsl(30, 10%, 20%);
  border-color: var(--primary);
  font-weight: 600;
}

.btn-primary {
  background: var(--primary);
  color: hsl(30, 10%, 20%);
  border: 1px solid var(--primary);
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 500;
  color: var(--text);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--text-muted);
} /* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: 420px 1fr;
    grid-template-rows: auto auto 1fr;
    gap: 1.5rem;
  }

  .grid > .card:first-child {
    grid-row: 1 / 4;
    grid-column: 1;
  }

  .grid > .card:nth-child(2) {
    grid-row: 1 / 2;
    grid-column: 2;
  }

  .grid > .card:nth-child(3) {
    grid-row: 2 / 4;
    grid-column: 2;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.card:hover {
  border-color: hsl(30, 15%, 80%);
  box-shadow: var(--shadow-md);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 0.375rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab:hover {
  color: var(--text);
  background: var(--surface);
}

.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.625rem;
  color: var(--text);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9375rem;
  font-family: "JetBrains Mono", "Monaco", "Menlo", "Consolas", monospace;
  transition: all 0.15s ease;
}

textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px hsla(25, 85%, 75%, 0.15);
}

.help-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* Method Info */
.method-info {
  background: var(--bg);
  border-left: 2px solid var(--primary);
  padding: 0.875rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text);
}

[data-theme="dark"] .method-info {
  background: hsla(240, 8%, 18%, 0.5);
}

.method-info strong {
  color: var(--primary);
  display: block;
  margin-bottom: 0.375rem;
}

/* Expandable Details */
details {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

summary {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "▶";
  font-size: 0.75rem;
  transition: transform 0.2s;
}

details[open] summary::before {
  transform: rotate(90deg);
}

details p {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Output */
.output-box {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  font-family: "JetBrains Mono", "Monaco", "Menlo", "Consolas", monospace;
  font-size: 0.875rem;
  word-break: break-all;
  max-height: 400px;
  overflow-y: auto;
  color: var(--text);
}

.output-box::-webkit-scrollbar {
  width: 8px;
}

.output-box::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}

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

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

/* Process Log */
.process-log {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  font-size: 0.875rem;
  max-height: 600px;
  overflow-y: auto;
  line-height: 1.8;
}

.process-log h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.process-log h3:first-child {
  margin-top: 0;
}

.process-log strong {
  color: var(--text);
  font-weight: 600;
}

.process-log code {
  background: var(--surface);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.8125rem;
  font-family: "JetBrains Mono", "Monaco", "Menlo", "Consolas", monospace;
  color: var(--primary);
  border: 1px solid var(--border);
}

.process-log p {
  margin-bottom: 0.625rem;
  color: var(--text-muted);
}

.process-log hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* Credit */
.credit {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
}

.credit a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.credit a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Success/Error Messages */
.message {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.message-success {
  background: hsla(142, 70%, 50%, 0.1);
  color: var(--success);
  border: 1.5px solid hsla(142, 70%, 50%, 0.3);
}

.message-error {
  background: hsla(0, 70%, 60%, 0.1);
  color: var(--error);
  border: 1.5px solid hsla(0, 70%, 60%, 0.3);
}

/* Loading State */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Responsive */
@media (max-width: 767px) {
  .container {
    padding: 1rem;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .card {
    padding: 1.5rem;
  }

  .grid {
    gap: 1.5rem;
  }
}

/* Alert System */
.vibe-alert {
  position: fixed;
  top: 2rem;
  right: 2rem;
  max-width: 420px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vibe-alert.show {
  opacity: 1;
  transform: translateX(0);
}

.vibe-alert-content {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
}

.vibe-alert-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.vibe-alert-message {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
}

.vibe-alert-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.vibe-alert-close:hover {
  background: var(--bg);
  color: var(--text);
}

.vibe-alert-error {
  border-color: var(--error);
}

.vibe-alert-error .vibe-alert-icon {
  color: var(--error);
}

.vibe-alert-success {
  border-color: var(--success);
}

.vibe-alert-success .vibe-alert-icon {
  color: var(--success);
}

@media (max-width: 767px) {
  .vibe-alert {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
}

/* Utilities */
.hidden {
  display: none !important;
}

.w-full {
  width: 100%;
}

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

.mb-2 {
  margin-bottom: 0.5rem;
}

.gap-2 {
  gap: 0.5rem;
}

.flex {
  display: flex;
}

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

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

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

/* LSB Image Upload Styles */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg);
  margin-top: 0.5rem;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary);
  background: var(--surface);
  transform: translateY(-2px);
}

.upload-icon {
  width: 3rem;
  height: 3rem;
  color: var(--primary);
  margin: 0 auto 1rem;
  display: block;
}

.upload-text {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.preview-section {
  text-align: center;
  margin-top: 0.5rem;
}

#imagePreview {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.preview-section .btn-secondary {
  width: 100%;
}
