/* ========================================
   HobbyLinker - 메인 스타일시트
   ======================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1a1a2e;
  --accent: #e94560;
  --accent2: #0f3460;
  --bg: #f5f5f5;
  --bg-card: #ffffff;
  --text: #333;
  --text-light: #666;
  --text-muted: #999;
  --border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 6px 20px rgba(0,0,0,0.15);
  --radius: 8px;
  --nav-height: 60px;
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ── 네비게이션 ── */
.navbar {
  background: var(--primary);
  height: var(--nav-height);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
}
.nav-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  white-space: nowrap;
}
.btn-back-nav {
  color: #aaa;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: color 0.2s;
}
.btn-back-nav:hover { color: #fff; }
.nav-menu {
  display: flex;
  list-style: none;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.nav-item {
  color: #ccc;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-item:hover, .nav-item.active {
  color: #fff;
  background: rgba(255,255,255,0.15);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.nav-user { color: #aaa; font-size: 0.85rem; }
.admin-badge { color: var(--accent); font-weight: 700; font-size: 0.85rem; }
.btn-nav {
  color: #ccc;
  font-size: 0.85rem;
  padding: 5px 12px;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.2s;
}
.btn-nav:hover { color: #fff; border-color: rgba(255,255,255,0.5); }
.btn-login { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-login:hover { background: #c73652; }

/* ── 컨테이너 ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page-container { padding: 40px 20px; }

/* ── 히어로 ── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent2) 100%);
  padding: 80px 20px;
  text-align: center;
  color: #fff;
}
.hero-title { font-size: 2.8rem; font-weight: 700; margin-bottom: 12px; }
.hero-subtitle { font-size: 1.2rem; color: #aac; margin-bottom: 12px; }
.hero-desc { font-size: 1rem; color: #88a; max-width: 600px; margin: 0 auto; }

/* ── 섹션 ── */
.section-recent, .section-categories {
  padding: 60px 0;
}
.section-categories { background: var(--bg-card); }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}
.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  position: relative;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--accent);
}
.list-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 30px 0 16px;
  color: var(--primary);
}

/* ── 더보기 버튼 ── */
.btn-more {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--accent);
  padding: 6px 14px;
  border-radius: 15px;
  transition: all 0.2s;
}
.btn-more:hover { background: var(--accent); color: #fff; }

/* ── 비디오 그리드 ── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.video-grid-6col {
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.video-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
}
.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.video-thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #111;
  overflow: hidden;
}
.video-thumb img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.thumb-placeholder {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #222;
  color: #555;
  font-size: 2rem;
}
.play-overlay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  background: rgba(233,69,96,0.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.video-card:hover .play-overlay { opacity: 1; }
.video-info { padding: 10px; }
.video-title {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
  margin-bottom: 4px;
}
.video-channel { font-size: 0.75rem; color: var(--text-muted); }
.video-date { font-size: 0.72rem; color: var(--text-muted); }

/* ── 카테고리 그리드 ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}
.category-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  transition: all 0.2s;
  display: block;
}
.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.category-icon { font-size: 2.5rem; margin-bottom: 12px; }
.category-name { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; color: var(--primary); }
.category-desc { font-size: 0.82rem; color: var(--text-light); line-height: 1.5; }

/* ── 채널 헤더 ── */
.channel-header {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}
.channel-icon { font-size: 3rem; }
.channel-title { font-size: 1.8rem; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.channel-desc { font-size: 0.95rem; color: var(--text-light); }

/* ── 유튜브 채널 목록 ── */
.yt-channel-list { display: flex; flex-direction: column; gap: 12px; }
.yt-channel-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}
.yt-channel-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-hover);
  border-left: 3px solid var(--accent);
}
.yt-card-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}
.yt-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.yt-thumb-default {
  width: 100%;
  height: 100%;
  background: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 1.5rem;
}
.yt-card-info { flex: 1; }
.yt-name { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.yt-desc { font-size: 0.82rem; color: var(--text-light); margin-bottom: 8px; line-height: 1.5; }
.yt-rating { display: flex; gap: 16px; }
.rating-item { font-size: 0.8rem; color: var(--text-muted); }
.yt-card-arrow { font-size: 1.5rem; color: var(--text-muted); }

/* ── 유튜브 채널 상세 ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--accent); }
.yt-detail-header {
  display: flex;
  gap: 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}
.yt-detail-thumb {
  width: 140px;
  height: 140px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}
.yt-detail-thumb img { width: 100%; height: 100%; object-fit: cover; }
.yt-thumb-large {
  width: 100%;
  height: 100%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 3rem;
}
.yt-detail-name { font-size: 1.6rem; font-weight: 700; margin-bottom: 12px; }
.yt-detail-meta p { font-size: 0.9rem; margin-bottom: 6px; color: var(--text-light); }
.yt-detail-meta strong { color: var(--text); }
.yt-detail-desc { font-size: 0.88rem; color: var(--text-light); margin: 12px 0; line-height: 1.6; }
.btn-channel-link {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.btn-channel-link:hover { background: #c73652; }

/* ── 하루이야기 ── */
.daily-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.daily-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.daily-section-title { font-size: 1.2rem; font-weight: 600; }

/* 사진 그리드 */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.photo-card {
  display: block;
  text-align: center;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}
.photo-card:hover { transform: scale(1.02); }
.photo-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.photo-placeholder {
  height: 160px;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.photo-title { font-size: 0.85rem; padding: 8px 6px 2px; font-weight: 500; }
.photo-date { font-size: 0.75rem; color: var(--text-muted); padding-bottom: 8px; }

/* 글 목록 */
.post-list { list-style: none; }
.post-item { border-bottom: 1px solid var(--border); }
.post-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  transition: color 0.2s;
}
.post-link:hover { color: var(--accent); }
.post-icon { color: var(--accent); font-size: 0.85rem; }
.post-title { flex: 1; font-size: 0.92rem; }
.post-date { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }

/* 추천 유튜브 */
.recommend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.recommend-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid var(--border);
  transition: all 0.2s;
  display: block;
}
.recommend-card:hover { border-color: var(--accent); background: #fff5f7; }
.rec-date { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.rec-title { font-size: 0.88rem; font-weight: 500; }

/* 하루이야기 상세 페이지들 */
.photo-grid-large {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.photo-card-large img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
}
.photo-placeholder-large {
  height: 200px;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  border-radius: var(--radius) var(--radius) 0 0;
}
.photo-card-large {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: block;
  text-align: center;
  transition: transform 0.2s;
}
.photo-card-large:hover { transform: scale(1.02); }

.post-list-full { list-style: none; }
.post-item-full { border-bottom: 1px solid var(--border); }
.post-link-full {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  transition: color 0.2s;
}
.post-link-full:hover { color: var(--accent); }
.post-title-full { flex: 1; font-size: 1rem; }
.post-date-full { font-size: 0.8rem; color: var(--text-muted); }

.recommend-list { display: flex; flex-direction: column; gap: 8px; }
.recommend-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}
.recommend-item:hover { box-shadow: var(--shadow-hover); transform: translateX(4px); }
.rec-date-large { font-size: 0.8rem; color: var(--text-muted); width: 60px; flex-shrink: 0; }
.rec-info { flex: 1; }
.rec-title-large { font-size: 0.95rem; font-weight: 500; }
.rec-arrow { font-size: 1.5rem; color: var(--text-muted); }

/* ── 상세 페이지 ── */
.detail-page { max-width: 800px; }
.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--accent);
  font-size: 0.9rem;
}
.detail-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.detail-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 8px; }
.detail-date { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 24px; }
.detail-image { margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; }
.detail-image img { width: 100%; max-height: 500px; object-fit: contain; }
.detail-content { font-size: 1rem; line-height: 1.9; color: var(--text); }
.essay-content { white-space: pre-line; }
.youtube-embed-link { margin-bottom: 24px; }
.btn-watch {
  display: inline-block;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 500;
  transition: background 0.2s;
}
.btn-watch:hover { background: #c73652; }

/* ── 페이지네이션 ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}
.page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text);
  transition: all 0.2s;
}
.page-btn.active, .page-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── 페이지 헤더 ── */
.page-header {
  margin-bottom: 32px;
}
.page-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 8px; }
.page-desc { color: var(--text-light); }

