/* ==========================================================================
   joshx.cc — Minimalist Developer Tooling Theme
   Inspired by Linear, Vercel, and Raycast
   ========================================================================== */

:root {
  --bg-primary: #09090b;
  --bg-surface: #121216;
  --bg-input: #0e0e11;
  --bg-muted: #18181b;
  --bg-active: #1f1f24;

  --border-subtle: #222227;
  --border-input: #27272a;
  --border-hover: #3f3f46;
  --border-focus: #52525b;

  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", Menlo, Monaco, Consolas, monospace;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --transition: 120ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Minimal Header */
header {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-tld {
  color: var(--text-muted);
}

/* Main */
main {
  flex: 1;
  padding: 44px 0 64px 0;
}

/* Hero */
.hero {
  margin-bottom: 28px;
}

.hero h1 {
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.hero p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Core Card Container */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-center {
  text-align: center;
  padding: 40px 24px;
}

.card-header {
  margin-bottom: 20px;
}

.card-header h2 {
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

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

/* Form Groups & Inputs */
.form-group {
  margin-bottom: 20px;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.char-counter {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

textarea.input-note {
  width: 100%;
  min-height: 130px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
}

textarea.input-note:focus,
input.input-text:focus,
input.input-mono:focus {
  border-color: var(--border-focus);
}

textarea.input-note::placeholder,
input::placeholder {
  color: var(--text-muted);
}

input.input-text {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition);
}

input.input-mono {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  outline: none;
  transition: border-color var(--transition);
}

/* Attachment Dropzone */
.dropzone {
  border: 1px dashed var(--border-input);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--transition);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.02);
}

.dropzone-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.dropzone-icon {
  color: var(--text-muted);
}

#file-input {
  display: none;
}

/* Attachment Preview Pill */
.attachment-preview {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-muted);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-top: 10px;
}

.attachment-preview.active {
  display: flex;
}

.attachment-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.attachment-thumb {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-input);
}

.attachment-details {
  display: flex;
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
}

.attachment-name {
  font-size: 0.82rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.attachment-size {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}

.btn-icon:hover {
  color: var(--text-primary);
}

/* Segmented Control (Lifespan Selector) */
.segmented-control {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.segment-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 7px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: all var(--transition);
}

.segment-btn:hover {
  color: var(--text-secondary);
}

.segment-btn.active {
  background: var(--bg-active);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Password Toggle & Field */
.password-toggle-group {
  margin-bottom: 22px;
  padding-top: 4px;
}

.accordion-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  transition: color var(--transition);
}

.accordion-toggle:hover {
  color: var(--text-secondary);
}

.chevron-icon {
  transition: transform var(--transition);
}

.password-toggle-group.open .chevron-icon {
  transform: rotate(90deg);
}

.password-field-container {
  display: none;
  margin-top: 10px;
}

.password-toggle-group.open .password-field-container {
  display: block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  user-select: none;
}

/* High-contrast professional monochrome action button */
.btn-primary {
  width: 100%;
  background: #f4f4f5;
  color: #09090b;
  border: 1px solid transparent;
  font-weight: 500;
}

.btn-primary:hover:not(:disabled) {
  background: #e4e4e7;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-muted);
  color: var(--text-primary);
  border: 1px solid var(--border-input);
}

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

.btn-danger-outline {
  background: transparent;
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-copy {
  min-width: 64px;
}

.btn-copy.copied {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}

/* Views Visibility Switching */
.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

/* Success View */
.link-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.action-row {
  display: flex;
  gap: 8px;
}

.action-row .btn {
  flex: 1;
}

.qr-container {
  display: none;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.qr-container.active {
  display: block;
}

.qr-box {
  display: inline-block;
  padding: 8px;
  background: #ffffff;
  border-radius: var(--radius-md);
}

/* Reveal / Decryption View */
.reveal-prompt {
  text-align: center;
  padding: 16px 0;
}

.reveal-prompt h2 {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.reveal-prompt .btn-primary {
  max-width: 280px;
  margin: 18px auto 0 auto;
}

.password-input-group {
  max-width: 320px;
  margin: 16px auto 0 auto;
  text-align: left;
}

.revealed-content {
  display: none;
}

.revealed-content.active {
  display: block;
}

.meta-status {
  margin-bottom: 14px;
}

.status-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.status-burned {
  background: rgba(244, 63, 94, 0.1);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.2);
}

.status-retained {
  background: rgba(161, 161, 170, 0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.note-output-wrap {
  position: relative;
  margin-bottom: 16px;
}

.note-output {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 380px;
  overflow-y: auto;
}

.btn-copy-inline {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  font-size: 0.75rem;
}

/* Decrypted Attachment */
.attachment-display {
  margin-top: 16px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.image-preview-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  text-align: center;
  margin-bottom: 12px;
}

.decrypted-image {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  cursor: pointer;
}

.attachment-file-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.file-details {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.file-name {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.file-size {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.reveal-footer {
  margin-top: 24px;
  text-align: center;
}

.link-subtle {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color var(--transition);
}

.link-subtle:hover {
  color: var(--text-primary);
}

/* Expired View */
.card-center h2 {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.card-center .btn {
  margin-top: 20px;
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #18181b;
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  padding: 9px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: toastIn 120ms ease;
}

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

/* Minimal Footer */
footer {
  border-top: 1px solid var(--border-subtle);
  padding: 20px 0;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 580px) {
  .segmented-control {
    flex-wrap: wrap;
  }
  .segment-btn {
    flex: 1 1 30%;
  }
  .action-row {
    flex-direction: column;
  }
}
