@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;800&display=swap');

/* ─── CSS Variables ─── */
:root {
  --bg: #212121;
  --bg-secondary: #2f2f2f;
  --bg-input: #2f2f2f;
  --bg-hover: #3a3a3a;
  --text-primary: #ececec;
  --text-muted: #8e8ea0;
  --border: #3f3f3f;
  --accent: #10a37f;
  --accent-hover: #0d9172;
  --send-bg: #ececec;
  --send-color: #212121;
  --logo-bg: #19c37d;
  --bubble-bg: #2f2f2f;
  --result-bg: #2a2a2a;
  --result-border: #3f3f3f;
  --result-link: #10a37f;
}

[data-theme="light"] {
  --bg: #f9f9f9;
  --bg-secondary: #ffffff;
  --bg-input: #ffffff;
  --bg-hover: #f0f0f0;
  --text-primary: #0d0d0d;
  --text-muted: #6e6e80;
  --border: #e0e0e0;
  --accent: #10a37f;
  --accent-hover: #0d9172;
  --send-bg: #10a37f;
  --send-color: #ffffff;
  --logo-bg: #10a37f;
  --bubble-bg: #f0f0f0;
  --result-bg: #f0faf7;
  --result-border: #b3dfd3;
  --result-link: #0d9172;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

.hidden { display: none !important; }

/* ─── Theme Toggle ─── */
.theme-toggle-btn {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  z-index: 100;
}

.theme-toggle-btn button {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 9999px;
  padding: 0.4rem 0.75rem;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: background 0.2s;
}

.theme-toggle-btn button:hover { background: var(--bg-hover); }

[data-theme="dark"] .icon-sun,
[data-theme="light"] .icon-moon { display: none; }

/* ─── Logo Badge ─── */
.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--logo-bg);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.logo-badge.small {
  width: 32px;
  height: 32px;
  font-size: 0.7rem;
}

/* ─── HOME SCREEN ─── */
.home-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 1rem;
}

.home-topbar {
  height: 52px;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.home-main {
  flex: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
}

.home-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  text-align: center;
}

.home-title {
  font-size: clamp(1.8rem, 4vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.home-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 420px;
}

/* ─── Input Area ─── */
.input-area {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

.input-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 0.7rem 0.7rem 0.7rem 1.05rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input-wrapper:focus-within {
  border-color: var(--accent);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.15);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  resize: none;
  min-width: 0;
}

.chat-input::placeholder { color: var(--text-muted); }

.send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  background: var(--send-bg);
  color: var(--send-color);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, opacity 0.2s;
}

.send-btn:hover { background: var(--accent); color: #fff; }

.input-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 560px;
}

/* ─── Result Box ─── */
.result-box {
  width: 100%;
  max-width: 760px;
  background: var(--result-bg);
  border: 1px solid var(--result-border);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  word-break: break-all;
  line-height: 1.6;
  display: none;
}

.result-box:not(:empty) { display: block; }

.result-header {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.8rem;
}

.result-header strong {
  font-size: 0.96rem;
  font-weight: 700;
}

.result-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.result-url-wrap {
  border: 1px solid var(--result-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-secondary) 70%, transparent);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.result-url-base {
  font-size: 0.74rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-url-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--result-link);
  font-family: inherit;
  font-size: 0.88rem;
}

.result-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.result-btn {
  border-radius: 9999px;
  border: 1px solid var(--border);
  padding: 0.44rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}

.result-btn:hover {
  transform: translateY(-1px);
}

