/* app/assets/stylesheets/application.css
   ── Global base styles: Pop × Liquid Glass ── */

/* ========= Custom Cursor ========= */
html, body {
  cursor: none;
}

.Cursor {
  pointer-events: none;
  position: fixed;
  display: block;
  transform-origin: center center;
  mix-blend-mode: difference;
  top: 0;
  left: 0;
  z-index: 1000;
  filter: url("#goo");
}

.Cursor span {
  position: absolute;
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 20px;
  background-color: #fff;
  transform-origin: center center;
  transform: translate(-50%, -50%);
}

body.ef-modal-open .Cursor,
body.mm-modal-open .Cursor {
  z-index: 20000;
}

body.onboarding-modal-open .Cursor {
  z-index: 5000;
}

/* ========= Global Typography & Layout ========= */

body {
  font-family: 'Noto Sans JP', 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--color-text-primary);
  font-size: var(--fs-base);
  line-height: var(--leading-normal);
  min-height: 100vh;
  background-image: url("/assets/chat_bg-b9f3c5d7.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Nunito', 'Noto Sans JP', sans-serif;
  color: var(--color-text-primary);
  font-weight: 800;
  line-height: var(--leading-tight);
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

p, label, span {
  color: var(--color-text-secondary);
}

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

/* ========= Glassmorphism Base ========= */

.glass-blur {
  background: var(--panel-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  border-radius: var(--radius-2xl);
  color: var(--color-text-primary);
}

/* ========= Person Card (Onboarding) ========= */

.person-card-container {
  position: relative;
  display: inline-block;
  padding: 0.5rem;
}

.person-card {
  width: 60vw;
  max-width: 800px;
  height: auto;
  min-height: 0;
  transition: transform 0.3s ease-in-out;
  border-top: 4px solid var(--school-blue);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-2xl);
  background: var(--panel-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
}

/* ========= Selection Buttons ========= */

.input-button {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--card-bg);
  color: var(--color-text-secondary);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  outline: none;
}

.input-button:hover {
  background: var(--card-hover-bg);
  border-color: rgba(74, 123, 247, 0.3);
  transform: translateY(-1px);
}

.input-button.selected {
  font-weight: 700;
  background: var(--school-blue);
  color: #ffffff;
  border-color: var(--school-blue);
  box-shadow: var(--glow-blue);
  transform: translateY(-1px);
}

/* ========= Text Colors ========= */

.text-gray-500 {
  color: var(--color-text-muted);
}

.bg-white\/20,
.bg-white\/30,
.bg-white\/40 {
  background: var(--card-bg);
}

.border-gray-300 {
  border-color: var(--card-border);
}

/* ========= Form Inputs ========= */

input[type="text"],
input[type="date"] {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  color: var(--color-text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="date"]:focus {
  border-color: var(--school-blue);
  box-shadow: 0 0 0 3px var(--school-blue-soft);
  outline: none;
}

input[type="text"]::placeholder,
input[type="date"]::placeholder {
  color: var(--color-text-muted);
}

input[readonly] {
  background: rgba(255, 255, 255, 0.25);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 0.6;
  cursor: pointer;
}

/* ========= Misc Layout ========= */

.bg-indigo-100\/60 {
  background: var(--school-blue-soft);
  border-color: rgba(74, 123, 247, 0.3);
}

.scrollable-container {
  overflow-x: auto;
  white-space: nowrap;
}

.add-person-inline-btn {
  width: 3rem;
  height: 3rem;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--school-blue);
  color: #ffffff;
  box-shadow: var(--glow-blue), var(--sticker-shadow);
  transition: all 0.2s ease;
  margin-left: 1rem;
  flex-shrink: 0;
}

.add-person-inline-btn:hover {
  background: #3A6BE6;
  transform: scale(1.08);
}

/* ========= Color Utility Classes ========= */

.text-blue-600  { color: var(--school-blue); }
.text-pink-600  { color: var(--cherry); }
.text-emerald-500 { color: #22C55E; }

/* ========= Summary Screen ========= */

#summary-screen {
  min-height: 500px;
  display: none;
}

.summary-silhouette-wrapper {
  width: 20vw;
  max-width: 180px;
}

/* ========= Toast Notification (Pop style) ========= */

.toast {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.85rem;
  z-index: 9999;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--sticker-shadow);
  animation: toast-in 0.3s ease;
}
.toast-ok {
  background: rgba(34, 197, 94, 0.15);
  border: 1.5px solid rgba(34, 197, 94, 0.3);
  color: #16A34A;
}
.toast-warn {
  background: rgba(245, 158, 11, 0.15);
  border: 1.5px solid rgba(245, 158, 11, 0.3);
  color: #D97706;
}
.toast-good {
  background: var(--school-blue-soft);
  border: 1.5px solid rgba(74, 123, 247, 0.3);
  color: var(--school-blue);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========= Liquid Button ========= */
.liquid-button {
  font-weight: bold;
  user-select: none;
  display: block;
}
.liquid-button path {
  cursor: pointer;
}

/* 自動変換されたボタン内のSVGをボタンサイズに収める */
.btn .liquid-button,
.pop-btn .liquid-button,
.choice-btn .liquid-button {
  display: block;
  width: 100%;
  height: 100%;
}

/* 自動変換ボタンのレイアウト維持 */
.btn[data-liquid-init],
.pop-btn[data-liquid-init],
.choice-btn[data-liquid-init] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ========= Hidden Utility ========= */
.hidden { display: none !important; }
.muted  { color: var(--color-text-muted); }

/* ========= Responsive ========= */

/* タッチデバイスではカスタムカーソルを非表示 */
@media (hover: none), (pointer: coarse) {
  html, body { cursor: auto; }
  .Cursor { display: none !important; }
}

@media (max-width: 768px) {
  .person-card {
    width: 95vw;
    max-width: 400px;
    min-height: 0;
  }

  .summary-silhouette-wrapper {
    width: 25vw;
    height: 40vw;
    max-width: 150px;
    max-height: 250px;
  }
}
