/* =========================================
   오늘연구소 — Netflix Dark Theme
   ========================================= */

:root {
  --bg:        #141414;
  --bg2:       #1c1c1c;
  --bg3:       #242424;
  --red:       #e50914;
  --red2:      #f40612;
  --white:     #ffffff;
  --gray1:     #e5e5e5;
  --gray2:     #b3b3b3;
  --gray3:     #757575;
  --green:     #46d369;
  --nav-h:     68px;
  --radius:    12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

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

/* ---- NAVBAR ---- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  padding: 0 4%;
  background: linear-gradient(to bottom, rgba(0,0,0,.85) 0%, transparent 100%);
  transition: background .4s, box-shadow .4s;
}
.navbar.scrolled {
  background: var(--bg);
  box-shadow: 0 2px 20px rgba(0,0,0,.7);
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 36px;
}
.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.logo-emoji { font-size: 26px; }
.logo-text {
  font-size: 22px;
  font-weight: 900;
  color: var(--red);
  letter-spacing: -1px;
}
.nav-links {
  display: flex;
  list-style: none;
  gap: 22px;
}
.nav-link {
  text-decoration: none;
  color: var(--gray2);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.nav-link:hover, .nav-link.active { color: var(--white); }

/* Search */
.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-icon-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}
.search-icon-btn:hover { transform: scale(1.1); }
.search-input {
  width: 0;
  overflow: hidden;
  background: rgba(20,20,20,.9);
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--white);
  padding: 0;
  font-size: 14px;
  transition: all .35s;
  font-family: inherit;
  outline: none;
}
.search-box.open .search-input {
  width: 220px;
  padding: 7px 14px;
  border-color: rgba(255,255,255,.35);
}
.search-input::placeholder { color: var(--gray3); }

/* ---- HERO ---- */
.hero {
  position: relative;
  min-height: 62vh;
  display: flex;
  align-items: flex-end;
  padding: 0 6% 60px;
  overflow: hidden;
  background: linear-gradient(135deg, #0d0d1a 0%, #1a0a2e 40%, #2d1b69 100%);
}
.hero-bg-anim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 75% 35%, rgba(229,9,20,.18) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 15% 70%, rgba(100,30,180,.22) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 10%, rgba(50,100,255,.1) 0%, transparent 50%);
  animation: bgPulse 8s ease-in-out infinite alternate;
}
@keyframes bgPulse {
  from { opacity: .8; }
  to   { opacity: 1; }
}
.hero-fade-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 220px;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 620px;
}
.hero-badge {
  display: inline-block;
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 18px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.hero-content h1 {
  font-size: 54px;
  font-weight: 900;
  line-height: 1.08;
  margin-bottom: 18px;
  text-shadow: 0 4px 24px rgba(0,0,0,.6);
}
.hero-content p {
  font-size: 18px;
  color: var(--gray2);
  margin-bottom: 32px;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 14px; margin-bottom: 26px; }
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--red);
  color: white;
  text-decoration: none;
  padding: 14px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary:hover { background: var(--red2); transform: scale(1.04); }
.btn-secondary {
  background: rgba(255,255,255,.15);
  color: white;
  border: 1.5px solid rgba(255,255,255,.3);
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  backdrop-filter: blur(6px);
}
.btn-secondary:hover { background: rgba(255,255,255,.25); }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
  color: var(--gray2);
}

/* ---- SECTIONS ---- */
.section {
  padding: 44px 4% 16px;
  position: relative;
  z-index: 2;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.section-title {
  font-size: 20px;
  font-weight: 700;
}

/* ---- HORIZONTAL SCROLL ROW ---- */
.scroll-wrapper {
  overflow-x: auto;
  margin: 0 -4%;
  padding: 8px 4% 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.scroll-wrapper::-webkit-scrollbar { height: 4px; }
.scroll-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.2);
  border-radius: 2px;
}
.cards-row {
  display: flex;
  gap: 14px;
  width: max-content;
}

