/* FourPlus - Dual Theme Support */

/* Dark Theme (default) */
:root {
  /* Color palette */
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2a2a2a;
  --text-primary: #e8e8e8;
  --text-secondary: #a8a8a8;
  --text-muted: #6a6a6a;
  --accent: #10a2f5;
  --accent-hover: #0d8bd8;
  --success: #24d05a;
  --warning: #e9bc3f;
  --error: #eb4888;
  --border: #2a2a2a;
}

/* Light Theme */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --text-primary: #1a1a1a;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --accent: #0d8bd8;
  --accent-hover: #0a6eaa;
  --success: #28a745;
  --warning: #ffc107;
  --error: #dc3545;
  --border: #dee2e6;
}

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

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

.container {
  max-width: 768px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

code, .mono {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.9em;
}

/* Header */
header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  margin-bottom: 2rem;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 768px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

nav .logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

nav .logo:hover {
  text-decoration: none;
  color: var(--accent);
}

nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

nav a {
  color: var(--text-secondary);
}

nav a:hover {
  color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:hover {
  background-color: var(--accent-hover);
  transform: scale(1.01);
  text-decoration: none;
  color: var(--bg-primary);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--bg-secondary);
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  display: block;
}

input, textarea {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
}

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

textarea {
  min-height: 200px;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  line-height: 1.5;
}

/* Recipe Cards */
.recipe-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.recipe-card:hover {
  border-color: var(--accent);
}

.recipe-card h3 {
  margin-bottom: 0.5rem;
}

.recipe-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.recipe-meta code {
  color: var(--text-secondary);
}

/* Recipe Detail */
.recipe-header {
  border-bottom: 2px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.recipe-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

.recipe-status.pending {
  background-color: var(--warning);
  color: var(--bg-primary);
}

.recipe-status.processed {
  background-color: var(--success);
  color: var(--bg-primary);
}

.recipe-status.failed {
  background-color: var(--error);
  color: var(--text-primary);
}

/* CLI-inspired tables */
.ingredients-table {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.9rem;
  margin: 1.5rem 0;
}

.ingredients-table h3 {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.ingredients-table hr {
  border: none;
  border-top: 1px solid var(--border);
  margin-bottom: 1rem;
}

.ingredients-table ul {
  list-style: none;
  padding-left: 1rem;
}

.ingredients-table li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.ingredients-table li span {
  color: var(--text-primary);
}

/* Instructions */
.instructions {
  margin: 2rem 0;
}

.instructions h3 {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.instructions hr {
  border: none;
  border-top: 1px solid var(--border);
  margin-bottom: 1rem;
}

.instructions ol {
  padding-left: 2rem;
}

.instructions li {
  margin-bottom: 1rem;
  line-height: 1.7;
}

/* Raw text display */
.raw-text {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  margin: 2rem 0;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Loading states */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

/* Error messages */
.error {
  background-color: rgba(235, 72, 136, 0.1);
  border: 1px solid var(--error);
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
  color: var(--error);
}

/* Success messages */
.success {
  background-color: rgba(36, 208, 90, 0.1);
  border: 1px solid var(--success);
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
  color: var(--success);
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  width: 36px;
  height: 36px;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* Logo Styles */
.logo-img {
  height: 32px;
  width: auto;
  vertical-align: middle;
}

/* Hide/show logos based on theme */
[data-theme="light"] .logo-dark {
  display: none;
}

[data-theme="dark"] .logo-light,
:root:not([data-theme]) .logo-light {
  display: none;
}

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

  nav {
    flex-direction: column;
    gap: 1rem;
  }

  nav ul {
    gap: 1rem;
  }
}
