/* ==========================================================================
   GOLDEN OBSIDIAN THEME (LUXURY, VIP, PRIME EDITION)
   Designed by Antigravity for Minh Do
   ========================================================================== */

/* Font Imports (Modern UI font stacks) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Variables */
:root {
  /* Color Palette */
  --obsidian-deep: #080809;
  --obsidian-card: #121215;
  --obsidian-glow: rgba(22, 22, 26, 0.7);
  --obsidian-border: rgba(212, 175, 55, 0.12);
  --obsidian-border-hover: rgba(212, 175, 55, 0.35);
  
  --gold-champagne: #F3E5AB;
  --gold-metallic: #D4AF37;
  --gold-dark: #AA7C11;
  --gold-shadow: rgba(212, 175, 55, 0.15);
  --gold-glow: rgba(243, 229, 171, 0.35);
  
  --sage-green: #87A987;
  --sage-glow: rgba(135, 169, 135, 0.25);
  --sage-dark: #587358;
  
  --text-primary: #F5F5F0;
  --text-secondary: #B0B0A8;
  --text-muted: #7E7E76;
  
  /* Typography */
  --font-title: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Layout */
  --container-width: 860px;
  --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--obsidian-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.45; /* Compact line-height for body */
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(212, 175, 55, 0.02) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(135, 169, 135, 0.02) 0%, transparent 40%),
    linear-gradient(to bottom, var(--obsidian-deep), #0c0c0e);
  background-attachment: fixed;
  padding-bottom: 60px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--obsidian-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--gold-dark);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-metallic);
}

/* Scroll Progress Bar */
.scroll-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(8, 8, 9, 0.5);
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-metallic), var(--sage-green));
  box-shadow: 0 0 6px var(--gold-glow);
}

/* Decorative Framing (Book Plate Header) */
.header-wrapper {
  max-width: var(--container-width);
  margin: 50px auto 30px;
  padding: 0 20px;
  text-align: center;
}

/* Classical Book Plate (Ex Libris Style) */
.book-plate {
  position: relative;
  display: inline-block;
  padding: 28px 50px;
  margin-bottom: 15px;
  border: 1.5px solid var(--gold-metallic);
  background: var(--obsidian-card);
  box-shadow: 
    inset 0 0 15px rgba(212, 175, 55, 0.08),
    0 8px 25px rgba(0, 0, 0, 0.5);
  z-index: 10;
  width: 100%;
  max-width: 800px;
}

/* Inner borders for traditional book plate aesthetics */
.book-plate::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border: 1px dashed rgba(212, 175, 55, 0.3);
  pointer-events: none;
}

.book-plate h1 {
  font-family: var(--font-title);
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  font-weight: 700; /* Controlled font weight */
  line-height: 1.25;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #F3E5AB 0%, #D4AF37 50%, #AA7C11 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  white-space: nowrap; /* Prevent AI from breaking to new line on desktop */
}

.book-plate p.subtitle {
  font-family: var(--font-title);
  color: var(--sage-green);
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600; /* Controlled weight */
}