/* ---- POPULAR CARD (tall, 넷플릭스 포스터 비율) ---- */
.pop-card {
  width: 172px;
  height: 255px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  text-decoration: none;
  display: block;
  cursor: pointer;
  transition: transform .4s cubic-bezier(.4,0,.2,1), box-shadow .4s;
}
.pop-card:hover {
  transform: scale(1.1) translateY(-8px);
  box-shadow: 0 24px 60px rgba(0,0,0,.7), 0 0 40px rgba(229,9,20,.15);
  z-index: 10;
}
.pop-card-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
  position: relative;
}
.pop-card-badge {
  position: absolute;
  top: 10px; left: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: .8px;
  backdrop-filter: blur(4px);
}
.badge-hot { background: var(--red); color: white; }
.badge-new { background: var(--green); color: #0a0a0a; }
.pop-card-emoji {
  font-size: 58px;
  margin-bottom: 14px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.4));
}
.pop-card-title {
  font-size: 13px;
  font-weight: 700;
  color: white;
  text-align: center;
  line-height: 1.4;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
}
.pop-card-count {
  position: absolute;
  bottom: 10px; right: 10px;
  font-size: 10px;
  color: rgba(255,255,255,.8);
  background: rgba(0,0,0,.45);
  padding: 2px 7px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

/* ---- CATEGORY SECTION ---- */
.category-section {
  padding: 44px 4% 60px;
  position: relative;
  z-index: 2;
}
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 34px;
}
.tab {
  background: var(--bg3);
  color: var(--gray2);
  border: 1.5px solid rgba(255,255,255,.08);
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.tab:hover {
  background: rgba(255,255,255,.12);
  color: var(--white);
  border-color: rgba(255,255,255,.25);
}
.tab.active {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

/* ---- TESTS GRID ---- */
.tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

/* ---- GRID CARD ---- */
.grid-card {
  background: var(--bg2);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: block;
  border: 1.5px solid rgba(255,255,255,.04);
}
.grid-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 44px rgba(0,0,0,.5);
  border-color: rgba(255,255,255,.12);
}
.grid-card-img {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.grid-card-emoji {
  font-size: 62px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.35));
}
.grid-card-new-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--green);
  color: #0a0a0a;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: .8px;
}
.grid-card-body { padding: 16px 18px 18px; }
.grid-card-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 6px;
}
.grid-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
  line-height: 1.4;
}
.grid-card-desc {
  font-size: 12px;
  color: var(--gray3);
  line-height: 1.55;
  margin-bottom: 14px;
}
.grid-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.grid-card-count { font-size: 12px; color: var(--gray3); }
.grid-card-time {
  font-size: 11px;
  color: var(--gray3);
  background: rgba(255,255,255,.06);
  padding: 3px 9px;
  border-radius: 4px;
}

/* ---- FOOTER ---- */
.footer {
  padding: 60px 4%;
  border-top: 1px solid rgba(255,255,255,.06);
  text-align: center;
}
.footer-inner { max-width: 400px; margin: 0 auto; }
.footer-logo {
  font-size: 22px;
  font-weight: 900;
  color: var(--gray3);
  margin-bottom: 14px;
}
.footer p { color: var(--gray3); font-size: 13px; line-height: 2; }

/* ==============================
   TEST PAGE SHARED STYLES
   ============================== */
.test-wrap {
  min-height: 100vh;
  background: var(--bg);
  padding-top: calc(var(--nav-h) + 20px);
}
.test-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* Test header */
.test-header {
  text-align: center;
  margin-bottom: 44px;
}
.test-header-emoji {
  font-size: 72px;
  display: block;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.4));
}
.test-header h1 {
  font-size: 30px;
  font-weight: 900;
  margin-bottom: 10px;
  line-height: 1.25;
}
.test-header p {
  color: var(--gray2);
  font-size: 15px;
  line-height: 1.7;
}
.test-meta {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--gray3);
}

/* Progress */
.progress-bar-wrap {
  background: var(--bg3);
  border-radius: 50px;
  height: 6px;
  margin-bottom: 32px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red) 0%, #ff6b6b 100%);
  border-radius: 50px;
  transition: width .5s ease;
}
.progress-text {
  text-align: right;
  font-size: 12px;
  color: var(--gray3);
  margin-top: -26px;
  margin-bottom: 22px;
}

/* Question */
.question-card {
  background: var(--bg2);
  border-radius: 16px;
  padding: 34px 32px;
  border: 1.5px solid rgba(255,255,255,.06);
}
.question-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}
.question-text {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 30px;
}

