/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 *
 * Note: Tailwind CSS is loaded separately via tailwind.css
 */

/* Login Form Animation */
.animate-fadeIn {
  animation: fadeIn 0.3s ease-in-out;
}

/* Lazy Loading Image Styles */
.lazy-loading {
  background-color: #f3f4f6;
  background-image: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.lazy-loaded {
  background: none;
  animation: none;
}

.lazy-error {
  background-color: #fee2e2;
  background-image: none;
  animation: none;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

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

/* Floating Action Button Styles (한국 페이지 전용) - 반응형 위치 */
div#floatingActionButton.floating-action-button {
  /* 모든 화면에서 fixed 위치 사용하여 가시성 보장 */
  position: fixed !important;
  width: auto !important;
  height: auto !important;
  display: block !important;

  /* 모바일 기본 위치 */
  bottom: calc(env(safe-area-inset-bottom, 0px) + 7rem) !important;
  right: 0.75rem !important; /* 12px */
}

/* 태블릿 및 PC에서 메인 컨테이너와 정렬 */
@media (min-width: 768px) {
  div#floatingActionButton.floating-action-button {
    /* 화면 중앙의 max-w-md(28rem) 컨테이너 오른쪽에서 1rem 떨어진 위치 */
    right: calc((100vw - min(100vw, 28rem)) / 2 + 1rem) !important;
    /* 화면 높이에 따른 유연한 bottom 위치 (최소 4.5rem, 최대 8rem) */
    bottom: clamp(4.5rem, 15vh, 8rem) !important;
  }
}

/* 큰 화면에서 더 안정적인 위치 */
@media (min-width: 1280px) {
  div#floatingActionButton.floating-action-button {
    bottom: clamp(5rem, 18vh, 10rem) !important;
  }
}

div#floatingActionButton .fab-button {
  width: 56px !important;
  height: 56px !important;
  border-radius: 50% !important;
  background: #1f2937 !important;
  border: 2px solid #ffffff !important;
  color: white !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  transform: scale(1) !important;
}

div#floatingActionButton .fab-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  background: #333333;
}

div#floatingActionButton .fab-button:active {
  transform: scale(0.95);
}

/* 스크롤 시 숨김 애니메이션 (모든 화면에서 동일) */
div#floatingActionButton.floating-action-button.fab-hidden {
  transform: translateY(120px) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* 버튼 크기는 Tailwind에서 반응형으로 제어 */
div#floatingActionButton .fab-button {
  /* 모바일: 50px, 태블릿: 54px, 데스크톱: 56px */
  width: 50px !important;
  height: 50px !important;
}

@media (min-width: 481px) and (max-width: 768px) {
  div#floatingActionButton .fab-button {
    width: 54px !important;
    height: 54px !important;
  }
}

@media (min-width: 769px) {
  div#floatingActionButton .fab-button {
    width: 56px !important;
    height: 56px !important;
  }
}

/* 터치 디바이스에서 호버 효과 비활성화 */
@media (hover: none) {
  div#floatingActionButton .fab-button:hover {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: #000000;
  }
}

/* 검색 오버레이 빠른 선택 버튼 스타일 (모든 디바이스) - 높은 우선순위 */
button.quick-preset-btn-compact[data-action*="search-overlay"] {
  background-color: #f9fafb !important; /* bg-gray-50 */
  color: #111827 !important; /* text-gray-900 */
  border-color: #e5e7eb !important; /* border-gray-200 */
}

button.quick-preset-btn-compact.selected[data-action*="search-overlay"],
button.quick-preset-btn-compact[data-action*="search-overlay"].selected {
  background-color: #000000 !important; /* bg-black */
  color: #ffffff !important; /* text-white */
  border-color: #374151 !important; /* border-gray-800 */
}

/* 내부 div 텍스트 색상도 강제 적용 */
button.quick-preset-btn-compact[data-action*="search-overlay"] div {
  color: inherit !important;
}

button.quick-preset-btn-compact.selected[data-action*="search-overlay"] div,
button.quick-preset-btn-compact[data-action*="search-overlay"].selected div {
  color: #ffffff !important;
}

