/* ===== Design System Variables ===== */
:root {
  /* Deep ocean palette */
  --bg-deep:    #0b1628;
  --bg-mid:     #0f2a3f;
  --bg-surface: #1a3a4a;
  --bg-card:    rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-input:   rgba(255, 255, 255, 0.06);
  --bg-input-focus: rgba(255, 255, 255, 0.10);

  /* Accent colors */
  --coral:        #ff6f59;
  --coral-hover:  #ff8a75;
  --coral-active: #e05d49;
  --coral-glow:   rgba(255, 111, 89, 0.15);
  --aqua:         #22d3ee;
  --aqua-hover:   #06b6d4;
  --aqua-dim:     #0ea5e9;
  --aqua-glow:    rgba(34, 211, 238, 0.12);

  /* Text */
  --text-primary:   #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-bright:    #f8fafc;

  /* Borders */
  --border:       rgba(34, 211, 238, 0.10);
  --border-focus: rgba(34, 211, 238, 0.35);
  --border-card:  rgba(255, 255, 255, 0.08);

  /* Utility */
  --error:   #fb7185;
  --success: #34d399;

  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-serif:   'Playfair Display', Georgia, serif;

  /* Motion */
  --ease:      all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-fast: all 0.15s ease;
}

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

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ===== Global Utilities ===== */
.hidden { display: none !important; }

/* ===== Background — Deep Ocean ===== */
.background-container {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(34,211,238,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(255,111,89,0.04) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 40%, var(--bg-surface) 100%);
}

.ocean-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(34,211,238,0.03) 0%, transparent 40%),
    linear-gradient(0deg, rgba(255,111,89,0.02) 0%, transparent 30%);
  pointer-events: none;
}

/* Bubbles — more visible on dark */
.bubbles-container { position: absolute; inset: 0; pointer-events: none; }

.bubble {
  position: absolute; bottom: -30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.15) 0%, rgba(34,211,238,0.06) 70%);
  border: 1px solid rgba(34,211,238,0.12);
  animation: floatUp 14s linear infinite;
}

@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  8%   { opacity: 0.6; }
  92%  { opacity: 0.6; }
  100% { transform: translateY(-110vh) translateX(40px); opacity: 0; }
}

/* ===== Demo Banner ===== */
.demo-banner {
  width: 100%;
  background: rgba(34, 211, 238, 0.06);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px; text-align: center;
  font-size: 0.82rem; color: var(--aqua);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(12px);
  animation: slideDown 0.4s ease;
}

.banner-content { display: flex; align-items: center; justify-content: center; gap: 8px; }
.banner-icon { width: 15px; height: 15px; color: var(--aqua); }
.banner-content code {
  background: rgba(34,211,238,0.08); padding: 2px 5px; border-radius: 3px;
  color: var(--coral); font-size: 0.78rem;
}

@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* ===== Layout ===== */
.app-container {
  max-width: 660px; width: 100%; margin: 0 auto;
  padding: 36px 20px; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 1;
}

/* ===== Entrance Animations ===== */
.app-header {
  text-align: center; margin-bottom: 32px;
  animation: entranceFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.oracle-card {
  animation: entranceSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.app-footer {
  animation: entranceFade 0.6s ease 0.4s both;
}

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

@keyframes entranceSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Header ===== */
.mascot-wrapper {
  position: relative;
  width: 190px; height: 190px;
  margin: 0 auto 14px;
  border-radius: 50%;
  overflow: hidden;
}

.mascot-img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: transparent;
  border: none;
  position: relative; z-index: 2;
  box-shadow: none;
  animation: mascotFloat 5s ease-in-out infinite;
  transition: transform 0.35s cubic-bezier(0.175,0.885,0.32,1.275);
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.3));
}

.mascot-img:hover {
  transform: scale(1.06) rotate(2deg);
}

.mascot-glow {
  position: absolute; inset: -12px; border-radius: 50%;
  background: radial-gradient(circle, var(--aqua) 0%, transparent 70%);
  opacity: 0.12; z-index: 1;
  animation: pulseGlow 5s ease-in-out infinite;
}

@keyframes mascotFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.10; transform: scale(1); }
  50%      { opacity: 0.22; transform: scale(1.08); }
}

