/* Ziyaretçi notları: akan yazı katmanı */

html,
body {
  overscroll-behavior: none;
  touch-action: none;
}

#visitor-notes {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 8; /* müzik notalarının (9) hemen altında, videoların üstünde */
}

.visitor-note {
  position: absolute;
  top: 0;
  left: 0;
  max-width: min(72vw, 26rem);
  will-change: transform, opacity;
  opacity: 0;
  color: rgba(255, 255, 255, 0.92);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia,
    "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.01em;
  text-wrap: balance;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 10px rgba(0, 0, 0, 0.9),
    0 0 26px rgba(0, 0, 0, 0.85),
    0 6px 40px rgba(0, 0, 0, 0.7);
}

.visitor-note__text {
  display: block;
}

.visitor-note__text::before {
  content: "“";
  opacity: 0.45;
  margin-right: 0.05em;
}

.visitor-note__text::after {
  content: "”";
  opacity: 0.45;
  margin-left: 0.05em;
}

.visitor-note__name {
  display: block;
  margin-top: 0.45em;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-style: normal;
  font-size: 0.52em;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.55;
}

.visitor-note__name::before {
  content: "— ";
}

/* Az önce bırakılan not: kısa süreli parıltı */
.visitor-note.is-fresh {
  color: rgba(255, 255, 255, 0.96);
  text-shadow:
    0 0 22px rgba(255, 255, 255, 0.35),
    0 0 10px rgba(0, 0, 0, 0.9),
    0 0 26px rgba(0, 0, 0, 0.85);
}

@media (prefers-reduced-motion: reduce) {
  .visitor-note {
    will-change: auto;
  }
}

/* ------------------------------------------------------------------ */
/* Not bırakma arayüzü                                                */
/* ------------------------------------------------------------------ */

:root {
  --notes-safe-b: env(safe-area-inset-bottom, 0px);
  --notes-safe-r: env(safe-area-inset-right, 0px);
  --notes-glass: rgba(8, 8, 8, 0.62);
  --notes-line: rgba(255, 255, 255, 0.1);
  --notes-ink: #f5f5f5;
  --notes-muted: rgba(255, 255, 255, 0.5);
}

#note-compose {
  position: fixed;
  right: calc(1.5rem + var(--notes-safe-r));
  bottom: calc(1.5rem + var(--notes-safe-b));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--notes-line);
  background: var(--notes-glass);
  color: var(--notes-ink);
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s ease, opacity 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

#note-compose svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#note-compose::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  opacity: 0;
  animation: noteRing 5s ease-out 2.5s 3;
  pointer-events: none;
}

@media (hover: hover) {
  #note-compose:hover {
    transform: translateY(-2px);
    background: rgba(20, 20, 20, 0.75);
  }
  #note-compose:hover svg {
    transform: rotate(-12deg);
  }
}

#note-compose[aria-expanded="true"] {
  transform: scale(0.9);
  opacity: 0.55;
}

@keyframes noteRing {
  0% {
    opacity: 0.6;
    transform: scale(1);
  }
  30% {
    opacity: 0;
    transform: scale(1.9);
  }
  100% {
    opacity: 0;
    transform: scale(1.9);
  }
}

#note-backdrop {
  position: fixed;
  inset: 0;
  z-index: 31;
  background: radial-gradient(120% 120% at 50% 100%, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.1));
  opacity: 0;
  transition: opacity 0.4s ease;
}

#note-backdrop.is-open {
  opacity: 1;
}

#note-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 32;
  padding: 1.1rem 1.25rem calc(1.25rem + var(--notes-safe-b));
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--notes-line);
  border-bottom: none;
  background: var(--notes-glass);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  color: var(--notes-ink);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px);
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.45s;
  touch-action: auto;
}

#note-sheet.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
}

#note-sheet::before {
  /* mobil tutamaç */
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  margin: 0 auto 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

@media (min-width: 640px) {
  #note-sheet {
    left: auto;
    right: calc(1.5rem + var(--notes-safe-r));
    bottom: calc(5.4rem + var(--notes-safe-b));
    width: 360px;
    padding: 1.25rem 1.4rem 1.3rem;
    border-radius: 22px;
    border-bottom: 1px solid var(--notes-line);
    transform-origin: 90% 100%;
    transform: translateY(12px) scale(0.97);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  }
  #note-sheet::before {
    display: none;
  }
}

.note-sheet__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--notes-muted);
  margin-bottom: 0.9rem;
}

.note-field {
  position: relative;
  display: block;
}

.note-field textarea,
.note-field input {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--notes-line);
  color: var(--notes-ink);
  font-size: 16px; /* iOS odakta yakınlaştırmasın */
  padding: 0.35rem 0 0.6rem;
  outline: none;
  transition: border-color 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

.note-field textarea {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.35;
  resize: none;
  min-height: 3.6em;
  padding-right: 3.5rem;
}

.note-field textarea::placeholder,
.note-field input::placeholder {
  color: rgba(255, 255, 255, 0.32);
  font-style: italic;
}

.note-field textarea:focus,
.note-field input:focus {
  border-bottom-color: rgba(255, 255, 255, 0.45);
}

.note-field__count {
  position: absolute;
  right: 0;
  bottom: 0.65rem;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--notes-muted);
  font-variant-numeric: tabular-nums;
}

.note-field__count.is-limit {
  color: rgba(255, 180, 160, 0.9);
}

.note-field--name {
  margin-top: 0.6rem;
}

.note-field--name input {
  font-size: 16px;
  letter-spacing: 0.02em;
  padding-bottom: 0.45rem;
}

.note-sheet__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.note-btn {
  border: none;
  background: transparent;
  color: var(--notes-ink);
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  padding: 0.65rem 1.05rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, opacity 0.3s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.note-btn--ghost {
  color: var(--notes-muted);
}

.note-btn--ghost:hover {
  color: var(--notes-ink);
}

.note-btn--primary {
  background: var(--notes-ink);
  color: #0a0a0a;
  font-weight: 500;
  min-width: 6.5rem;
}

.note-btn--primary:hover {
  background: #fff;
}

.note-btn--primary:active {
  transform: scale(0.97);
}

.note-btn[disabled] {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

#note-toast {
  position: fixed;
  left: 50%;
  top: calc(1.5rem + env(safe-area-inset-top, 0px));
  transform: translate(-50%, -8px);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--notes-line);
  color: var(--notes-ink);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s;
  z-index: 33;
  pointer-events: none;
  white-space: nowrap;
}

#note-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s;
}

@media (max-width: 480px) {
  #elapsed-info {
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.68rem;
  }
  #note-toast {
    top: auto;
    bottom: calc(9.75rem + var(--notes-safe-b));
  }
}
