/* NOOK - Main styles (통합: css/style.css + assets/css/styles.css) */

:root{
  --bg:#e8eef5;
  --card:#ffffff;
  --card2:#f5f8fc;
  --muted:#5c6577;
  --text:#1a1f2e;
  --line:#d0d7e2;
  --lineSoft: rgba(0,0,0,.06);
  --brand:#2563eb;
  --brand2:#059669;
  --danger:#dc2626;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --r: 18px;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(37,99,235,.12), transparent 55%),
              radial-gradient(900px 500px at 90% 10%, rgba(5,150,105,.08), transparent 50%),
              var(--bg);
  color:var(--text);
}
a{color:inherit;text-decoration:none}
.wrap{
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 16px 92px;
}

/* Top bar */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin: 6px 0 14px;
  flex-shrink: 0;
}
.brand{
  display:flex;align-items:center;gap:12px;
  font-weight:900;
  letter-spacing:.2px;
}
.brand .brand-name{
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--brand);
  filter: drop-shadow(0 2px 4px rgba(37,99,235,.2));
}
.brand small{
  display:block;color:var(--muted);font-weight:700;margin-top:2px;
  letter-spacing:0;
}
.actions{
  display:flex;align-items:center;gap:10px;
  flex-shrink: 0;
}

/* topbar 반응형 */
@media (max-width: 768px){
  .topbar{ gap: 10px; margin: 4px 0 10px; }
  .brand .brand-name{ font-size: 22px; }
  .brand small{ font-size: 11px; }
  .pill{ padding: 8px 10px; font-size: 12px; }
}
@media (max-width: 600px){
  .topbar{ flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
  .brand{ order: 1; }
  .actions{ order: 2; margin-left: auto; }
  .brand .brand-name{ font-size: 20px; }
  .brand small{ font-size: 11px; }
  .pill{ padding: 6px 10px; font-size: 11px; }
}
@media (max-width: 400px){
  .brand small{ display: none; }
  .pill span:not(.dot){ max-width: 4ch; overflow: hidden; text-overflow: ellipsis; }
}
.pill{
  border:1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.9);
  color:var(--text);
  padding: 10px 12px;
  border-radius: 999px;
  font-weight:800;
  font-size: 13px;
  display:flex;gap:8px;align-items:center;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  cursor: pointer;
}
.pill:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px rgba(37,99,235,.14), 0 1px 3px rgba(0,0,0,.04);
}
.pill .dot{
  width:8px;height:8px;border-radius:99px;background: var(--brand);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
  flex-shrink: 0;
  transition: width .2s ease, height .2s ease, box-shadow .2s ease;
}
.pill .dot.dot--avatar{
  width: 24px;
  height: 24px;
  background-repeat: no-repeat;
  background-position: center;
}

/* Hero */
.hero{
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,253,.95));
  border: 1px solid rgba(0,0,0,.06);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px;
  overflow:hidden;
  position:relative;
}
.hero::before{
  content:"";
  position:absolute; inset:-1px;
  background: radial-gradient(700px 240px at 10% 0%, rgba(37,99,235,.12), transparent 55%),
              radial-gradient(700px 240px at 90% 0%, rgba(5,150,105,.08), transparent 60%);
  pointer-events:none;
  opacity:.95;
}
.hero > *{position:relative}