.site-title {
  font-family: var(--font-display);
  font-size: 2.8rem; font-weight: 800;
  background: linear-gradient(135deg, var(--text-bright) 30%, var(--aqua) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.8px; margin-bottom: 4px;
}

.site-tagline {
  font-family: var(--font-serif);
  font-size: 1.15rem; font-weight: 500;
  color: var(--text-secondary);
  font-style: italic;
}

/* ===== Oracle Card — glassmorphism on dark ===== */
.oracle-card {
  width: 100%; border-radius: 22px; position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  box-shadow:
    0 24px 48px rgba(0,0,0,0.25),
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 1px 0 rgba(255,255,255,0.05) inset;
  backdrop-filter: blur(20px);
  overflow: hidden;
}

/* Subtle top highlight for glass effect */
.oracle-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 10%, rgba(255,255,255,0.1) 50%, transparent 90%);
  z-index: 1;
}

.card-content { padding: 32px; position: relative; }

.prompt-title {
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 700;
  color: var(--text-bright); letter-spacing: -0.2px;
  margin-bottom: 16px;
}

/* ===== Input ===== */
.input-group { position: relative; margin-bottom: 14px; }

#question-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border); border-radius: 12px;
  padding: 14px 14px 30px; font-family: var(--font-body);
  font-size: 1rem; color: var(--text-primary);
  resize: none; outline: none;
  transition: var(--ease);
}

#question-input::placeholder { color: var(--text-muted); }

#question-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--aqua-glow);
  background: var(--bg-input-focus);
}

.char-counter {
  position: absolute; bottom: 10px; right: 14px;
  font-size: 0.72rem; color: var(--text-muted); pointer-events: none;
}



/* ===== Action Row ===== */
.action-container {
  display: flex; justify-content: flex-end; align-items: center;
}

/* Feed the Lobster — subtle text link */
.feed-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--text-muted); font-size: 0.82rem; font-weight: 500;
  text-decoration: none; transition: var(--ease-fast);
}

.feed-link:hover { color: var(--coral); }
.feed-link-icon { width: 14px; height: 14px; }

/* Ask Button — punchy on dark */
.ask-btn {
  background: linear-gradient(135deg, var(--coral) 0%, #ff8a65 100%);
  color: #fff; border: none; border-radius: 12px;
  padding: 13px 26px;
  font-family: var(--font-display); font-size: 1.02rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; position: relative;
  box-shadow: 0 4px 20px rgba(255,111,89,0.30), 0 0 0 1px rgba(255,255,255,0.06) inset;
  transition: var(--ease);
}

.ask-btn:hover {
  background: linear-gradient(135deg, var(--coral-hover) 0%, #ffab91 100%);
  box-shadow: 0 8px 28px rgba(255,111,89,0.40);
  transform: translateY(-2px);
}
.ask-btn:active { background: var(--coral-active); transform: translateY(0); }
.ask-btn:disabled {
  background: var(--text-muted); cursor: not-allowed;
  box-shadow: none; transform: none; opacity: 0.4;
}

.btn-icon { width: 16px; height: 16px; transition: var(--ease); }
.ask-btn:hover .btn-icon { transform: translateX(2px) translateY(-1px); }

.btn-spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Remaining Questions Counter ===== */
.questions-counter {
  text-align: center; margin-top: 14px;
  font-size: 0.78rem; font-weight: 500;
  color: var(--text-muted);
  transition: color 0.3s ease;
  animation: fadeIn 0.4s ease;
}

.questions-counter.low {
  color: var(--coral);
}

.questions-counter .counter-num {
  font-weight: 700;
  font-family: var(--font-display);
}

/* ===== Output Section ===== */
.output-wrapper { margin-top: 28px; }

.output-divider {
  height: 1px; margin-bottom: 22px;
  background: linear-gradient(90deg, transparent 0%, var(--border) 20%, var(--border) 80%, transparent 100%);
}

/* Greeting State */
.greeting-state {
  text-align: center; padding: 12px 0 4px;
  animation: fadeIn 0.6s ease;
}

/* Crossfade support */
.greeting-state.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

.greeting-text {
  font-family: var(--font-serif); font-style: italic;
  font-size: 1.05rem; line-height: 1.6; color: var(--text-secondary);
}

.greeting-signoff {
  font-family: var(--font-serif); font-style: italic;
  font-size: 0.9rem; color: var(--coral); margin-top: 6px;
}

/* Response State */
.response-state {
  animation: fadeIn 0.4s ease;
}

.response-state.fade-in {
  animation: fadeIn 0.4s ease;
}

.output-header {
  margin-bottom: 6px;
}

.output-label {
  font-family: var(--font-display); font-size: 0.8rem; font-weight: 700;
  color: var(--aqua); letter-spacing: 0.8px; text-transform: uppercase;
}

/* ===== Share Bar — simplified actions ===== */
.share-bar {
  display: flex; gap: 8px; width: 100%;
  margin-top: 18px; margin-bottom: 8px;
  animation: shareSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.share-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 20px; padding: 10px 16px; font-size: 0.8rem; font-weight: 700;
  font-family: var(--font-display); cursor: pointer; transition: var(--ease-fast);
  white-space: nowrap; line-height: 1; text-transform: uppercase; letter-spacing: 0.5px;
}
.share-btn:hover { transform: translateY(-1.5px); }
.share-btn:active { transform: translateY(0); }

.share-btn-icon { width: 14px; height: 14px; flex-shrink: 0; }

.share-btn-text {
  background: transparent; color: var(--text-secondary);
  border: 1.5px solid rgba(255,255,255,0.12);
}
.share-btn-text:hover {
  border-color: var(--aqua); color: var(--text-primary);
  background: rgba(34,211,238,0.06);
}
.share-btn-text.copied {
  border-color: var(--success); color: var(--success);
  background: rgba(52,211,153,0.06);
}

.share-btn-card {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-hover) 100%);
  color: var(--text-bright); border: none;
  box-shadow: 0 4px 12px rgba(255,111,89,0.15);
}
.share-btn-card:hover {
  box-shadow: 0 6px 18px rgba(255,111,89,0.3);
  filter: brightness(1.05);
}