/* Choices */
.choices { display: flex; flex-direction: column; gap: 12px; }
.choice-btn {
  background: var(--bg3);
  border: 1.5px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 16px 20px;
  text-align: left;
  color: var(--gray1);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 14px;
}
.choice-btn:hover {
  background: rgba(229,9,20,.12);
  border-color: rgba(229,9,20,.4);
  color: var(--white);
  transform: translateX(4px);
}
.choice-letter {
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

/* Result */
.result-card {
  background: var(--bg2);
  border-radius: 20px;
  padding: 44px 36px;
  border: 1.5px solid rgba(255,255,255,.08);
  text-align: center;
  animation: fadeInUp .5s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.result-emoji { font-size: 80px; display: block; margin-bottom: 20px; }
.result-type {
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.result-title {
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 18px;
  line-height: 1.2;
}
.result-desc {
  font-size: 15px;
  color: var(--gray2);
  line-height: 1.8;
  margin-bottom: 30px;
  text-align: left;
}
.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 36px;
}
.result-tag {
  background: rgba(229,9,20,.15);
  border: 1px solid rgba(229,9,20,.3);
  color: #ff6b6b;
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 50px;
  font-weight: 500;
}
.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-share {
  background: #1da1f2;
  color: white;
  border: none;
  padding: 12px 26px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-share:hover { opacity: .85; transform: scale(1.02); }
.btn-retry {
  background: var(--bg3);
  color: var(--gray1);
  border: 1.5px solid rgba(255,255,255,.12);
  padding: 12px 26px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-retry:hover { background: rgba(255,255,255,.1); }
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gray2);
  text-decoration: none;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,.1);
  transition: var(--transition);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.btn-back:hover { color: white; border-color: rgba(255,255,255,.3); }

/* Input style */
.input-field {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 14px 18px;
  color: var(--white);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  margin-bottom: 16px;
}
.input-field:focus { border-color: var(--red); }
.input-field::placeholder { color: var(--gray3); }
.input-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray2);
  margin-bottom: 8px;
}

/* Mood chips */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.chip {
  background: var(--bg3);
  border: 1.5px solid rgba(255,255,255,.1);
  color: var(--gray2);
  padding: 10px 20px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  font-family: inherit;
}
.chip:hover, .chip.selected {
  background: rgba(229,9,20,.15);
  border-color: rgba(229,9,20,.5);
  color: white;
}

/* Stats bars (for 연애 능력치) */
.stat-row { margin-bottom: 18px; }
.stat-label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 7px;
}
.stat-bar-bg {
  background: var(--bg3);
  border-radius: 50px;
  height: 10px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  border-radius: 50px;
  transition: width 1.2s cubic-bezier(.4,0,.2,1) .2s;
}

.section-count {
  font-size: 13px;
  color: var(--gray3);
  font-weight: 500;
}
.nav-board {
  color: #ffd700 !important;
  font-weight: 700 !important;
}
.nav-board:hover { color: #fff !important; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero-content h1 { font-size: 38px; }
  .hero { min-height: 52vh; padding-bottom: 50px; }
}
@media (max-width: 600px) {
  .hero-content h1 { font-size: 26px; }
  .hero-content p { font-size: 14px; }
  .hero-actions { flex-wrap: wrap; gap: 10px; }
  .tests-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .pop-card { width: 148px; height: 220px; }
  .section { padding: 28px 4% 10px; }
  .question-card { padding: 22px 18px; }
  .question-text { font-size: 17px; }
  .result-card { padding: 28px 18px; }
  .result-title { font-size: 22px; }
  .result-emoji { font-size: 60px; }
  .test-header-emoji { font-size: 52px; }
  .test-header h1 { font-size: 24px; }
  .test-meta { flex-wrap: wrap; gap: 8px; justify-content: center; }
  .btn-share, .btn-retry, .btn-back { font-size: 13px; padding: 11px 18px; }
}
@media (max-width: 400px) {
  .hero-content h1 { font-size: 22px; }
  .tests-grid { grid-template-columns: 1fr; }
  .result-card { padding: 22px 14px; }
}
