/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *



 */

/* 스튜디오 관련 스타일 - 뱃지는 shared/_studio_badge.html.erb 컴포넌트 사용 */
.author-link.studio-author {
  font-weight: 600;
}

/* 구독 스튜디오 아이콘 스타일 (사이드바) */
.server-list-item.subscribed-studio {
  opacity: 0.85;
}

.server-list-item.subscribed-studio:hover {
  opacity: 1;
}

.server-list-item.subscribed-studio .server-avatar-image,
.server-list-item.subscribed-studio .server-avatar-initial {
  /* 점선 테두리 제거됨 */
}

/* 이벤트 임베드 스타일 (피드 내 이벤트 카드) */
.post-event-embed {
  margin-top: 0.75rem;
  max-width: 100%;
}

.post-event-embed .event-card-compact {
  max-width: 100%;
  width: 100%;
  height: auto;
  min-height: 280px;
  transform: none;
}

.post-event-embed .event-card-compact:hover {
  transform: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-event-embed .event-card-compact-banner {
  height: 160px;
}

.post-event-embed .event-card-compact-banner-image {
  height: 160px;
}

@media (max-width: 768px) {
  .post-event-embed .event-card-compact {
    min-height: 240px;
  }
  
  .post-event-embed .event-card-compact-banner {
    height: 140px;
  }
  
  .post-event-embed .event-card-compact-banner-image {
    height: 140px;
  }
}
/*
  버튼 컴포넌트 스타일
  사용법:
    기본: <button class="btn btn-primary">버튼</button>
    사이즈: <button class="btn btn-primary btn-sm">작은 버튼</button>
    풀 너비: <button class="btn btn-primary btn-full">전체 너비</button>
    
  타입: btn-primary, btn-secondary, btn-danger
  사이즈: btn-sm, btn-md (기본), btn-lg
  기타: btn-full (100% 너비)
*/

/* 기본 버튼 스타일 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none;
  border: none;
  line-height: 1.5;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary 버튼 - 주요 액션용 */
.btn-primary {
  background-color: #1a1a1a;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background-color: #2d2d2d;
}

/* Secondary 버튼 - 보조 액션용 */
.btn-secondary {
  background-color: #f5f5f5;
  color: #1a1a1a;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #e5e5e5;
}

/* Danger 버튼 - 위험한 액션용 */
.btn-danger {
  background-color: #fff;
  color: #dc2626;
  border: 2px solid #dc2626;
}

.btn-danger:hover:not(:disabled) {
  background-color: #dc2626;
  color: #fff;
}

/* Ghost 버튼 - 투명 배경 */
.btn-ghost {
  background-color: transparent;
  color: #1a1a1a;
}

.btn-ghost:hover:not(:disabled) {
  background-color: #f5f5f5;
}

/* 사이즈 변형 */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* 전체 너비 */
.btn-full {
  width: 100%;
}

/* 아이콘만 있는 버튼 */
.btn-icon {
  padding: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
}

.btn-icon.btn-sm {
  width: 2rem;
  height: 2rem;
  padding: 0.375rem;
}

.btn-icon.btn-lg {
  width: 3rem;
  height: 3rem;
  padding: 0.625rem;
}
/*
 * 스켈레톤 UI 컴포넌트 스타일
 * 로딩 상태 표시를 위한 애니메이션 및 스타일 정의
 */

/* 스켈레톤 웨이브 애니메이션 */
@keyframes skeleton-wave {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* 스켈레톤 펄스 애니메이션 */
@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* 기본 스켈레톤 요소 */
.skeleton {
  background-color: #e5e7eb;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: skeleton-wave 0.75s ease-in-out infinite;
}

/* 스켈레톤 변형 - 원형 (아바타용) */
.skeleton-circle {
  border-radius: 50%;
}

/* 스켈레톤 변형 - 둥근 모서리 */
.skeleton-rounded {
  border-radius: 8px;
}

/* 게시물 스켈레톤 카드 */
.post-skeleton {
  background-color: #ffffff;
  border-radius: 1rem;
  padding: 1.25rem;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.post-skeleton-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.post-skeleton-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.post-skeleton-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.post-skeleton-name {
  width: 120px;
  height: 14px;
}

.post-skeleton-time {
  width: 80px;
  height: 12px;
}

.post-skeleton-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-skeleton-line {
  height: 14px;
}

.post-skeleton-line-full {
  width: 100%;
}

.post-skeleton-line-medium {
  width: 75%;
}

.post-skeleton-line-short {
  width: 50%;
}

/* 게시물 스켈레톤 액션 영역 */
.post-skeleton-actions {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
}

.post-skeleton-action {
  width: 24px;
  height: 24px;
}

/* 스켈레톤 컨테이너 */
.posts-skeleton-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* 로딩 스피너 (스켈레톤 대안) */
.loading-spinner-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: #1a1a1a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 무한 스크롤 로딩 표시 */
.infinite-scroll-loading {
  text-align: center;
  padding: 1.5rem;
}

.infinite-scroll-loading .post-skeleton {
  max-width: 100%;
}

/* 게시물 카드 애니메이션 */
.post-card {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.post-card-animate {
  animation: postCardFadeIn 0.5s ease-out forwards;
}

@keyframes postCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 피드 컨테이너 초기 애니메이션 */
.feed-content {
  opacity: 0;
  animation: feedFadeIn 0.4s ease-out 0.1s forwards;
}

@keyframes feedFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 모달 애니메이션 */
.modal-overlay {
  opacity: 0;
  animation: modalOverlayFadeIn 0.25s ease-out forwards;
}

@keyframes modalOverlayFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  opacity: 0;
  transform: scale(0.95) translateY(10px);
  animation: modalContentFadeIn 0.3s ease-out 0.05s forwards;
}

@keyframes modalContentFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 카드 호버 효과 */
.post-card:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease-out;
}

/* ========================================
   이미지 로딩: 로딩이 느릴 때만 스켈레톤 시머 → 완전 로드 시 페이드인
   (요소를 미리 불투명하게 만들어 위→아래로 그려지던 "셔터" 현상 제거)
   ======================================== */

/* 큰 이미지: 페이드인 트랜지션 (기본은 보임 → 캐시 시 즉시 표시) */
.slider-image,
.post-image,
.event-card-compact-banner-image,
.event-card-banner-image,
.admin-event-thumbnail,
.adm-event-thumbnail,
.blog-detail-cover-image,
.blog-card-image,
.blog-row-thumb-img {
  transition: opacity 0.35s ease-out;
}

/* 로딩 중(JS가 .img-loading 부여): 완전 로드 전까지 숨김 */
.slider-image.img-loading,
.post-image.img-loading,
.event-card-compact-banner-image.img-loading,
.event-card-banner-image.img-loading,
.admin-event-thumbnail.img-loading,
.adm-event-thumbnail.img-loading,
.blog-detail-cover-image.img-loading,
.blog-card-image.img-loading,
.blog-row-thumb-img.img-loading {
  opacity: 0;
}

/* 이미지 컨테이너 시머 (로딩 중에만 JS가 .media-skeleton 부여) */
.media-skeleton {
  position: relative;
  background-color: #e5e7eb;
  overflow: hidden;
}

.media-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: translateX(-100%);
  animation: skeleton-wave 0.75s ease-in-out infinite;
  z-index: 1;
}

/* 아바타: 별도 래퍼가 없어 이미지 자체 배경으로 시머 표시 */
.avatar-loading {
  background-image: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: avatar-shimmer 0.7s linear infinite;
}

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

/* 피드 내 게시물 순차 로딩 */
.feed-content .post-card:nth-child(1) { animation-delay: 0s; }
.feed-content .post-card:nth-child(2) { animation-delay: 0.05s; }
.feed-content .post-card:nth-child(3) { animation-delay: 0.1s; }
.feed-content .post-card:nth-child(4) { animation-delay: 0.15s; }
.feed-content .post-card:nth-child(5) { animation-delay: 0.2s; }
.feed-content .post-card:nth-child(6) { animation-delay: 0.25s; }
.feed-content .post-card:nth-child(7) { animation-delay: 0.3s; }
.feed-content .post-card:nth-child(8) { animation-delay: 0.35s; }
.feed-content .post-card:nth-child(9) { animation-delay: 0.4s; }
.feed-content .post-card:nth-child(10) { animation-delay: 0.45s; }

/* 피드 내 게시물 초기 상태 */
.feed-content .post-card {
  opacity: 0;
  animation: postCardStaggerFadeIn 0.4s ease-out forwards;
}

@keyframes postCardStaggerFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* (이미지/아바타 순차 로딩 딜레이 및 .loaded 규칙은 로드 기반 시머 방식으로 대체되어 제거됨) */

/* ========================================
   이벤트 페이지 애니메이션
   ======================================== */

/* 이벤트 페이지 전체 fade-in */
.events-page {
  opacity: 0;
  animation: pageFadeIn 0.4s ease-out 0.1s forwards;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 이벤트 헤더 애니메이션 */
.events-header {
  opacity: 0;
  transform: translateY(10px);
  animation: elementFadeInUp 0.4s ease-out 0.1s forwards;
}

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

/* 카테고리 필터 애니메이션 */
.events-category-filter {
  opacity: 0;
  animation: elementFadeInUp 0.4s ease-out 0.15s forwards;
}

/* 캘린더 위젯 애니메이션 */
.events-calendar-widget {
  opacity: 0;
  animation: elementFadeInUp 0.4s ease-out 0.2s forwards;
}

/* 월별 섹션 순차 애니메이션 */
.events-month-section {
  opacity: 0;
  animation: elementFadeInUp 0.4s ease-out forwards;
}

.events-month-section:nth-child(1) { animation-delay: 0.2s; }
.events-month-section:nth-child(2) { animation-delay: 0.25s; }
.events-month-section:nth-child(3) { animation-delay: 0.3s; }
.events-month-section:nth-child(4) { animation-delay: 0.35s; }
.events-month-section:nth-child(5) { animation-delay: 0.4s; }

/* 이벤트 카드 순차 애니메이션 */
.event-card-compact {
  opacity: 0;
  animation: cardFadeIn 0.4s ease-out forwards;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 월별 카드 그룹 내 순차 로딩 */
.events-month-cards .event-card-compact:nth-child(1) { animation-delay: 0.1s; }
.events-month-cards .event-card-compact:nth-child(2) { animation-delay: 0.15s; }
.events-month-cards .event-card-compact:nth-child(3) { animation-delay: 0.2s; }
.events-month-cards .event-card-compact:nth-child(4) { animation-delay: 0.25s; }
.events-month-cards .event-card-compact:nth-child(5) { animation-delay: 0.3s; }
.events-month-cards .event-card-compact:nth-child(6) { animation-delay: 0.35s; }

/* (이벤트 배너 이미지도 위의 로드 기반 시머 방식으로 처리됨) */

/* 이벤트 상세 모달 컨텐츠 애니메이션 */
.event-detail-modal-body .event-card {
  opacity: 0;
  animation: modalCardFadeIn 0.3s ease-out 0.1s forwards;
}

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

/* ========================================
   어드민 페이지 애니메이션
   ======================================== */

/* 어드민 메트릭 카드 순차 애니메이션 */
.metrics-row .metric-card {
  opacity: 0;
  animation: metricCardFadeIn 0.4s ease-out forwards;
}

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

.metrics-row .metric-card:nth-child(1) { animation-delay: 0.1s; }
.metrics-row .metric-card:nth-child(2) { animation-delay: 0.15s; }
.metrics-row .metric-card:nth-child(3) { animation-delay: 0.2s; }

/* 어드민 통계 그리드 순차 애니메이션 */
.stats-grid .stat-card-small {
  opacity: 0;
  animation: statCardFadeIn 0.3s ease-out forwards;
}

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

.stats-grid .stat-card-small:nth-child(1) { animation-delay: 0.2s; }
.stats-grid .stat-card-small:nth-child(2) { animation-delay: 0.25s; }
.stats-grid .stat-card-small:nth-child(3) { animation-delay: 0.3s; }
.stats-grid .stat-card-small:nth-child(4) { animation-delay: 0.35s; }
.stats-grid .stat-card-small:nth-child(5) { animation-delay: 0.4s; }
.stats-grid .stat-card-small:nth-child(6) { animation-delay: 0.45s; }

/* 어드민 차트 섹션 애니메이션 */
.chart-section {
  opacity: 0;
  animation: elementFadeInUp 0.4s ease-out 0.25s forwards;
}

/* 어드민 테이블 행 순차 애니메이션 */
.adm-table tbody tr {
  opacity: 0;
  animation: tableRowFadeIn 0.3s ease-out forwards;
}

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

.adm-table tbody tr:nth-child(1) { animation-delay: 0.1s; }
.adm-table tbody tr:nth-child(2) { animation-delay: 0.13s; }
.adm-table tbody tr:nth-child(3) { animation-delay: 0.16s; }
.adm-table tbody tr:nth-child(4) { animation-delay: 0.19s; }
.adm-table tbody tr:nth-child(5) { animation-delay: 0.22s; }
.adm-table tbody tr:nth-child(6) { animation-delay: 0.25s; }
.adm-table tbody tr:nth-child(7) { animation-delay: 0.28s; }
.adm-table tbody tr:nth-child(8) { animation-delay: 0.31s; }
.adm-table tbody tr:nth-child(9) { animation-delay: 0.34s; }
.adm-table tbody tr:nth-child(10) { animation-delay: 0.37s; }

/* 어드민 카드 애니메이션 */
.adm-card {
  opacity: 0;
  animation: elementFadeInUp 0.4s ease-out 0.15s forwards;
}

/* 어드민 섹션 헤더 애니메이션 */
.adm-section-header {
  opacity: 0;
  animation: elementFadeInUp 0.4s ease-out 0.1s forwards;
}

/* 어드민 필터 탭 애니메이션 */
.adm-filter-tabs {
  opacity: 0;
  animation: elementFadeInUp 0.4s ease-out 0.12s forwards;
}

/* 어드민 드롭다운 메뉴 애니메이션 */
.adm-dropdown-menu {
  opacity: 0;
  transform: scale(0.95) translateY(-5px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.adm-dropdown-menu.open {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* (어드민 이벤트 썸네일도 위의 로드 기반 시머 방식으로 처리됨) */
