/* =========================================================
   엔젤 변호사 - 공통 스타일시트
   ========================================================= */

/* Pretendard 웹폰트 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css');

/* ---------- Reset & Base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  background: #0a0a0a;
  color: #fff;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; }

/* ---------- Layout 공통 ---------- */
.app-container {
  max-width: 600px;
  margin: 0 auto;
  background: #121212;
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

/* ---------- 상단 진행률 바 ---------- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 1001;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  width: 0%;
  transition: width 0.05s linear;
}

/* ---------- 상단 고정 헤더 (뷰어 페이지용) ---------- */
.viewer-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.viewer-header-content {
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.viewer-header .title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.icon-btn {
  background: none;
  border: none;
  color: #fff;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }
.icon-btn:active { background: rgba(255, 255, 255, 0.2); }

/* ---------- 메인 리스트 Hero ---------- */
.hero-header {
  height: 320px;
  display: flex;
  align-items: flex-end;
  padding: 24px;
  background-size: cover;
  background-position: center;
}

.hero-content { width: 100%; }

.hero-tag {
  background: #e74c3c;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 10px;
  display: inline-block;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: 34px;
  font-weight: 900;
  margin-bottom: 8px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 14px;
  color: #e2e8f0;
  margin-bottom: 14px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  font-weight: 400;
}

.hero-stats {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: #cbd5e1;
  margin-bottom: 18px;
  font-weight: 500;
}

.subscribe-btn {
  background: #fff;
  color: #0f172a;
  border: none;
  padding: 9px 18px;
  border-radius: 22px;
  font-weight: 700;
  font-size: 13px;
  display: inline-block;
  transition: transform 0.15s, box-shadow 0.15s;
}

.subscribe-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* ---------- 에피소드 리스트 ---------- */
.episode-list-section {
  padding: 20px;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
}

.episode-item {
  display: flex;
  gap: 16px;
  background: #1e1e1e;
  padding: 14px;
  border-radius: 14px;
  align-items: center;
  border: 1px solid #2a2a2a;
  margin-bottom: 14px;
  transition: transform 0.2s, border-color 0.2s;
}

.episode-item:hover {
  transform: scale(1.015);
  border-color: #444;
}

.episode-item:active { transform: scale(0.99); }

.thumbnail {
  width: 82px;
  height: 82px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: #000;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 22px;
}

.episode-item:hover .thumbnail .overlay { opacity: 1; }

.episode-info {
  flex: 1;
  min-width: 0;
}

.episode-info h4 {
  font-size: 15px;
  margin-bottom: 5px;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #94a3b8;
}

.episode-meta .rating { color: #fbbf24; }

.arrow-right { color: #555; font-size: 18px; }

/* ---------- 뷰어 본문 ---------- */
.viewer-main {
  padding-top: 60px;
  padding-bottom: 100px;
}

.episode-info-box {
  padding: 24px 20px 20px;
  text-align: center;
}

.episode-info-box h2 {
  color: #fff;
  font-size: 22px;
  margin-bottom: 6px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.episode-info-box .date {
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
}

.image-container {
  display: flex;
  flex-direction: column;
  background: #000;
  min-height: 400px;
}

.webtoon-image {
  width: 100%;
  height: auto;
}

/* ---------- 뷰어 하단 액션 ---------- */
.footer-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 30px 0 20px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1e1e1e;
  border: 1px solid #333;
  color: #fff;
  padding: 11px 22px;
  border-radius: 30px;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 600;
}

.action-btn:hover {
  background: #2a2a2a;
  transform: translateY(-2px);
  border-color: #4CAF50;
}

.action-btn.liked {
  background: #2d1b1b;
  border-color: #e74c3c;
  color: #ff6b6b;
}

/* ---------- 에피소드 네비게이션 ---------- */
.episode-nav {
  display: flex;
  justify-content: space-between;
  padding: 20px;
  gap: 10px;
}

.nav-btn {
  flex: 1;
  padding: 13px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #1e1e1e;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.15s;
}

.nav-btn.primary {
  background: #2a2a2a;
  border-color: #444;
}

.nav-btn:hover:not(.disabled) {
  background: #333;
  border-color: #4CAF50;
}

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

/* ---------- Scroll to Top 버튼 ---------- */
.scroll-top-btn {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #4CAF50;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(76, 175, 80, 0.4);
  z-index: 1000;
  font-size: 22px;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top-btn:hover { transform: scale(1.08); }

/* ---------- Footer 배너 (공통) ---------- */
.footer-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 40px 20px;
  margin-top: 20px;
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.25s;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-banner:hover { opacity: 1; }

.firm-name {
  color: #e2e8f0;
  font-size: 15px;
  font-weight: 500;
  font-family: serif;
  letter-spacing: 1px;
}

.lawyer-name {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 300;
}

/* ---------- 변호사 소개 플로팅 배너 (메인에만) ---------- */
.lawyer-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #fff;
  padding: 11px 18px 11px 13px;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(30, 41, 59, 0.2);
  display: flex;
  align-items: center;
  gap: 11px;
  color: #1e293b !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 9999;
  border: 1.5px solid #cbd5e1;
}

.lawyer-banner:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(30, 41, 59, 0.25);
  border-color: #1e293b;
}

.lawyer-icon-box {
  width: 38px;
  height: 38px;
  background: #f1f5f9;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e293b;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.lawyer-text-box {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.lawyer-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.01em;
  font-family: 'MaruBuri', 'Pretendard Variable', serif;
}

.lawyer-subtitle {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 3px;
}

.lawyer-subtitle::after {
  content: '→';
  font-size: 0.85em;
  transition: transform 0.2s;
}

.lawyer-banner:hover .lawyer-subtitle::after {
  transform: translateX(3px);
}

/* ---------- 토스트 알림 (공유 시) ---------- */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 12px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- 반응형 ---------- */
@media (max-width: 768px) {
  .hero-title { font-size: 30px; }
  .hero-header { height: 290px; }
  .scroll-top-btn {
    bottom: 20px;
    left: 20px;
    width: 42px;
    height: 42px;
    font-size: 20px;
  }
  .lawyer-banner {
    bottom: 18px;
    right: 18px;
    padding: 9px 14px 9px 11px;
  }
  .lawyer-icon-box { width: 34px; height: 34px; font-size: 1rem; }
  .lawyer-title { font-size: 0.8rem; }
  .lawyer-subtitle { font-size: 0.66rem; }
}