.result-btn-copy {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.result-btn-copy:hover {
  background: var(--bg-hover);
}

.result-btn-open {
  background: var(--result-link);
  color: #ffffff;
  border-color: var(--result-link);
}

.result-btn-open:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

@media (max-width: 520px) {
  .result-actions {
    flex-direction: column;
  }

  .result-btn {
    width: 100%;
    text-align: center;
  }
}

.home-footer {
  width: 100%;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.74rem;
  padding-bottom: 0.75rem;
}

/* ─── ANIMATION SCREEN ─── */
.anim-screen {
  min-height: 100vh;
  display: flex;
  background: #f5f5f5;
  padding: 2px;
}

.mode-anim .theme-toggle-btn {
  display: none;
}

.anim-sidebar {
  width: 242px;
  border: 1px solid #dfdfdf;
  border-right: none;
  border-radius: 10px 0 0 10px;
  background: #ebebeb;
  padding: 10px 12px 10px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #232323;
}

.anim-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.anim-side-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.anim-side-brand {
  display: flex;
  align-items: center;
}

.anim-swirl {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.anim-collapse {
  width: 25px;
  height: 25px;
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  background: #efefef;
  color: #646464;
  font-size: 0.78rem;
}

.anim-side-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.anim-side-menu span,
.anim-side-bottom span {
  font-size: 0.95rem;
  padding: 7px 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.anim-side-menu i,
.anim-side-bottom i {
  width: 14px;
  display: inline-flex;
  justify-content: center;
  font-style: normal;
  font-size: 0.8rem;
  color: #4d4d4d;
}

.anim-side-menu span:hover,
.anim-side-bottom span:hover {
  background: #e2e2e2;
}

.anim-side-bottom {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.anim-side-card {
  margin-top: 8px;
  border-top: 1px solid #d2d2d2;
  padding: 14px 8px 6px;
}

.anim-side-card strong {
  display: block;
  font-size: 1.02rem;
  line-height: 1.35;
  color: #1f1f1f;
  margin-bottom: 10px;
}

.anim-side-card p {
  color: #707070;
  font-size: 0.86rem;
  line-height: 1.45;
}

.anim-enter-side {
  margin-top: 14px;
  height: 36px;
  border: 1px solid #d5d5d5;
  border-radius: 9999px;
  background: #f7f7f7;
  font-weight: 600;
}

.anim-main {
  flex: 1;
  border: 1px solid #dfdfdf;
  border-radius: 0 10px 10px 0;
  background: #f7f7f7;
  display: flex;
  flex-direction: column;
}

.anim-header {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px 0 18px;
}

.anim-title-top {
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: #1f1f1f;
}

.anim-title-top span {
  font-size: 0.9rem;
  color: #666;
  vertical-align: middle;
  margin-left: 3px;
}

.anim-auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.anim-login {
  border: none;
  border-radius: 9999px;
  background: #0b0b0b;
  color: #fff;
  font-weight: 600;
  padding: 8px 13px;
  font-size: 0.83rem;
}

.anim-signup {
  border: 1px solid #d5d5d5;
  border-radius: 9999px;
  background: #fff;
  color: #151515;
  font-weight: 600;
  padding: 8px 14px;
  font-size: 0.83rem;
}

.anim-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: -62px;
}

.anim-hero {
  font-size: clamp(2.1rem, 3.2vw, 2.35rem);
  font-weight: 500;
  color: #1a1a1a;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}

.fake-search-text {
  flex: 1;
  min-height: 1.4em;
  color: #161616;
  font-size: 1rem;
  line-height: 1.4;
}

.fake-search-text:empty::before {
  content: attr(data-placeholder);
  color: #9a9a9a;
}

/* blinking cursor inside the typing text */
.cursor-text {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #1a1a1a;
  margin-left: 1px;
  vertical-align: middle;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.anim-input-row {
  width: 100%;
  padding: 0 16px;
  display: flex;
  justify-content: center;
}

.anim-input-box {
  width: 100%;
  max-width: 620px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f1f1f1;
  border: 1px solid #d8d8d8;
  border-radius: 9999px;
  padding: 7px 8px 7px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.anim-plus {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4b4b4b;
  font-size: 1.48rem;
  line-height: 1;
}

.anim-right-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.anim-voice-btn {
  height: 30px;
  border-radius: 9999px;
  background: #e9e9e9;
  border: 1px solid #d8d8d8;
  padding: 0 12px;
  color: #3b3b3b;
  font-size: 0.81rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.voice-bars {
  font-size: 0.72rem;
  letter-spacing: -0.05em;
  color: #656565;
}

.anim-send-btn {
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  border: none;
  background: #0f0f0f;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.anim-send-btn.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.anim-disclaimer {
  text-align: center;
  color: #777;
  font-size: 0.74rem;
  padding: 0 22px 6px;
}

/* ─── Fake Mouse ─── */
.fake-mouse {
  position: fixed;
  width: 38px;
  height: 50px;
  display: none;
  pointer-events: none;
  z-index: 10000;
  transition: left 0.95s cubic-bezier(0.22, 0.61, 0.36, 1), top 0.95s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.fake-mouse img {
  width: 100%;
  height: auto;
}

/* ─── Click ripple effect ─── */
.click-effect {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.35);
  animation: ripple 0.4s ease-out forwards;
  pointer-events: none;
  z-index: 9998;
}

@keyframes ripple {
  from { transform: scale(0); opacity: 1; }
  to   { transform: scale(2.5); opacity: 0; }
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .anim-sidebar {
    display: none;
  }

  .anim-main {
    border-radius: 10px;
  }
}

@media (max-width: 480px) {
  .home-screen {
    padding: 0.75rem 0.75rem 1rem;
  }

  .home-topbar {
    height: 46px;
  }

  .logo-badge {
    width: 38px;
    height: 38px;
    font-size: 0.78rem;
  }

  .home-title { font-size: 1.55rem; }

  .home-subtitle {
    font-size: 0.86rem;
  }

  .input-wrapper {
    border-radius: 20px;
    padding-left: 0.9rem;
  }

  .chat-input {
    font-size: 0.95rem;
  }

  .anim-header {
    padding: 0 10px;
  }

  .anim-title-top {
    font-size: 1.2rem;
  }

  .anim-signup {
    display: none;
  }

  .anim-hero {
    font-size: 1.6rem;
    text-align: center;
    padding: 0 14px;
  }
}