/* 🎨 doors.mom · style.css */
/* Deep Navy + Snow White · Zero Dependencies · Client-Side Only */

:root {
  --bg-primary: #0f1a24;
  --bg-secondary: #1a2634;
  --bg-tertiary: #233245;
  --text-primary: #f8f9fa;
  --text-secondary: #c5d1e0;
  --text-muted: #8a99ab;
  --accent: #4a6fa5;
  --accent-hover: #5a7fb5;
  --border: #2a3a4d;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1.7;
}

.container {
  max-width: 1000px;
  width: 100%;
  background: var(--bg-tertiary);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
}

/* 🌊 Header */
.header {
  background: linear-gradient(135deg, #162230 0%, #1e2b3a 100%);
  padding: 28px 24px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.header::after {
  content: "🕊️";
  position: absolute;
  top: 8px;
  right: 16px;
  opacity: 0.3;
  font-size: 1.2em;
}
.header h1 { font-size: 2.4em; margin-bottom: 6px; font-weight: 400; letter-spacing: 0.5px; }
.header h1 span { font-weight: 300; color: var(--accent); }

.multilingual-greeting {
  display: flex; justify-content: center; gap: 18px; flex-wrap: wrap;
  margin: 12px 0 8px; color: var(--text-muted); font-size: 0.9em; line-height: 1.5;
}
.header p {
  max-width: 580px; margin: 12px auto 0; font-size: 1.05em;
  color: var(--text-secondary); font-style: italic;
  border-top: 1px dashed var(--border); padding-top: 14px;
}

/* 📝 Main Content */
.main-content { padding: 24px; }
.story-section { margin-bottom: 16px; }

.story-input {
  width: 100%; min-height: 240px; padding: 20px 22px;
  border: 1px solid var(--border); border-radius: 16px;
  font-size: 16px; line-height: 1.7; resize: vertical;
  transition: border 0.2s, box-shadow 0.2s;
  background: var(--bg-primary); color: var(--text-primary);
}
.story-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.25);
}
.story-input::placeholder { color: var(--text-muted); }
.story-input code { background:var(--bg-secondary); padding:2px 5px; border-radius:4px; font-size:0.9em; }

/* 📊 Stats */
.stats-row {
  display: flex; gap: 12px; justify-content: flex-end;
  margin: 6px 0 16px; color: var(--text-muted); font-size: 0.85em; flex-wrap: wrap;
}
.stats-row span {
  background: var(--bg-primary); padding: 5px 12px;
  border-radius: 20px; border: 1px solid var(--border);
}

/* 🔘 Buttons */
.action-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 28px; }
.btn {
  border: none; background: var(--bg-primary); color: var(--text-primary);
  padding: 10px 18px; border-radius: 40px; font-size: 0.92em; font-weight: 500; cursor: pointer;
  transition: all 0.15s; display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border);
}
.btn:hover { background: var(--bg-secondary); border-color: var(--accent); transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.contact { background: linear-gradient(135deg, #2a4a6a 0%, #3a5a7a 100%); border-color: #4a6fa5; margin-left: auto; text-decoration: none; }
.btn.contact:hover { background: linear-gradient(135deg, #3a5a7a 0%, #4a6fa5 100%); }

/* 👁️ Preview & 💻 Code */
.preview-section, .code-section {
  background: var(--bg-primary); border-radius: 16px; padding: 20px 22px;
  margin: 16px 0; border: 1px solid var(--border);
}
.preview-section h3, .code-section h3 {
  color: var(--text-secondary); margin-bottom: 14px; font-size: 1.05em;
  font-weight: 400; display: flex; align-items: center; gap: 6px;
}
.preview-box {
  background: var(--bg-secondary); border: 1px dashed var(--border);
  border-radius: 12px; padding: 22px; min-height: 140px; line-height: 1.7;
  color: var(--text-primary);
}
.code-output {
  background: #0a1118; color: #a0d4b8; padding: 16px 18px; border-radius: 12px;
  font-family: 'Courier New', monospace; font-size: 13px; overflow-x: auto;
  white-space: pre-wrap; border: 1px solid var(--border); line-height: 1.5;
}

/* 🕊️ Footer */
.footer {
  background: linear-gradient(135deg, #162230 0%, #1a2634 100%);
  padding: 26px 24px 32px; text-align: center; border-top: 1px solid var(--border);
}
.gratitude { max-width: 620px; margin: 0 auto; }
.gratitude p { color: var(--text-secondary); line-height: 1.8; margin-bottom: 16px; font-style: italic; }
.gratitude strong { color: var(--text-primary); }

.multilingual-wishes {
  display: flex; justify-content: center; gap: 24px; flex-wrap: wrap;
  margin: 22px 0 14px; color: var(--text-muted); font-size: 0.95em;
}
.multilingual-wishes div { text-align: center; }
.wish-text { font-size: 1.15em; color: var(--text-primary); margin-bottom: 3px; }
.wish-language { font-size: 0.72em; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); }

.privacy-note {
  color: var(--text-muted); font-size: 0.82em; margin: 18px 0 0;
  border-top: 1px solid var(--border); padding-top: 18px; line-height: 1.6;
}
.privacy-badge {
  display: inline-block; background: var(--bg-primary); color: var(--text-secondary);
  padding: 3px 10px; border-radius: 20px; margin: 0 3px 4px;
  font-size: 0.82em; border: 1px solid var(--border);
}
.multilingual-welcome {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 0.68rem; color: var(--text-muted); display: flex;
  justify-content: center; gap: 10px; flex-wrap: wrap; line-height: 1.4;
}
.multilingual-welcome span { opacity: 0.9; }

/* 📱 Responsive */
@media (max-width: 640px) {
  .header h1 { font-size: 2em; }
  .action-buttons { justify-content: center; }
  .btn.contact { margin: 8px auto 0; display: flex; }
  .stats-row { justify-content: center; }
  .multilingual-greeting { gap: 12px; }
}

/* ♿ Accessibility & Motion */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: all 0.15s ease; }
  .container { animation: fadeIn 0.3s ease-out; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Toast Notification */
#saveToast {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--accent); color: #fff;
  padding: 8px 14px; border-radius: 20px;
  font-size: 0.85rem; opacity: 0; transition: opacity 0.3s ease;
  pointer-events: none; z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
