/*
 * Guangyang Library Restructuring H5 - Scroll-Based Style System
 * Designed by Antigravity, 2026
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800;900&family=Noto+Sans+SC:wght@300;400;700;900&display=swap');

:root {
  --yellow: #FFDE4D;
  --pink: #FF4E88;
  --cyan: #39A7FF;
  --orange: #FF7643;
  --green: #00DFA2;
  --purple: #8B5CF6;
  --dark: #1A1A1A;
  --white: #FFFFFF;
  --light-gray: #F4F4F9;
  --pop-border: 4px solid var(--dark);
  --pop-shadow: 6px 6px 0px var(--dark);
  --pop-shadow-large: 10px 10px 0px var(--dark);
  --pop-shadow-small: 3px 3px 0px var(--dark);
  --font-family: 'Outfit', 'Noto Sans SC', sans-serif;
}

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

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  width: 100%;
  min-height: 100%;
  font-family: var(--font-family);
  background-color: var(--light-gray);
  color: var(--dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Memphis Patterns --- */
.pattern-dots {
  background-color: var(--white);
  background-image: radial-gradient(var(--dark) 10%, transparent 11%);
  background-size: 16px 16px;
}

.pattern-grid {
  background-color: var(--white);
  background-size: 24px 24px;
  background-image: linear-gradient(to right, rgba(26, 26, 26, 0.08) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(26, 26, 26, 0.08) 1px, transparent 1px);
}

/* --- Core UI Elements --- */
.pop-card {
  background: var(--white);
  border: var(--pop-border);
  box-shadow: var(--pop-shadow);
  padding: 15px;
  border-radius: 4px;
  position: relative;
}

.pop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--yellow);
  border: var(--pop-border);
  box-shadow: var(--pop-shadow-small);
  color: var(--dark);
  font-weight: 800;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.1s ease;
  user-select: none;
}

.pop-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--pop-shadow);
}

.pop-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px var(--dark);
}

.pop-badge {
  display: inline-block;
  background-color: var(--pink);
  color: var(--white);
  border: var(--pop-border);
  font-size: 12px;
  font-weight: 900;
  padding: 2px 8px;
  transform: rotate(-1.5deg);
}

/* --- Fixed Top Navigation --- */
.pop-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: var(--white);
  border-bottom: var(--pop-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 1000;
}

