:root {
  --bg-color: #0b0f19;
  --card-bg: rgba(23, 32, 54, 0.75);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent-color: #f6821f; /* Cloudflare orange */
  --accent-hover: #fa9c49;
  --accent-glow: rgba(246, 130, 31, 0.25);
  --primary-btn: #2563eb;
  --primary-hover: #3b82f6;
  --code-bg: #070a13;
  --border-radius: 12px;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
  background-image: 
    radial-gradient(at 10% 10%, rgba(246, 130, 31, 0.07) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(37, 99, 235, 0.08) 0px, transparent 50%);
}

.app-container {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.25rem;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

.header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-badges {
  display: flex;
  gap: 0.5rem;
}

.badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-cf {
  background: rgba(246, 130, 31, 0.15);
  color: #fb923c;
  border: 1px solid rgba(246, 130, 31, 0.3);
}

.badge-zero {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Forms & Inputs */
.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.form-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
}

.controls-row {
  display: flex;
  gap: 0.5rem;
}

.input-select {
  background: rgba(11, 15, 25, 0.8);
  color: var(--text-main);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.input-select:focus {
  border-color: var(--accent-color);
}

.input-text {
  width: 100%;
  background: rgba(11, 15, 25, 0.8);
  color: var(--text-main);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
  outline: none;
}

.input-text:focus {
  border-color: var(--accent-color);
}

.editor-wrapper {
  margin-bottom: 0.85rem;
}

.editor-textarea {
  width: 100%;
  min-height: 240px;
  background: var(--code-bg);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  resize: vertical;
  line-height: 1.5;
  outline: none;
}

.editor-textarea:focus {
  border-color: rgba(246, 130, 31, 0.5);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Image Dropzone */
.image-dropzone {
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  text-align: center;
  background: rgba(7, 10, 19, 0.4);
  cursor: pointer;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}

.image-dropzone:hover {
  border-color: var(--accent-color);
  background: rgba(246, 130, 31, 0.05);
}

.dropzone-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dropzone-hint code {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.dropzone-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.dropzone-preview img {
  max-height: 100px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-remove-img {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font-size: 0.8rem;
}

/* Actions Footer */
.action-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.char-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-color), #ea580c);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--accent-glow);
  transition: transform 0.1s ease, filter 0.2s ease;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Detail View */
.back-link-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.detail-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.detail-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  border-radius: 6px;
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background 0.2s;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.15);
}

.detail-image-box {
  margin: 1.25rem 0;
  text-align: center;
}

.detail-image-box img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
}

.content-display-box {
  background: var(--code-bg);
  border-radius: 8px;
  border: 1px solid var(--card-border);
  overflow-x: auto;
  margin-top: 1rem;
}

.code-block {
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #e5e7eb;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Recent Pastes */
.recent-card {
  padding: 1.25rem;
}

.recent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.recent-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.btn-icon:hover {
  opacity: 1;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.85rem;
  background: rgba(11, 15, 25, 0.6);
  border-radius: 6px;
  border: 1px solid var(--card-border);
  text-decoration: none;
  color: var(--text-main);
  transition: background 0.15s, border-color 0.15s;
}

.recent-item:hover {
  background: rgba(246, 130, 31, 0.08);
  border-color: rgba(246, 130, 31, 0.3);
}

.recent-item-title {
  font-weight: 500;
  font-size: 0.9rem;
}

.recent-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
}

.loading-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
}

/* Footer */
.footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Responsive */
@media (max-width: 640px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .controls-row {
    width: 100%;
  }
  .input-select {
    flex: 1;
  }
  .detail-header {
    flex-direction: column;
    gap: 1rem;
  }
}