/* Cookie Consent Banner - Ultrathink Black & White Style */
.cookie-consent {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-consent.hidden {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

.cookie-consent button {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.025em;
  transition: all 0.2s ease;
  cursor: pointer;
  outline: none;
}

.cookie-consent button:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.cookie-consent a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.cookie-consent a:hover {
  color: rgba(255, 255, 255, 1);
  text-decoration-thickness: 2px;
}

/* Cookie Modal - Minimal Design */
.cookie-modal {
  animation: modalFadeIn 0.2s ease-out;
}

.cookie-modal .bg-white {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.cookie-modal h3 {
  font-weight: 600;
  letter-spacing: -0.025em;
}

.cookie-modal .text-xs {
  color: #6b7280;
  line-height: 1.3;
}

.cookie-modal button {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.025em;
  transition: all 0.15s ease;
  cursor: pointer;
  outline: none;
}

.cookie-modal button:focus {
  outline: 2px solid rgba(0, 0, 0, 0.2);
  outline-offset: 2px;
}

.cookie-modal button:hover {
  transform: translateY(-1px);
}

/* Toggle Switch Styling */
.cookie-modal input[type="checkbox"] + div {
  transition: all 0.2s ease;
}

.cookie-modal input[type="checkbox"]:focus + div {
  outline: 2px solid rgba(0, 0, 0, 0.2);
  outline-offset: 2px;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .cookie-consent {
    font-size: 12px;
  }

  .cookie-consent button {
    font-size: 11px;
    padding: 6px 12px;
  }

  .cookie-modal .bg-white {
    margin: 16px;
    max-width: calc(100vw - 32px);
  }
}

/* ========================================
   온보딩 모달 - 토스/애플 스타일 애니메이션
   ======================================== */

/* 토스 스타일 Spring 애니메이션 */
@keyframes toastSpring {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    filter: blur(10px);
  }
  50% {
    transform: translateY(-2px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* 애플 스타일 Smooth */
@keyframes appleSmooth {
  0% {
    opacity: 0;
    transform: scale(0.96) translateZ(0);
    filter: blur(8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateZ(0);
    filter: blur(0);
  }
}

/* 이모지 회전 팝업 (토스 특유의) */
@keyframes emojiPop {
  0% {
    transform: scale(0.5) rotate(-15deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.15) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* 숫자 카운트업 글로우 효과 */
@keyframes numberGlow {
  0%, 100% {
    text-shadow: 0 0 0 transparent;
  }
  50% {
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
  }
}

/* 글자별 페이드인 */
@keyframes charFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 배경 블러 효과 */
#onboarding-modal {
  animation: backdropBlur 0.6s ease-out forwards;
}

@keyframes backdropBlur {
  from {
    backdrop-filter: blur(0px);
    opacity: 0;
  }
  to {
    backdrop-filter: blur(10px);
    opacity: 1;
  }
}

/* 온보딩 애니메이션 초기 상태 */
.onboarding-emoji {
  transform: scale(2);
  transform-origin: center;
  display: inline-block;
}

/* 나머지 요소들은 처음부터 보임 */
.onboarding-greeting,
.onboarding-question,
.onboarding-form,
.onboarding-btn-complete,
.onboarding-btn-skip,
.onboarding-hint {
  opacity: 1;
}

/* 버튼 호버 효과 (미세 인터랙션) */
#onboarding-modal button:not(:disabled):hover {
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#onboarding-modal button:not(:disabled):active {
  transform: scale(0.98);
}

/* 드롭다운 포커스 효과 */
#onboarding-modal select:focus {
  transform: scale(1.01);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 닉네임 숫자 강조 */
#onboarding-modal .nickname-number {
  display: inline-block;
  font-weight: 700;
  color: #000000;
  letter-spacing: 0.05em;
}

/* 버튼 항상 클릭 가능하도록 보장 */
#onboarding-modal button,
#onboarding-modal input[type="submit"] {
  pointer-events: auto !important;
  opacity: 1 !important;
  cursor: pointer;
}

#onboarding-modal button:disabled,
#onboarding-modal input[type="submit"]:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed;
}

/* 반응형: 모바일에서 모달 크기 조정 */
@media (max-width: 640px) {
  #onboarding-modal > div {
    padding: 1.5rem;
  }

  #onboarding-modal h1 {
    font-size: 1.5rem;
  }

  #onboarding-modal .text-2xl {
    font-size: 1.25rem;
  }
}

/* ========================================
   회원가입 - 원형 체크박스 스타일
   ======================================== */

/* 원형 체크박스 기본 스타일 */
input[type="checkbox"].rounded-full {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid #d1d5db; /* gray-300 */
  border-radius: 50%;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

/* 미체크 상태 - 회색 V */
input[type="checkbox"].rounded-full::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 5px;
  height: 10px;
  border: solid #d1d5db;
  border-width: 0 2px 2px 0;
  margin-top: -1px;
}

/* 체크된 상태 - 원 안에 작은 점 */
input[type="checkbox"].rounded-full:checked {
  background-color: #000000; /* black */
  border-color: #000000;
}

input[type="checkbox"].rounded-full:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  margin-top: -1px;
}

/* 호버 효과 */
input[type="checkbox"].rounded-full:hover:not(:disabled) {
  border-color: #9ca3af;
  transform: scale(1.05);
}

/* 포커스 효과 */
input[type="checkbox"].rounded-full:focus {
  outline: 2px solid rgba(156, 163, 175, 0.3);
  outline-offset: 2px;
}

/* 비활성화 상태 */
input[type="checkbox"].rounded-full:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   드래그 방지 - 전체 사이트 (Admin 제외)
   ======================================== */

/* 메인 사이트에서만 드래그 방지 (Admin은 제외) */
body:not(.admin-v2-layout),
body:not(.admin-v2-layout) *:not(input):not(textarea):not([contenteditable="true"]) {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  -webkit-touch-callout: none !important;
}

/* 이미지 드래그 방지 (클릭은 허용) */
body:not(.admin-v2-layout) img {
  -webkit-user-drag: none !important;
  -khtml-user-drag: none !important;
  -moz-user-drag: none !important;
  -o-user-drag: none !important;
  user-drag: none !important;
  pointer-events: auto !important; /* 클릭은 허용 */
}

/* 입력 필드에서는 텍스트 선택 허용 */
body:not(.admin-v2-layout) input,
body:not(.admin-v2-layout) textarea,
body:not(.admin-v2-layout) [contenteditable="true"] {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  -webkit-touch-callout: default !important;
}
