/* shared.css — Shared styles for Word Puzzle Utilities Suite */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #6c757d;
  --accent: #4361ee;
  --accent-hover: #3a56d4;
  --border: #dee2e6;
  --success: #2ecc71;
  --warning: #f39c12;
  --danger: #e74c3c;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --radius: 8px;
}

[data-theme="dark"] {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #1a1a2e;
  --text-primary: #e8e8e8;
  --text-secondary: #8892b0;
  --accent: #64dfdf;
  --accent-hover: #48c9c9;
  --border: #2d3748;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Layout */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
}

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

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.header button {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.9rem;
}

/* Card */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

/* Input */
.input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.1rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

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

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.97);
}

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

.btn-primary:hover {
  background: var(--accent-hover);
}

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

/* Stats bar */
.stats-bar {
  display: flex;
  gap: 1.5rem;
  padding: 0.75rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.stats-bar span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Results */
.results-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.results-list li {
  padding: 0.3rem 0.6rem;
  background: var(--bg-secondary);
  border-radius: 4px;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
}

.results-list li:hover {
  background: var(--accent);
  color: #fff;
}

.results-list .score {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: 0.3rem;
}

/* No results */
.no-results {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

/* Footer / back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 0;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  text-decoration: underline;
}

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

  .header h1 {
    font-size: 1.2rem;
  }

  .card {
    padding: 1rem;
  }
}