/* Search Box Container */
.search-container {
  max-width: 480px;
  margin: 0 auto 30px;
  position: relative;
  z-index: 10;
  padding: 0 20px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 12px 18px 12px 40px;
  background: var(--obsidian-card);
  border: 1px solid var(--obsidian-border);
  border-radius: 24px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  outline: none;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.search-input:focus {
  border-color: var(--gold-metallic);
  box-shadow: 
    0 0 10px var(--gold-shadow),
    inset 0 0 6px rgba(212, 175, 55, 0.05);
}

.search-icon {
  position: absolute;
  left: 18px;
  color: var(--gold-metallic);
  font-size: 1rem;
}

/* Dynamic Page Jump / Navigation */
.nav-jump {
  max-width: var(--container-width);
  margin: 0 auto 24px;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  z-index: 10;
  position: relative;
}

.nav-btn {
  background: rgba(18, 18, 21, 0.7);
  border: 1px solid var(--obsidian-border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 16px;
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 500; /* Balanced medium weight */
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition-smooth);
  backdrop-filter: blur(10px);
}

.nav-btn:hover, .nav-btn.active {
  border-color: var(--gold-metallic);
  color: var(--gold-champagne);
  box-shadow: 0 0 8px var(--gold-shadow);
  transform: translateY(-1px);
}

/* Floating Sidebar Navigation (Right Hand Side) */
.sidebar-nav-right {
  position: fixed;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 100;
  background: rgba(18, 18, 21, 0.75);
  border: 1px solid var(--obsidian-border);
  padding: 16px 10px;
  border-radius: 24px;
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transition: var(--transition-smooth);
}

.sidebar-nav-right:hover {
  border-color: var(--gold-metallic);
  box-shadow: 
    0 10px 25px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(212, 175, 55, 0.08);
}

.sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(8, 8, 9, 0.8);
  border: 1px solid var(--obsidian-border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
}

.sidebar-item i {
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.sidebar-item:hover, .sidebar-item.active {
  border-color: var(--gold-metallic);
  color: var(--gold-champagne);
  background: var(--obsidian-card);
  box-shadow: 0 0 8px var(--gold-shadow);
}

/* Tooltip label for sidebar items */
.sidebar-label {
  position: absolute;
  right: 48px;
  background: var(--obsidian-card);
  border: 1px solid var(--gold-metallic);
  color: var(--gold-champagne);
  padding: 6px 10px;
  border-radius: 4px;
  font-family: var(--font-title);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
  transition: var(--transition-smooth);
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
}

.sidebar-label::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 6px;
  height: 6px;
  background: var(--obsidian-card);
  border-right: 1px solid var(--gold-metallic);
  border-top: 1px solid var(--gold-metallic);
}

.sidebar-item:hover .sidebar-label {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Main Content Layout */
.main-content {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 28px; /* Tighter layout gap */
  z-index: 10;
  position: relative;
}

/* Page Card Styles (.page-card) */
.page-card {
  background: var(--obsidian-card);
  border: 1px solid var(--obsidian-border);
  border-radius: 8px; /* Slightly tighter corner radius */
  padding: 30px 35px; /* Tighter padding */
  position: relative;
  transition: var(--transition-smooth);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

/* Card hover glow and expansion */
.page-card:hover {
  border-color: var(--obsidian-border-hover);
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(212, 175, 55, 0.04);
  transform: translateY(-2px);
}

/* Card corner decorations (Classic Luxury detail) */
.page-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-top: 1.5px solid var(--gold-metallic);
  border-left: 1.5px solid var(--gold-metallic);
  opacity: 0.6;
}

.page-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-bottom: 1.5px solid var(--gold-metallic);
  border-right: 1.5px solid var(--gold-metallic);
  opacity: 0.6;
}

/* Card Title (VIP Styling) */
.card-header-area {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.15);
  padding-bottom: 12px; /* Tighter spacing */
  margin-bottom: 16px; /* Tighter spacing */
}

.card-title-group h2 {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 600; /* Controlled header weight */
  line-height: 1.25;
  color: var(--gold-champagne);
  letter-spacing: 0.3px;
}

.card-badge {
  font-family: var(--font-title);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* VIP Badge Colors mapping Scope */
.badge-universal {
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold-metallic);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.badge-project {
  background: rgba(135, 169, 135, 0.08);
  color: var(--sage-green);
  border: 1px solid rgba(135, 169, 135, 0.2);
}

.badge-workflow {
  background: rgba(245, 245, 240, 0.04);
  color: var(--text-primary);
  border: 1px solid rgba(245, 245, 240, 0.15);
}

/* Metadata items inside cards */
.metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px; /* Tighter spacing */
  background: rgba(8, 8, 9, 0.4);
  padding: 10px 15px; /* Tighter padding */
  border-radius: 6px;
  border: 1px solid rgba(212, 175, 55, 0.04);
}