/* ── 빈 상태 ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-msg { color: var(--text-muted); font-size: 0.9rem; }

/* ── 로그인 요청 ── */
.login-prompt {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.login-prompt a { color: var(--accent); }

/* ── 저작권 공지 ── */
.copyright-notice {
  background: #f0f0f0;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.copyright-notice p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 900px;
  margin: 0 auto;
}

/* ── 로그인 페이지 ── */
.login-page { min-height: 100vh; background: var(--primary); display: flex; }
.login-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.login-box {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-logo {
  display: block;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.login-title {
  text-align: center;
  font-size: 1.3rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  letter-spacing: 3px;
}
.role-selector {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
  justify-content: center;
}
.role-option { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.role-option input { cursor: pointer; }
.role-label { font-size: 0.9rem; color: var(--text); }
.form-group { margin-bottom: 16px; }
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--accent); }
.error-msg {
  background: #fff5f5;
  border: 1px solid #fcc;
  color: #c00;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 12px;
}
.btn-login-submit {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.btn-login-submit:hover { background: #c73652; }
.btn-back {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.btn-back:hover { color: var(--accent); }

/* ── 모달 ── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-content { font-size: 1rem; margin-bottom: 20px; color: var(--text); }
.modal-btns { display: flex; gap: 12px; justify-content: center; }
.btn-secondary {
  padding: 8px 20px;
  background: #f0f0f0;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
}

/* ── 플래시 메시지 ── */
.flash-messages { padding: 0; }
.flash-msg {
  padding: 12px 20px;
  font-size: 0.9rem;
}
.flash-success { background: #d4edda; color: #155724; }
.flash-error { background: #f8d7da; color: #721c24; }

/* ── 푸터 ── */
.footer {
  background: var(--primary);
  color: #aaa;
  padding: 30px 20px;
  margin-top: 60px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; text-align: center; }
.footer-inner p { font-size: 0.85rem; margin-bottom: 6px; }
.footer-notice { font-size: 0.75rem; color: #666; }

/* ── 반응형 ── */
@media (max-width: 1024px) {
  .video-grid { grid-template-columns: repeat(4, 1fr); }
  .video-grid-6col { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
  .hero-title { font-size: 1.8rem; }
  .nav-menu { display: none; }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .video-grid-6col { grid-template-columns: repeat(3, 1fr); }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .recommend-grid { grid-template-columns: 1fr; }
  .yt-detail-header { flex-direction: column; }
  .channel-header { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .video-grid-6col { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: 1fr; }
}