/* Paste box */
.paste{
  display:flex;
  gap:10px;
  align-items:stretch;
}
.paste .field{
  flex:1;
  border-radius: 14px;
  border:1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.8);
  padding: 12px 12px;
  min-height: 48px;
  display:flex;align-items:center;gap:10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.paste .field:focus-within{
  border-color: rgba(37,99,235,.5);
  box-shadow: 0 0 0 4px rgba(37,99,235,.1);
}
.paste .icon{
  width:36px;height:36px;border-radius:13px;
  background: rgba(37,99,235,.1);
  border:1px solid rgba(37,99,235,.2);
  display:grid;place-items:center;
  color: var(--brand);
  font-weight:900;
  flex:0 0 auto;
}
.paste input{
  width:100%;
  border:0;
  outline:0;
  background:transparent;
  color:var(--text);
  font-size: 14px;
}
.paste input::placeholder{color:var(--muted)}
.paste .btn{
  border:1px solid rgba(37,99,235,.25);
  background: linear-gradient(135deg, rgba(37,99,235,1), rgba(5,150,105,.85));
  color:#fff;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight:950;
  min-width: 96px;
  display:flex;align-items:center;justify-content:center;
  box-shadow: 0 8px 20px rgba(37,99,235,.2);
  cursor: pointer; /* ✅ default → pointer */
  user-select:none;
  text-align:center;
  transition: transform .12s ease, filter .12s ease;
}
.paste .btn:active{
  transform: translateY(1px) scale(.99);
  filter: brightness(.96);
}

.helper{
  display:flex;
  gap:10px;
  align-items:center;
  margin-top: 12px;
  flex-wrap:wrap;
}
.hint{
  color: var(--muted);
  font-size: 12.5px;
  display:flex;align-items:center;gap:8px;
}
.kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: var(--brand);
  border: 1px solid rgba(37,99,235,.25);
  background: rgba(37,99,235,.08);
  padding: 2px 8px;
  border-radius: 999px;
}

/* Category chips */
.chips{
  margin: 16px 0 10px;
  display:flex; gap:10px;
  overflow:auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.chip{
  flex:0 0 auto;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.9);
  color: var(--text);
  font-weight: 850;
  font-size: 13px;
  display:flex;align-items:center;gap:8px;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.chip:hover{transform: translateY(-1px)}
.chip .count{
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(0,0,0,.04);
}
.chip.active{
  border-color: rgba(5,150,105,.35);
  background: rgba(5,150,105,.1);
  color: #065f46;
}
.chip.active .count{
  border-color: rgba(5,150,105,.3);
  background: rgba(5,150,105,.12);
  color:#047857;
}

/* Section headers */
.section{margin-top: 18px;}
.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin: 10px 2px 10px;
}
.section-head h2{
  margin:0;
  font-size: 15px;
  letter-spacing:-.1px;
  color:var(--text);
}
.section-head .meta{
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 750;
}

/* Cards grid - 유튜브 썸네일 형태 */
.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 24px 16px;
}
@media (min-width: 720px){
  .wrap{padding: 22px 18px 28px;}
  .grid{grid-template-columns: repeat(2, 1fr);}
}
@media (min-width: 1040px){
  .grid{grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));}
}

.card{
  display:block;
  border: 1px solid rgba(0,0,0,.06);
  background: var(--card);
  border-radius: var(--r);
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  overflow:hidden;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, filter .12s ease;
  position: relative;
}
.card:hover{
  transform: translateY(-2px);
  border-color: rgba(37,99,235,.25);
  box-shadow: 0 12px 32px rgba(0,0,0,.1);
}
.card:hover .thumb{ border-radius: 0; }
.card:active{
  transform: translateY(0);
  filter: brightness(.98);
}

/* Pinned: 상단 포인트 바 */
.card.pinned{
  border-color: rgba(5,150,105,.2);
  background: var(--card);
}
.card.pinned .thumb::before{
  content:"";
  position:absolute;
  left:0; top:0; bottom:0;
  width:4px;
  background: linear-gradient(180deg, rgba(5,150,105,1), rgba(37,99,235,.8));
  z-index:1;
}

/* 썸네일: 16:9 전체 너비 */
.thumb{
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgba(37,99,235,.15), rgba(5,150,105,.1));
  border: 1px solid rgba(0,0,0,.06);
  border-radius: var(--r) var(--r) 0 0;
  overflow: hidden;
  position: relative;
  transition: border-radius .15s ease;
}
.thumb::after{
  content:"";
  position:absolute; inset:0;
  background: radial-gradient(60% 60% at 50% 50%, rgba(255,255,255,.25), transparent 70%);
  pointer-events: none;
}

