/* 한국 역사 영화관 — 정적 사이트 통합 스타일 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-dark: #0a0a0f;
  --bg-card: #13131e;
  --bg-panel: #1a1a2e;
  --text-primary: #f0e6d3;
  --text-secondary: #a89880;
  --accent-gold: #d4a853;
  --accent-red: #c0392b;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'Noto Sans KR', sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
}

/* App.css */
.app-sticky-top {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-dark);
}

.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: rgba(168, 152, 128, 0.5);
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.site-footer .footer-count {
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .site-footer {
    padding: 2rem 1rem;
    font-size: 0.75rem;
  }
}

/* Header.css */
.site-header {
  background: linear-gradient(180deg, rgba(10, 10, 15, 0.98), rgba(10, 10, 15, 0.85));
  padding: 1rem 1.25rem 0.75rem;
  text-align: center;
  border-bottom: 1px solid rgba(212, 168, 83, 0.2);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.site-header h1 {
  font-family: 'Nanum Myeongjo', serif;
  font-size: clamp(1.25rem, 4vw, 2rem);
  background: linear-gradient(135deg, var(--accent-gold), #f0c080, var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.site-header p {
  color: var(--text-secondary);
  font-size: clamp(0.8rem, 2vw, 0.9rem);
}

@media (max-width: 768px) {
  .site-header {
    padding: 0.75rem 1rem 0.5rem;
  }
}

/* EraNav.css */
.era-nav-wrapper {
  position: sticky;
  top: 0;
  z-index: 99;
  background: rgba(13, 13, 20, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.era-nav {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 0 1rem;
  gap: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.era-nav::-webkit-scrollbar {
  display: none;
}

.era-tab {
  flex: 0 0 auto;
  padding: 0.6rem 1rem;
  font-size: clamp(0.7rem, 2vw, 0.8rem);
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s, border-color 0.2s;
  font-family: inherit;
}

.era-tab:hover {
  color: var(--text-primary);
}

.era-tab.active {
  color: var(--text-primary);
}

.era-tab-삼국시대.active { color: #cd853f; border-bottom-color: #8b4513; }
.era-tab-고려시대.active { color: #3cb371; border-bottom-color: #2e8b57; }
.era-tab-조선시대.active { color: #6495ed; border-bottom-color: #4169e1; }
.era-tab-조선말기.active { color: #da70d6; border-bottom-color: #9932cc; }
.era-tab-일제강점기.active { color: #ff6b6b; border-bottom-color: #dc143c; }
.era-tab-한국전쟁.active { color: #daa520; border-bottom-color: #b8860b; }
.era-tab-현대사.active { color: #48d1cc; border-bottom-color: #20b2aa; }

.era-movie-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.35rem;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .era-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.72rem;
  }
}

/* EraSection.css */
.era-section {
  padding: 2.5rem 1.5rem 3.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  scroll-margin-top: 120px;
}

.era-section:last-child {
  border-bottom: none;
}

.era-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.era-header::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.08;
}

.era-삼국시대 .era-header::before {
  background: linear-gradient(135deg, #8b4513, #cd853f);
}
.era-고려시대 .era-header::before {
  background: linear-gradient(135deg, #2e8b57, #3cb371);
}
.era-조선시대 .era-header::before {
  background: linear-gradient(135deg, #4169e1, #6495ed);
}
.era-조선말기 .era-header::before {
  background: linear-gradient(135deg, #9932cc, #da70d6);
}
.era-일제강점기 .era-header::before {
  background: linear-gradient(135deg, #dc143c, #ff6b6b);
}
.era-한국전쟁 .era-header::before {
  background: linear-gradient(135deg, #b8860b, #daa520);
}
.era-현대사 .era-header::before {
  background: linear-gradient(135deg, #20b2aa, #48d1cc);
}

.era-icon {
  font-size: 2.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.era-header-info h2 {
  font-family: 'Nanum Myeongjo', serif;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 800;
}

.era-삼국시대 .era-header-info h2 { color: #cd853f; }
.era-고려시대 .era-header-info h2 { color: #3cb371; }
.era-조선시대 .era-header-info h2 { color: #6495ed; }
.era-조선말기 .era-header-info h2 { color: #da70d6; }
.era-일제강점기 .era-header-info h2 { color: #ff6b6b; }
.era-한국전쟁 .era-header-info h2 { color: #daa520; }
.era-현대사 .era-header-info h2 { color: #48d1cc; }

.era-period {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.25rem 0 0.5rem;
  letter-spacing: 0.05em;
}

.era-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
  max-width: 700px;
}

.era-movies {
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .era-section {
    padding: 1.75rem 1rem 2.5rem;
    scroll-margin-top: 100px;
  }

  .era-header {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
  }

  .era-icon {
    font-size: 2rem;
  }
}

/* MovieItem.css */
.movie-item {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: transform 0.3s, box-shadow 0.3s;
}

.movie-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.movie-poster-col {
  position: relative;
  background: #0d0d14;
}

.movie-poster-img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}

.movie-item:hover .movie-poster-img {
  transform: scale(1.03);
}

.poster-placeholder {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, #1a1a2e, #0d0d1a);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.poster-placeholder.visible {
  display: flex;
}

.poster-placeholder .ph-icon {
  font-size: 2.5rem;
}

.movie-poster-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, transparent 50%);
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.poster-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(212, 168, 83, 0.9);
  border: none;
  color: #000;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.3s;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.movie-item:hover .poster-play-btn {
  opacity: 1;
}

.movie-info-col {
  padding: 1.25rem 1.5rem 1.25rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.movie-year-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  width: fit-content;
}

.movie-title {
  font-family: 'Nanum Myeongjo', serif;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.movie-history-tag {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--accent-gold);
  border-radius: 0 6px 6px 0;
  line-height: 1.5;
}

.movie-desc {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  flex: 1;
}

.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.meta-label {
  color: var(--accent-gold);
  font-weight: 600;
}

.youtube-embed-wrapper {
  width: 80%;
  max-width: 800px;
  margin: 0 auto;
}

.youtube-embed-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.youtube-embed-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.era-삼국시대 .movie-year-badge {
  background: rgba(139, 69, 19, 0.3);
  color: #cd853f;
  border: 1px solid rgba(139, 69, 19, 0.5);
}
.era-고려시대 .movie-year-badge {
  background: rgba(46, 139, 87, 0.3);
  color: #3cb371;
  border: 1px solid rgba(46, 139, 87, 0.5);
}
.era-조선시대 .movie-year-badge {
  background: rgba(65, 105, 225, 0.3);
  color: #6495ed;
  border: 1px solid rgba(65, 105, 225, 0.5);
}
.era-조선말기 .movie-year-badge {
  background: rgba(153, 50, 204, 0.3);
  color: #da70d6;
  border: 1px solid rgba(153, 50, 204, 0.5);
}
.era-일제강점기 .movie-year-badge {
  background: rgba(220, 20, 60, 0.3);
  color: #ff6b6b;
  border: 1px solid rgba(220, 20, 60, 0.5);
}
.era-한국전쟁 .movie-year-badge {
  background: rgba(184, 134, 11, 0.3);
  color: #daa520;
  border: 1px solid rgba(184, 134, 11, 0.5);
}
.era-현대사 .movie-year-badge {
  background: rgba(32, 178, 170, 0.3);
  color: #48d1cc;
  border: 1px solid rgba(32, 178, 170, 0.5);
}

@media (max-width: 768px) {
  .movie-item {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 2rem;
  }

  .movie-poster-col {
    max-height: 70vw;
  }

  .movie-poster-img,
  .poster-placeholder {
    width: 100%;
    height: 60vw;
    max-height: 420px;
    aspect-ratio: auto;
    object-fit: cover;
  }

  .movie-info-col {
    padding: 1rem 1rem 1.25rem;
  }

  .movie-title {
    font-size: 1.35rem;
  }

  .movie-desc {
    font-size: 0.88rem;
  }

  .youtube-embed-wrapper {
    width: 90%;
    max-width: none;
  }

  .youtube-embed-container {
    border-radius: 8px;
  }
}

@media (max-width: 480px) {
  .movie-item {
    margin-bottom: 1.75rem;
  }
}

/* ProgressBar.css */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-red));
  z-index: 9999;
  transition: width 0.1s;
}

/* BackToTop.css */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-gold);
  color: #000;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  transition: opacity 0.3s, transform 0.3s;
}

.back-to-top.visible {
  display: flex;
}

.back-to-top:hover {
  background: #f0c080;
  transform: translateY(-3px);
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
}

/* AdBanner.css */
.ad-banner-wrapper {
  width: 100%;
  max-width: 50%;
  margin: 2rem auto;
  padding: 0.5rem 0;
  min-height: 45px;
  max-height: 50px;
  display: block;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  box-sizing: border-box;
}

.ad-banner-wrapper .adsbygoogle {
  display: block !important;
  min-width: 280px;
  width: 100%;
  max-width: 100%;
  max-height: 45px;
}

@media (max-width: 768px) {
  .ad-banner-wrapper {
    max-width: 100%;
    width: calc(100% - 1.5rem);
    margin: 1rem auto;
    padding: 0.5rem 0.75rem;
    min-height: 50px;
  }

  .ad-banner-wrapper .adsbygoogle {
    min-width: 0;
    max-width: 100%;
  }
}

/* AdFooter.css */
.ad-footer-wrapper {
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ad-footer-wrapper .adsbygoogle {
  display: block;
  min-width: 320px;
  max-width: 100%;
}