/* Toast notification */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: rgba(255,255,255,0.12); color: #fff;
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 10px 20px; border-radius: 20px;
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Loading */
.loading-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 28px 0;
}

.wave-loader { display: flex; gap: 5px; margin-bottom: 10px; }

.wave-loader span {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--aqua);
  animation: loaderWave 1.2s infinite ease-in-out;
}

.wave-loader span:nth-child(2) { animation-delay: 0.2s; background: var(--coral); }
.wave-loader span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loaderWave {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.loading-text { font-size: 0.88rem; color: var(--text-secondary); font-style: italic; }

/* ===== Advice Card — elevated, warm, screenshot-worthy ===== */
.advice-card {
  background: linear-gradient(135deg, rgba(255,111,89,0.06) 0%, rgba(34,211,238,0.03) 100%);
  border-left: 3px solid var(--coral);
  border-radius: 4px 14px 14px 4px;
  padding: 26px 24px 20px 28px;
  position: relative;
  animation: adviceReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  border-top: 1px solid rgba(255,255,255,0.04);
  border-right: 1px solid rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

@keyframes adviceReveal {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Decorative quotation mark — more visible */
.advice-card::before {
  content: '\201C';
  position: absolute; top: 6px; left: 12px;
  font-family: var(--font-serif); font-size: 4rem; line-height: 1;
  color: rgba(255,111,89,0.20); pointer-events: none;
}

.advice-body {
  font-size: 1.08rem; line-height: 1.75;
  color: var(--text-primary);
  padding-left: 10px;
}

/* The signature */
.advice-signoff {
  font-family: var(--font-serif); font-style: italic;
  font-size: 0.9rem; color: var(--coral);
  margin-top: 14px; padding-left: 10px;
  opacity: 0;
  animation: signoffFade 0.6s ease 0.2s forwards;
}

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

/* ===== Modals — dark theme ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  animation: modalFadeIn 0.2s ease;
}

.modal-content {
  background: linear-gradient(180deg, #1e293b 0%, #162032 100%);
  border-radius: 18px; padding: 32px;
  max-width: 420px; width: 90%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06) inset;
  border: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  animation: modalSlideUp 0.3s cubic-bezier(0.16,1,0.3,1) forwards;
  transform: translateY(16px);
}

@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSlideUp { to { transform: translateY(0); } }

.modal-icon-wrapper {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}

.modal-icon { width: 24px; height: 24px; }
.modal-icon-aqua    { background: rgba(34,211,238,0.1);   color: var(--aqua); }
.modal-icon-coral   { background: rgba(255,111,89,0.1);   color: var(--coral); }
.modal-icon-success { background: rgba(52,211,153,0.1);   color: var(--success); }

.modal-content h3 {
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 700;
  margin-bottom: 8px; color: var(--text-bright);
}

.modal-content p {
  color: var(--text-secondary); font-size: 0.92rem; line-height: 1.5;
  margin-bottom: 22px;
}

/* Tip Options */
.tip-container { margin-bottom: 18px; }

.tip-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--coral) 0%, #ff8a65 100%);
  color: #fff; border: none; border-radius: 12px;
  padding: 13px 26px;
  font-family: var(--font-display); font-size: 1.02rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  cursor: pointer; position: relative;
  box-shadow: 0 4px 20px rgba(255,111,89,0.30), 0 0 0 1px rgba(255,255,255,0.06) inset;
  transition: var(--ease);
}

.tip-btn-primary:hover {
  background: linear-gradient(135deg, var(--coral-hover) 0%, #ffab91 100%);
  box-shadow: 0 8px 28px rgba(255,111,89,0.40);
  transform: translateY(-2px);
}

.tip-btn-primary:active {
  transform: translateY(0);
}

/* Close & Success Buttons */
.modal-close-btn {
  background: transparent; border: none;
  color: var(--text-muted); font-size: 0.82rem; font-weight: 500;
  cursor: pointer; padding: 5px 10px; transition: var(--ease-fast);
}
.modal-close-btn:hover { color: var(--text-primary); }

.success-ok-btn {
  background: linear-gradient(135deg, var(--success) 0%, #10b981 100%);
  color: #fff; border: none;
  border-radius: 10px; padding: 11px 22px;
  font-family: var(--font-display); font-weight: 700; width: 100%;
  cursor: pointer; box-shadow: 0 4px 16px rgba(52,211,153,0.25);
  transition: var(--ease);
}
.success-ok-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(52,211,153,0.35); }

/* ===== Footer ===== */
.app-footer { text-align: center; margin-top: 36px; color: var(--text-muted); font-size: 0.82rem; }
.footer-links { margin-top: 6px; }
.footer-links a { color: var(--coral); text-decoration: none; font-weight: 600; font-size: 0.82rem; transition: var(--ease-fast); }
.footer-links a:hover { color: var(--coral-hover); text-decoration: underline; }

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-6px); }
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .app-container { padding: 20px 12px; }
  .card-content  { padding: 20px; }
  .site-title    { font-size: 2.2rem; }
  .mascot-wrapper { width: 140px; height: 140px; }
  .oracle-card { border-radius: 16px; }
  .site-tagline  { font-size: 1rem; }
  .greeting-text { font-size: 0.95rem; }
  .advice-body   { font-size: 0.98rem; }
  .action-container { flex-direction: column-reverse; gap: 12px; align-items: stretch; }
  .ask-btn { width: 100%; justify-content: center; }
  .feed-link { justify-content: center; }

  .share-bar { flex-direction: column; gap: 8px; width: 100%; }
  .share-btn { width: 100%; }
}

/* Suggestion Chips */
.suggestion-chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; margin-bottom: 22px;
}

.chip-btn {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px; padding: 6px 14px;
  font-family: var(--font-main); font-size: 0.82rem; font-weight: 500;
  color: var(--text-secondary); cursor: pointer; transition: var(--ease-fast);
}

.chip-btn:hover {
  background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.18);
  color: var(--text-bright); transform: translateY(-1px);
}

.chip-btn:active {
  transform: translateY(0);
}

/* Subtagline */
.site-subtagline {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 5px;
  font-weight: 400;
  letter-spacing: 0.2px;
}

/* Feed Link Wrapper inside Advice Card */
.feed-link-wrapper {
  display: flex; justify-content: center; margin-top: 20px; border-top: 1px dashed rgba(255,255,255,0.08); padding-top: 15px;
}

/* Footnote at bottom */
.app-footer .footnote {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-style: italic;
}

/* Tablet range */
@media (min-width: 601px) and (max-width: 1024px) {
  .app-container { padding: 32px 24px; }
}