.thumb .badge{
  position:absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(0,0,0,.6);
  color: #fff;
  z-index: 1;
}
.thumb .badge.badge--pinned{ background: rgba(5,150,105,.85); }
.thumb .badge.badge--news{ background: rgba(37,99,235,.85); }
.thumb .badge.badge--tools{ background: rgba(139,92,246,.85); }
.thumb .badge.badge--dev{ background: rgba(5,150,105,.85); }

/* 카드 하단: 아바타 + 메타 (유튜브 스타일) */
.card-info{
  display:flex;
  gap: 12px;
  padding: 12px 12px 14px;
}
.card-avatar{
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.08);
  flex-shrink: 0;
}
.card-meta{
  min-width: 0;
  flex: 1;
}
.card-title{
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 4px;
}
.domain{
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 2px;
}
.stats{
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.dot2{
  width:4px;height:4px;border-radius:99px;background: rgba(92,101,119,.5);
  display:inline-block;
  margin: 0 4px;
  vertical-align: middle;
}

/* Card actions - 썸네일 우상단 */
.card-actions{
  position:absolute;
  right: 8px;
  top: 8px;
  display:flex;
  gap: 6px;
  z-index: 2;
}
.mini-btn{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display:grid;
  place-items:center;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(0,0,0,.5);
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
  backdrop-filter: blur(4px);
  cursor: pointer;
}

/* Bottom nav (mobile) */
.bottom{
  position:fixed;
  left:0; right:0; bottom:0;
  padding: 10px 12px 14px;
  background: linear-gradient(180deg, rgba(232,238,245,0), rgba(255,255,255,.95) 34%, rgba(255,255,255,.98));
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0,0,0,.06);
}
.nav{
  max-width: 1080px;
  margin: 0 auto;
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.9);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px;
}
.nav a{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 14px;
  color: var(--muted);
  font-weight: 900;
  font-size: 11.5px;
  border: 1px solid transparent;
  background: transparent;
}
.nav a.active{
  border-color: rgba(5,150,105,.25);
  background: rgba(5,150,105,.08);
  color:#047857;
}
.nav .ic{
  width: 22px;height: 22px;border-radius: 8px;
  display:grid;place-items:center;
  background: rgba(0,0,0,.04);
  border: 1px solid rgba(0,0,0,.06);
  font-weight: 950;
  color:var(--text);
}

/* Desktop */
@media (min-width: 720px){
  .bottom{position:static; padding: 16px 0 0; background: none; backdrop-filter:none; border-top:none;}
  .nav{border-radius: var(--r);}
}

/* hero·paste·chips 반응형 */
@media (max-width: 600px){
  .wrap{ padding: 12px 12px 92px; }
  .hero{ padding: 12px; }
  .paste{ flex-direction: column; align-items: stretch; gap: 8px; }
  .paste .btn{ min-width: auto; }
  .chips{ gap: 6px; padding-bottom: 4px; }
  .chip{ padding: 8px 10px; font-size: 12px; }
  .chip .count{ font-size: 11px; padding: 2px 6px; }
}
@media (max-width: 400px){
  .wrap{ padding: 10px 10px 88px; }
  .helper{ flex-direction: column; align-items: flex-start; }
  .hint{ font-size: 11.5px; }
}

/* 로그인 모달 */
.login-modal{
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.login-modal.is-open{
  opacity: 1;
  visibility: visible;
}
.login-modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
  cursor: pointer;
}
.login-modal-box{
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow), 0 20px 60px rgba(0,0,0,.15);
  padding: 28px 24px;
  border: 1px solid var(--line);
}
.login-modal-close{
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
}
.login-modal-close:hover,
.login-modal-close:focus-visible{
  color: var(--text);
  background: var(--lineSoft);
}
.login-modal-title{
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}
.login-modal-desc{
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}
.btn-google{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  background: #fff;
  color: #1a1f2e;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  transition: background .15s, box-shadow .15s, border-color .15s;
}
.btn-google:hover,
.btn-google:focus-visible{
  background: var(--card2);
  border-color: #b0b8c4;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.btn-google:focus-visible{ outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.25); }
.btn-google-icon{
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(135deg, #4285f4, #34a853);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
