/*
 * 발송 확인 다이얼로그의 받는 사람 폰 목업(sent_confirmations/_mockup·_imessage·_instagram) — PLAN 부록 F §6.3, A-S5.
 * 구 IMessageNotification·InstagramNotification 이 실행 중에 넣던 스타일 값 그대로(B0 tmp/baseline/web/send STRUCTURE §2.4 '컴포넌트가 넣는 style').
 * 이 화면(/{url}) head 에만 싣는다(sent_confirmations/_dialog 의 content_for :head). Turbo 방문 뒤에도 head 에 남으므로 keyframes 이름은
 * 전역(application.tailwind.css 의 shake 등)과 겹치지 않게 sent-confirmation- 접두를 붙인다 — class 이름은 B0 그대로(채취 선택자·rAF 비교).
 * 다이얼로그 안의 [hidden](변형·오류 상자·숨긴 버튼)은 display 유틸리티(flex·inline-flex)보다 이겨야 한다 — Tailwind 의 [hidden] 기본은 유틸리티에 진다.
 */

#sent_confirmation [hidden] {
  display: none !important;
}

@keyframes sent-confirmation-slide-in {
  0% { transform: translateY(-100%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes sent-confirmation-slide-out {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-100%); opacity: 0; }
}

@keyframes sent-confirmation-shake {
  0% { transform: translateX(0); }
  10% { transform: translateX(-3px) rotate(-0.5deg); }
  20% { transform: translateX(3px) rotate(0.5deg); }
  30% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  50% { transform: translateX(-2px) rotate(-0.25deg); }
  60% { transform: translateX(2px) rotate(0.25deg); }
  70% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
  90% { transform: translateX(-1px); }
  100% { transform: translateX(0); }
}

@keyframes sent-confirmation-vibrate {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

.iphone-mockup.shake-effect {
  animation: sent-confirmation-shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* 진동선 — 목업 양옆의 주황 물결(시작 vibrate, 2.6초에 hidden) */
.vibration-line {
  position: absolute;
  width: 5px;
  background: linear-gradient(to bottom, #ff8800, #ff5500, #ff8800, #ff5500, #ff8800);
  opacity: 0.8;
  height: 70%;
  top: 45%;
  z-index: 2;
}

.vibration-line-left {
  left: -4px;
  clip-path: path('M0,0 Q3,10 0,20 Q3,30 0,40 Q3,50 0,60 Q3,70 0,80 Q3,90 0,100 L5,100 Q8,90 5,80 Q8,70 5,60 Q8,50 5,40 Q8,30 5,20 Q8,10 5,0 Z');
}

.vibration-line-right {
  right: -4px;
  clip-path: path('M5,0 Q2,10 5,20 Q2,30 5,40 Q2,50 5,60 Q2,70 5,80 Q2,90 5,100 L0,100 Q-3,90 0,80 Q-3,70 0,60 Q-3,50 0,40 Q-3,30 0,20 Q-3,10 0,0 Z');
}

.vibration-line.vibrate {
  animation: sent-confirmation-vibrate 0.2s ease-in-out infinite;
}

/* 알림 — 시작 hidden(Tailwind display:none), 2초에 visible 로 바뀌며 위에서 미끄러져 들어온다 */
.imessage-container,
.instagram-container {
  overflow: hidden;
  transition: opacity 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}

.imessage-notification,
.instagram-notification {
  transform-origin: top center;
  will-change: transform, opacity;
  min-height: 88px;
  height: auto;
}

.imessage-notification.visible,
.instagram-notification.visible {
  animation: sent-confirmation-slide-in 0.4s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

.imessage-notification.hidden,
.instagram-notification.hidden {
  animation: sent-confirmation-slide-out 0.4s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

/* iPhone 틀 */
.iphone-mockup {
  position: relative;
  margin: 0 auto;
  max-width: 95%;
  border-radius: 40px 40px 0 0;
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1), 0 8px 16px -4px rgba(0, 0, 0, 0.1);
  background: #101a32;
  border-left: 3px solid rgba(255, 255, 255, 0.15);
  border-right: 3px solid rgba(255, 255, 255, 0.15);
  border-top: 3px solid rgba(255, 255, 255, 0.15);
}

.iphone-notch-container {
  position: relative;
  height: 32px;
  background-color: #000;
  overflow: visible;
}

.iphone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 28px;
  background-color: #000;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  z-index: 10;
}

.iphone-notch-camera {
  position: absolute;
  top: 8px;
  right: 30%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0f0f1b;
  border: 1px solid rgba(50, 50, 60, 0.3);
}

.iphone-notch-speaker {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 4px;
  background-color: #333;
  border-radius: 4px;
}

/* 상태바 — 시계·신호 막대·LTE·배터리 */
.ios-status-bar {
  position: relative;
  height: 44px;
  background-color: #101a32;
  overflow: hidden;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
}

.battery-icon {
  width: 25px;
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 3px;
  padding: 1px;
  position: relative;
}

.battery-icon::before {
  content: '';
  position: absolute;
  right: -4px;
  top: 3px;
  height: 4px;
  width: 2px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 0 2px 2px 0;
}

.battery-icon::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  height: 6px;
  width: 16px;
  background-color: white;
  border-radius: 1px;
}

.network-icon {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 12px;
}

.network-bar {
  width: 3px;
  background-color: white;
  border-radius: 1px;
}

.network-bar:nth-child(1) { height: 4px; }
.network-bar:nth-child(2) { height: 6px; }
.network-bar:nth-child(3) { height: 8px; }
.network-bar:nth-child(4) { height: 10px; }

.lte-text {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: white;
}
