*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --border: #1e1e2e;
  --accent: #f97316;
  --accent2: #fb923c;
  --text: #e2e8f0;
  --muted: #4a5568;
  --green: #22d3a5;
  --yellow: #fbbf24;
  --red: #f87171;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 999;
  opacity: 0.4;
}

header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  animation: fadeDown 0.5s ease both;
}

.logo-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.85);
  }
}

.logo-text {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
}

.logo-text span {
  color: var(--accent);
}

.badge {
  margin-left: auto;
  font-size: 10px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
  animation: fadeUp 0.6s ease 0.1s both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.left-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 10px;
}

textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  padding: 16px;
  resize: vertical;
  min-height: 140px;
  line-height: 1.7;
  transition: border-color 0.2s;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
}
textarea::placeholder {
  color: var(--muted);
}

.input-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.btn-row {
  display: flex;
  gap: 10px;
}

button {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  transition: all 0.15s;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  flex: 1;
}

.btn-primary:hover {
  background: var(--accent2);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--muted);
  color: var(--text);
}

.output-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  min-height: 200px;
  position: relative;
  overflow: hidden;
}

.output-box.loading::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.output-empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 40px 0;
}

.output-empty .icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.summary-text {
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-wrap;
  animation: fadeUp 0.4s ease both;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 4px;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.right-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.clear-btn {
  font-size: 10px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 4px;
}

.clear-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
  padding-right: 4px;
}

.history-list::-webkit-scrollbar {
  width: 4px;
}
.history-list::-webkit-scrollbar-track {
  background: transparent;
}
.history-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
  animation: fadeUp 0.3s ease both;
}

.history-card:hover {
  border-color: var(--accent);
}

.history-date {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.history-preview {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-empty {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 32px 0;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.status-bar {
  padding: 10px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 20px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

@media (max-width: 768px) {
  main {
    grid-template-columns: 1fr;
  }
  .right-panel {
    order: -1;
  }
  .history-list {
    max-height: 200px;
  }
}
