/*
 * 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.
 */

/* ===== scrollbar_hide (inlined — propshaft @import는 fingerprint 안 박아서 404남) ===== */
::-webkit-scrollbar { display: none; }
html { scrollbar-width: none; -ms-overflow-style: none; }
body { resize: none; overflow: hidden; overscroll-behavior: none; -webkit-overflow-scrolling: touch; -webkit-touch-callout: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }
* { resize: none; }
textarea, input, select { resize: none; }
html, body { height: 100%; width: 100%; margin: 0; padding: 0; overflow: hidden; }
.mb-1 { margin-bottom: 0.25rem !important; }
main, #app { height: 100vh; overflow-y: auto; overflow-x: hidden; -ms-overflow-style: none; scrollbar-width: none; }
main::-webkit-scrollbar, #app::-webkit-scrollbar { display: none; }
/* 하단 네비게이션 있을 때 main 마지막 콘텐츠가 nav에 가려지지 않게 */
body.with-bottom-nav main { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
iframe, object, embed { resize: none; }

/* ===== service_worker_fix (inlined) ===== */
#pwa-install-prompt { display: none; }
.offline-indicator { display: none !important; visibility: hidden !important; opacity: 0 !important; height: 0 !important; overflow: hidden !important; }
.loading-indicator { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, 0.8); color: white; padding: 20px; border-radius: 8px; z-index: 9999; display: none; }

/* Global touch/tap effects for buttons and interactive elements */
button,
[role="button"],
.btn,
a.inline-flex,
a.flex,
input[type="submit"],
input[type="button"] {
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease-out, opacity 0.1s ease-out;
}

button:active,
[role="button"]:active,
.btn:active,
a.inline-flex:active,
a.flex:active,
input[type="submit"]:active,
input[type="button"]:active {
  transform: scale(0.97);
  opacity: 0.8;
}

/* Clickable card/list item effects */
[onclick],
.cursor-pointer {
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease-out, background-color 0.15s ease-out;
}

[onclick]:active,
.cursor-pointer:active {
  transform: scale(0.99);
  background-color: rgba(0, 0, 0, 0.03);
}

/* Prevent text selection on interactive elements for better UX */
button,
[role="button"],
[onclick] {
  -webkit-user-select: none;
  user-select: none;
}

/* Kaminari Pagination Styles */
.pagination {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
}

.pagination span,
.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  transition: all 0.15s ease-in-out;
}

.pagination a:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
}

.pagination .current {
  background-color: #111827;
  color: #ffffff;
  border-color: #111827;
}

.pagination .disabled {
  color: #d1d5db;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination .first,
.pagination .prev,
.pagination .next,
.pagination .last {
  font-weight: 600;
}

.pagination .gap {
  border: none;
  pointer-events: none;
}
/* Safe header utility for sticky elements */
.app-safe-page {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.app-safe-page.has-bottom-nav {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 5.5rem);
}

.app-safe-header {
  padding-top: calc(env(safe-area-inset-top, 0px) + 1rem);
}

.app-safe-sticky {
  top: env(safe-area-inset-top, 0px);
}

html, body {
  touch-action: manipulation;
  background-color: #FFFFFF;
}

/* ===== Turbo Progress Bar (비활성화) =====
   기본 헤더 로딩바를 끄고 main 영역 스켈레톤(page_skeleton_loader.js)으로 대체.
   JS의 setProgressBarDelay(Infinity)와 함께 이중 안전망. */
.turbo-progress-bar {
  display: none !important;
}

/* ===== Skeleton Loading Styles ===== */
.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 0.375rem;
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-text-sm {
  height: 0.75rem;
  margin-bottom: 0.375rem;
}

.skeleton-text-lg {
  height: 1.25rem;
  margin-bottom: 0.625rem;
}

.skeleton-avatar {
  border-radius: 9999px;
}

.skeleton-card {
  border-radius: 0.75rem;
}

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

/* Turbo Frame loading state - show skeleton while loading */
turbo-frame[busy] > .skeleton-container {
  display: block;
}

turbo-frame[busy] > .content-container {
  display: none;
}

turbo-frame:not([busy]) > .skeleton-container {
  display: none;
}

turbo-frame:not([busy]) > .content-container {
  display: block;
}
