/**
 * ReCalc URL Shortener - Styles
 * 
 * Dark theme with accent colors inspired by IDE themes.
 */

:root {
  --paper: #f7f5ef;
  --surface: #ffffff;
  --border: #c8d1db;
  --text: #1f2a36;
  --text-muted: #556576;
  --accent: #2d6cdf;
  --accent-glow: rgba(45, 108, 223, 0.18);
  --grid-light: rgba(60, 79, 99, 0.12);
  --grid-bold: rgba(60, 79, 99, 0.22);
  --error: #b42318;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f141b;
    --surface: #151c25;
    --border: #2c3948;
    --text: #e6edf3;
    --text-muted: #9aa6b2;
    --accent: #7fb0ff;
    --accent-glow: rgba(127, 176, 255, 0.22);
    --grid-light: rgba(127, 176, 255, 0.08);
    --grid-bold: rgba(127, 176, 255, 0.16);
    --error: #ff7b72;
  }
}

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

body {
  font-family: 'IBM Plex Sans', 'Inter', 'Segoe UI', system-ui, sans-serif;
  background-color: var(--paper);
  color: var(--text);
  min-height: 100vh;
  padding: 48px 20px;
  background-image:
    linear-gradient(90deg, var(--grid-bold) 1px, transparent 1px),
    linear-gradient(var(--grid-bold) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-light) 1px, transparent 1px),
    linear-gradient(var(--grid-light) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px;
}

body.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.container.narrow {
  max-width: 600px;
  text-align: center;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 32px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 12px 30px rgba(31, 42, 54, 0.08);
}

/* Form elements */
label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

textarea,
input[type="text"] {
  width: 100%;
  background: color-mix(in srgb, var(--surface) 88%, #fff 12%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
  font-size: 0.875rem;
  color: var(--text);
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea {
  height: 140px;
}

input[type="text"] {
  cursor: default;
}

/* Buttons */
.btn-row {
  display: flex;
  gap: 10px;
  margin: 20px 0;
}

button {
  flex: 1;
  padding: 12px 20px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #3f7ae3;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: color-mix(in srgb, var(--surface) 90%, #fff 10%);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--surface) 80%, #fff 20%);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Result display */
.result-link {
  display: block;
  padding: 16px;
  background: color-mix(in srgb, var(--surface) 88%, #fff 12%);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  word-break: break-all;
  color: var(--accent);
  min-height: 52px;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
}

/* Stats */
/* Status & errors */
.status {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.error {
  color: var(--error);
  font-size: 0.875rem;
  padding: 12px 16px;
  background: rgba(180, 35, 24, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(180, 35, 24, 0.25);
  margin-top: 16px;
}

/* URL preview */
/* Utilities */
.hidden {
  display: none;
}

/* Responsive */
@media (max-width: 480px) {
  .btn-row {
    flex-direction: column;
  }
}