.nav-title {
  font-weight: 900;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo-icon {
  background: var(--pink);
  width: 18px;
  height: 18px;
  border: 2px solid var(--dark);
  display: inline-block;
  transform: rotate(15deg);
}

.nav-links {
  display: flex;
  gap: 15px;
}

.nav-link {
  color: var(--dark);
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  padding: 4px 8px;
  transition: all 0.15s;
}

.nav-link:hover {
  color: var(--pink);
}

/* --- Scroll Container & Sections --- */
.scroll-container {
  margin-top: 60px;
  width: 100%;
}

.section {
  padding: 80px 40px;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: var(--pop-border);
  position: relative;
}

/* --- Section 1: Cover --- */
.cover-section {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 20px;
}

.cover-wrapper {
  max-width: 900px;
  position: relative;
  width: 100%;
}

.cover-badge-top {
  display: inline-block;
  background: var(--pink);
  color: var(--white);
  border: var(--pop-border);
  font-size: 14px;
  font-weight: 900;
  padding: 4px 12px;
  margin-bottom: 20px;
  transform: rotate(-2deg);
}

.cover-title {
  font-size: 60px;
  font-weight: 900;
  color: var(--dark);
  text-shadow: 4px 4px 0px var(--yellow);
  margin-bottom: 15px;
  letter-spacing: -1px;
}

.cover-subtitle {
  font-size: 22px;
  font-weight: 800;
  color: var(--dark);
  background: var(--white);
  border: var(--pop-border);
  box-shadow: var(--pop-shadow-small);
  padding: 12px 20px;
  display: inline-block;
  margin-bottom: 30px;
  transform: rotate(1deg);
}

.cover-summary-cards {
  display: grid;
  grid-template-cols: repeat(4, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.summary-card {
  text-align: center;
  padding: 20px 10px;
}

.summary-num {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 8px;
}

.summary-text {
  font-size: 13px;
  color: var(--dark);
  line-height: 1.4;
}

.pop-sticker {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  animation: floatSticker 4s ease-in-out infinite alternate;
}

.pop-sticker:nth-child(even) {
  animation-duration: 5s;
  animation-delay: 1s;
}

@keyframes floatSticker {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(-10px) rotate(5deg);
  }
}

/* --- Section 2: Concept --- */
.concept-section {
  background: var(--light-gray);
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-tag {
  display: inline-block;
  background: var(--cyan);
  color: var(--dark);
  border: var(--pop-border);
  font-weight: 900;
  font-size: 13px;
  padding: 4px 12px;
  transform: rotate(-1deg);
}

.section-title {
  font-size: 32px;
  font-weight: 900;
  margin-top: 15px;
}

.concept-grid {
  display: grid;
  grid-template-cols: 1fr 1.2fr;
  gap: 40px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

.concept-visual {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.visual-banner {
  background: var(--yellow);
  border: var(--pop-border);
  box-shadow: var(--pop-shadow);
  padding: 25px;
  font-size: 24px;
  font-weight: 900;
  text-align: center;
  transform: rotate(-1.5deg);
}

.concept-cards-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.concept-row-card {
  background: var(--white);
  border: var(--pop-border);
  box-shadow: var(--pop-shadow-small);
  padding: 15px;
  display: flex;
  gap: 15px;
  align-items: center;
  border-radius: 4px;
}

.concept-icon-box {
  width: 60px;
  height: 60px;
  background: var(--yellow);
  border: var(--pop-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  flex-shrink: 0;
  transform: rotate(-3deg);
}

.concept-card-content h3 {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 5px;
}

.concept-card-content p {
  font-size: 13px;
  line-height: 1.5;
  color: #555;
}

/* --- Sections 3-6: Floor Layout Sections --- */
.floor-section {
  display: grid;
  grid-template-cols: 450px 1fr;
  gap: 40px;
  align-items: start;
  max-width: 1400px;
  margin: 0 auto;
  border-bottom: var(--pop-border);
}

.floor-info-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.floor-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.floor-badge {
  align-self: flex-start;
  background-color: var(--pink);
  color: var(--white);
  border: var(--pop-border);
  font-size: 13px;
  font-weight: 900;
  padding: 3px 10px;
  transform: rotate(-1deg);
}

.floor-title-text {
  font-size: 26px;
  font-weight: 900;
  line-height: 1.2;
}

.floor-desc-text {
  font-size: 14px;
  color: #444;
  line-height: 1.6;
}

.floor-highlight-box {
  background: var(--white);
  border: var(--pop-border);
  box-shadow: var(--pop-shadow-small);
  padding: 20px;
}

.highlight-box-title {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 12px;
  color: var(--pink);
}

.highlight-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.highlight-item {
  display: flex;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.highlight-bullet {
  color: var(--pink);
  font-weight: 900;
}

/* --- Inline Room Detail Card --- */
.room-detail-card {
  margin-top: 10px;
  background: var(--white);
  border: var(--pop-border);
  box-shadow: var(--pop-shadow);
  padding: 18px;
  position: relative;
  display: none;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% {
    transform: scale(0.95) translateY(10px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed var(--dark);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.popup-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.popup-room-name {
  font-size: 18px;
  font-weight: 900;
  color: var(--pink);
}

.popup-room-badge {
  font-size: 10px;
  font-weight: 900;
  background: var(--yellow);
  border: 1.5px solid var(--dark);
  padding: 1px 6px;
  border-radius: 2px;
}

.popup-close-btn {
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--dark);
  background: var(--light-gray);
  transition: all 0.1s;
}

.popup-close-btn:hover {
  background: var(--pink);
  color: var(--white);
}

.popup-body {
  font-size: 13px;
  line-height: 1.5;
}

.popup-desc {
  margin-bottom: 12px;
  color: #333;
}

.popup-features-wrapper {
  border-top: 2px dashed var(--dark);
  padding-top: 10px;
}

.popup-features-title {
  font-weight: 900;
  margin-bottom: 6px;
}

.popup-feature-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.popup-feature-tag {
  font-size: 11px;
  font-weight: 700;
  background: var(--light-gray);
  border: 1.5px solid var(--dark);
  padding: 2px 6px;
  border-radius: 2px;
}

/* --- Vector Map Viewer (Single Map Scroll Mode) --- */
.floor-map-container {
  background: var(--white);
  border: var(--pop-border);
  box-shadow: var(--pop-shadow);
  padding: 15px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.map-svg-frame-scroll {
  flex: 1;
  position: relative;
  border: 2px solid rgba(26, 26, 26, 0.15);
  background: #f8fafc;
  width: 100%;
  aspect-ratio: 1400 / 1200;
}

.map-svg-frame-scroll svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* SVG Rendering styles */
.blueprint-svg-element .svg-grid {
  stroke: rgba(0, 0, 0, 0.05);
  stroke-width: 0.5px;
}

.blueprint-svg-element .svg-grid-major {
  stroke: rgba(0, 0, 0, 0.1);
  stroke-width: 1px;
}

.blueprint-svg-element .wall-outer {
  stroke: var(--dark);
  stroke-width: 6px;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.blueprint-svg-element .wall-inner {
  stroke: var(--dark);
  stroke-width: 3px;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.blueprint-svg-element .window-symbol {
  stroke: var(--cyan);
  stroke-width: 2.5px;
}

.blueprint-svg-element .door-leaf {
  stroke: var(--dark);
  stroke-width: 2.5px;
}

.blueprint-svg-element .door-arc {
  stroke: var(--dark);
  stroke-width: 1px;
  stroke-dasharray: 3 3;
  fill: none;
}

.blueprint-svg-element .stair-step {
  stroke: var(--dark);
  stroke-width: 1px;
}

/* Room polygon fill colors */
.blueprint-svg-element .room-fill {
  fill-opacity: 0.25;
  transition: fill 0.2s ease, fill-opacity 0.2s ease;
}

.blueprint-svg-element .room-fill.highlighted {
  stroke: var(--dark) !important;
  stroke-width: 4px !important;
  fill-opacity: 0.45 !important;
}

.blueprint-svg-element.style-reconstruct .room-fill.room-lobby { fill: var(--pink) !important; }
.blueprint-svg-element.style-reconstruct .room-fill.room-reading { fill: var(--yellow) !important; }
.blueprint-svg-element.style-reconstruct .room-fill.room-office { fill: var(--cyan) !important; }
.blueprint-svg-element.style-reconstruct .room-fill.room-service { fill: var(--orange) !important; }
.blueprint-svg-element.style-reconstruct .room-fill.room-toilet { fill: var(--purple) !important; }
.blueprint-svg-element.style-reconstruct .room-fill.room-vertical { fill: #ef4444 !important; }
.blueprint-svg-element.style-reconstruct .room-fill.room-corridor { fill: #cbd5e1 !important; }

/* SVG Typography styling */
.blueprint-svg-element .room-label-title {
  fill: var(--dark);
  font-family: var(--font-family);
  font-weight: 900;
  font-size: 13.5px;
  text-anchor: middle;
}

.blueprint-svg-element .room-label-area {
  fill: #555;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 10px;
  text-anchor: middle;
}

/* Badge specific colors in tooltip & detail panel */
.category-lobby { background: var(--pink) !important; color: var(--white) !important; }
.category-reading { background: var(--yellow) !important; color: var(--dark) !important; }
.category-office { background: var(--cyan) !important; color: var(--white) !important; }
.category-service { background: var(--orange) !important; color: var(--white) !important; }
.category-toilet { background: var(--purple) !important; color: var(--white) !important; }
.category-vertical { background: #ef4444 !important; color: var(--white) !important; }
.category-corridor { background: #cbd5e1 !important; color: var(--dark) !important; }

/* Tooltip on mouse hover */
.custom-tooltip {
  position: fixed;
  background: var(--white);
  border: 3px solid var(--dark);
  box-shadow: 4px 4px 0px var(--dark);
  padding: 6px 10px;
  z-index: 2000;
  pointer-events: none;
  font-size: 11.5px;
  font-weight: 800;
  display: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.tooltip-badge {
  font-size: 9px;
  font-weight: 900;
  padding: 2px 5px;
  border: 1.5px solid var(--dark);
  display: inline-block;
  margin-bottom: 4px;
}

/* --- Section 7: Interactive Naming Vote Wall --- */
.vote-section {
  background: var(--white);
}

.vote-intro {
  max-width: 800px;
  background: var(--white);
  border: var(--pop-border);
  box-shadow: var(--pop-shadow);
  padding: 25px;
  margin: 0 auto 40px auto;
  text-align: center;
}

.vote-intro-text {
  font-size: 14px;
  line-height: 1.6;
  margin-top: 12px;
  color: #444;
}

.vote-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-cols: repeat(auto-fit, minmax(240px, 1fr));
  gap: 25px;
}

.vote-card {
  background: var(--white);
  border: var(--pop-border);
  box-shadow: var(--pop-shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 290px;
  border-radius: 4px;
}

.vote-floor-indicator {
  font-size: 10px;
  font-weight: 900;
  background: var(--dark);
  color: var(--white);
  padding: 2px 6px;
  align-self: flex-start;
  margin-bottom: 12px;
  transform: rotate(-1.5deg);
}

.vote-opt {
  margin-bottom: 10px;
}

.vote-opt-title {
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 3px;
  line-height: 1.4;
}

.vote-opt-desc {
  font-size: 11px;
  color: #666;
  line-height: 1.4;
}

.vote-action-btn-row {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.vote-progress-bar-container {
  height: 16px;
  background: var(--light-gray);
  border: 2px solid var(--dark);
  position: relative;
  overflow: hidden;
  margin-bottom: 6px;
  display: none;
}

.vote-progress-fill {
  height: 100%;
  background: var(--pink);
  width: 0%;
  transition: width 0.8s cubic-bezier(0.175, 0.885, 0.32, 1);
}

.vote-pct-text {
  font-weight: 900;
  font-size: 11px;
  text-align: right;
  display: none;
}

/* --- Section 8: Philosophy / Case Study Grid --- */
.case-section {
  background: var(--light-gray);
}

.case-grid {
  display: grid;
  grid-template-cols: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  max-width: 1200px;
  margin: 0 auto;
}

.case-card {
  background: var(--white);
  border: var(--pop-border);
  box-shadow: var(--pop-shadow);
  padding: 25px;
  border-radius: 4px;
}

.case-card-header {
  border-bottom: 3px solid var(--dark);
  padding-bottom: 12px;
  margin-bottom: 15px;
}

.case-badge {
  background: var(--orange);
  color: var(--white);
  border: 2px solid var(--dark);
  font-size: 10px;
  font-weight: 900;
  padding: 2px 6px;
  display: inline-block;
  margin-bottom: 8px;
  transform: rotate(-1.5deg);
}

.case-card-title {
  font-size: 18px;
  font-weight: 900;
}

.case-content-list {
  list-style: none;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.case-content-list li::before {
  content: '⚡ ';
  font-weight: 900;
  color: var(--pink);
}

/* --- Section 9: Footer --- */
.footer-section {
  background: #111;
  color: #fff;
  padding: 60px 20px;
  text-align: center;
  border-top: var(--pop-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.footer-logo {
  font-size: 24px;
  font-weight: 900;
  color: var(--yellow);
}

.footer-logo-sub {
  color: #aaa;
  font-size: 18px;
  font-weight: 600;
}

.footer-neon-card {
  max-width: 600px;
  background: #222;
  border: 3px solid var(--yellow);
  box-shadow: 6px 6px 0px var(--yellow);
  padding: 25px;
  border-radius: 4px;
  text-align: left;
}

.footer-neon-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--yellow);
  border-bottom: 2px dashed #444;
  padding-bottom: 10px;
}

.footer-notes {
  font-size: 12px;
  color: #666;
}

/* --- Space Gallery Section --- */
.gallery-section {
  background: var(--white);
}

.gallery-container {
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-grid {
  display: grid;
  grid-template-cols: repeat(3, 1fr);
  gap: 25px;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: var(--pop-border);
  box-shadow: var(--pop-shadow-small);
  padding: 10px;
  border-radius: 4px;
}

.gallery-title {
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 8px;
  color: var(--pink);
  text-align: center;
  border-bottom: 2px dashed var(--dark);
  padding-bottom: 6px;
}

.gallery-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 2px solid var(--dark);
  border-radius: 2px;
  display: block;
  margin-bottom: 8px;
}

.gallery-desc {
  font-size: 11.5px;
  color: #555;
  line-height: 1.4;
}

@media (max-width: 992px) {
  .gallery-grid {
    grid-template-cols: 1fr 1fr;
  }
}

@media (max-width: 576px) {
  .gallery-grid {
    grid-template-cols: 1fr;
  }
}

/* --- Responsive Stacking --- */
@media (max-width: 992px) {
  .pop-nav {
    padding: 0 20px;
  }
  
  .nav-links {
    display: none;
  }
  
  .section {
    padding: 60px 20px;
  }
  
  .cover-title {
    font-size: 40px;
  }
  
  .cover-subtitle {
    font-size: 16px;
    padding: 10px 15px;
  }
  
  .cover-summary-cards {
    grid-template-cols: 1fr 1fr;
    gap: 15px;
  }
  
  .concept-grid {
    grid-template-cols: 1fr;
    gap: 30px;
  }
  
  .floor-section {
    grid-template-cols: 1fr;
    gap: 30px;
  }
  
  .floor-title-text {
    font-size: 22px;
  }
}