.metadata-item {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  font-weight: 500;
}

.meta-value {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

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

.meta-value.accent-sage {
  color: var(--sage-green);
  font-weight: 600;
}

/* Card Body Typography */
.card-body h4 {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--gold-champagne);
  margin: 16px 0 8px; /* Tighter margin */
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-body p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px; /* Tighter margin */
  line-height: 1.45; /* Clean compact line-height */
}

/* Lists and Lists items */
.card-body ul {
  list-style: none;
  margin-bottom: 14px; /* Tighter spacing */
}

.card-body li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px; /* Tighter spacing */
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Decorative bullets */
.card-body li::before {
  content: '◆';
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--gold-metallic);
  font-size: 0.7rem;
  transition: var(--transition-smooth);
}

.card-body li strong {
  color: var(--text-primary);
  font-weight: 600; /* Controlled bold weight */
}

/* Blockquote & Code Examples */
.example-quote {
  background: rgba(8, 8, 9, 0.6);
  border-left: 2.5px solid var(--gold-metallic);
  padding: 15px 20px; /* Tighter padding */
  margin: 16px 0; /* Tighter margin */
  border-radius: 0 6px 6px 0;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.4);
}

.example-quote-label {
  font-family: var(--font-title);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gold-metallic);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.example-quote-body {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.4;
}

.example-quote-note {
  font-size: 0.8rem;
  color: var(--sage-green);
  margin-top: 6px;
  display: block;
  font-weight: 500;
}

/* Glowing Highlight pulse styling */
.search-highlight {
  background: var(--sage-glow);
  border-bottom: 1.5px solid var(--sage-green);
  border-radius: 2px;
  color: #fff;
  padding: 1px 3px;
  animation: pulse-glow 2s infinite alternate;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 3px var(--sage-glow);
    background: rgba(135, 169, 135, 0.15);
  }
  100% {
    box-shadow: 0 0 8px rgba(135, 169, 135, 0.45);
    background: rgba(135, 169, 135, 0.35);
  }
}

/* Subtitle Code Block */
.subtitle-code {
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-weight: 600; /* Controlled bold */
  text-transform: none;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-block;
  margin: 0 1px;
}

/* Search hidden helper class */
.search-hidden {
  display: none !important;
}

/* Footer Styling */
footer {
  width: 100%;
  margin-top: 60px; /* Tighter layout margin */
  padding: 24px 0;
  border-top: 1px solid rgba(212, 175, 55, 0.08);
  background: linear-gradient(to top, #060607 0%, var(--obsidian-deep) 100%);
  position: relative;
  z-index: 10;
}

.footer-content {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.footer-designer {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-champagne);
  text-decoration: none;
  padding: 5px 14px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.02) 0%, rgba(170, 124, 17, 0.02) 100%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transition: var(--transition-smooth);
}

.footer-designer:hover {
  color: var(--obsidian-deep);
  background: linear-gradient(135deg, var(--gold-champagne) 0%, var(--gold-metallic) 50%, var(--gold-dark) 100%);
  border-color: var(--gold-champagne);
  box-shadow: 
    0 0 12px var(--gold-shadow),
    0 3px 8px rgba(212, 175, 55, 0.2);
  transform: translateY(-1px);
}

.footer-designer span {
  font-weight: 700;
  letter-spacing: 1.5px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .sidebar-nav-right {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .book-plate {
    padding: 20px 15px;
  }
  .book-plate h1 {
    font-size: 1.3rem;
    white-space: normal; /* Allow wrapping on small mobile screens */
  }
  .page-card {
    padding: 20px 24px;
  }
  .card-header-area {
    flex-direction: column;
    gap: 8px;
  }
  .card-badge {
    align-self: flex-start;
  }
}
