/* ==========================================================================
   DESIGN SYSTEM & CUSTOM PROPERTIES (CSS VARIABLES)
   ========================================================================== */

:root {
  /* Fonts */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', system-ui, -apple-system, sans-serif;

  /* Animation Timings */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Borders & Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Accent Colors (Fabric Identity) */
  --fabric-teal: hsl(175, 85%, 43%);
  --fabric-blue: hsl(210, 100%, 50%);
  --fabric-purple: hsl(270, 75%, 55%);
  --fabric-indigo: hsl(245, 80%, 60%);
  
  --color-success: hsl(142, 70%, 45%);
  --color-warning: hsl(38, 90%, 55%);
  --color-error: hsl(0, 85%, 60%);
  --color-info: hsl(195, 90%, 50%);

  /* Primary Gradients */
  --gradient-fabric: linear-gradient(135deg, var(--fabric-teal), var(--fabric-blue), var(--fabric-purple));
  --gradient-glow: radial-gradient(circle, hsla(175, 85%, 43%, 0.15) 0%, hsla(270, 75%, 55%, 0) 70%);
}

/* --- Dark Theme Tokens (Default) --- */
html[data-theme="dark"] {
  --bg-primary: hsl(150, 16%, 6%);
  --bg-secondary: hsl(150, 16%, 9%);
  --bg-card: hsl(150, 12%, 11%);
  --bg-card-hover: hsl(150, 12%, 15%);
  --bg-header: hsla(150, 16%, 6%, 0.8);
  --bg-footer: hsl(150, 25%, 5%);
  
  --text-primary: hsl(150, 30%, 98%);
  --text-secondary: hsl(150, 15%, 78%);
  --text-muted: hsl(150, 10%, 58%);
  --text-inverse: hsl(150, 16%, 6%);

  --border-color: hsl(150, 10%, 18%);
  --border-light: hsl(150, 10%, 14%);
  --border-glow: hsla(175, 85%, 43%, 0.2);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px hsla(175, 85%, 43%, 0.12);
  
  --card-glass: rgba(14, 20, 18, 0.75);
  --card-glass-border: rgba(255, 255, 255, 0.04);
}

/* --- Light Theme Tokens --- */
html[data-theme="light"] {
  --bg-primary: hsl(45, 45%, 95%); /* Very light yellow-beige (ivory parchment) */
  --bg-secondary: hsl(45, 40%, 91%);
  --bg-card: #ffffff; /* Solid white so cards pop out from the beige background */
  --bg-card-hover: hsl(45, 45%, 98%);
  --bg-header: hsla(140, 18%, 24%, 0.9); /* Left as is (dark green) */
  --bg-footer: hsl(140, 30%, 8%); /* Left as is (dark green) */
  
  /* Global text on Light Beige background (Dark Charcoal) */
  --text-primary: hsl(140, 35%, 12%);
  --text-secondary: hsl(140, 20%, 28%);
  --text-muted: hsl(140, 15%, 46%);
  --text-inverse: hsl(45, 40%, 96%);

  --border-color: rgba(140, 25%, 15%, 0.08);
  --border-light: rgba(140, 25%, 15%, 0.04);
  --border-glow: hsla(140, 25%, 15%, 0.15);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 30px hsla(140, 25%, 15%, 0.03);
  
  --card-glass: rgba(255, 255, 255, 0.95);
  --card-glass-border: rgba(140, 25%, 15%, 0.08);
}

/* Local variable scoping for headers & footers on dark green background (Light Theme) */
html[data-theme="light"] .app-header,
html[data-theme="light"] .app-footer {
  --text-primary: hsl(45, 40%, 96%);
  --text-secondary: hsl(45, 30%, 84%);
  --text-muted: hsl(140, 15%, 60%);
  --border-color: rgba(255, 255, 255, 0.15);
  --border-light: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* Local variable scoping for containers on Light Sage background (Light Theme) */
html[data-theme="light"] .card,
html[data-theme="light"] .dropdown-menu,
html[data-theme="light"] .chat-console,
html[data-theme="light"] .hero-section {
  --text-primary: hsl(140, 35%, 12%);
  --text-secondary: hsl(140, 20%, 28%);
  --text-muted: hsl(140, 15%, 46%);
  --bg-secondary: hsl(45, 45%, 98%); /* Solid light yellowish-cream inside inputs for contrast */
  --border-color: rgba(140, 25%, 15%, 0.08);
  --border-light: rgba(140, 25%, 15%, 0.04);
  color: var(--text-primary);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================================================
   LAYOUT SHELL (HEADER, NAVIGATION, FOOTER)
   ========================================================================== */

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  background: var(--gradient-fabric);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal);
}

.brand-logo-img {
  height: 38px !important;
  max-height: 38px !important;
  width: auto !important;
  max-width: 180px !important;
  flex-shrink: 0 !important;
  object-fit: contain;
  border-radius: var(--radius-sm);
  transition: transform var(--transition-normal);
}

.logo-link:hover .brand-logo-img {
  transform: rotate(2deg) scale(1.05);
}

.footer-logo-img {
  height: 42px !important;
  max-height: 42px !important;
  width: auto !important;
  max-width: 200px !important;
  flex-shrink: 0 !important;
  margin-right: 0.25rem;
}

.logo-link:hover .logo-icon {
  transform: rotate(5deg) scale(1.05);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.brand-series {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Desktop Navigation */
.desktop-nav {
  display: block;
}

.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0.3rem;
}

.nav-link {
  display: block;
  padding: 0.4rem 0.75rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--border-light);
}

.nav-link.active {
  color: var(--text-primary);
  background: linear-gradient(135deg, hsla(175, 85%, 43%, 0.08) 0%, hsla(210, 100%, 50%, 0.08) 100%);
  border-color: var(--border-glow);
  box-shadow: 0 0 10px hsla(175, 85%, 43%, 0.08);
  font-weight: 600;
}

@media (max-width: 1200px) {
  .nav-link {
    padding: 0.35rem 0.55rem;
    font-size: 0.82rem;
  }
  .nav-list {
    gap: 0.15rem;
  }
}

/* Dropdown Menu */
.nav-item-dropdown {
  position: relative;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.dropdown-chevron {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}

.nav-item-dropdown:hover .dropdown-chevron {
  transform: translateY(2px);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 280px;
  padding: 0.75rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
  z-index: 101;
  list-style: none;
  margin: 0;
}

.dropdown-menu li {
  list-style: none;
  list-style-type: none;
}

.nav-item-dropdown:hover .dropdown-menu,
.dropdown-trigger.dropdown-open ~ .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}

.dropdown-trigger.dropdown-open .dropdown-chevron {
  transform: rotate(180deg);
}

.dropdown-item {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.dropdown-item:hover:not(.disabled) {
  background-color: var(--bg-card-hover);
}

.dropdown-item-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.dropdown-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-light);
  margin: 0.5rem 0;
  list-style: none;
}

.dropdown-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  list-style: none;
}

.dropdown-item.disabled, .mobile-sub-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--text-muted);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  transform: scale(1.05);
}

html[data-theme="dark"] .sun-icon { display: block; }
html[data-theme="dark"] .moon-icon { display: none; }
html[data-theme="light"] .sun-icon { display: none; }
html[data-theme="light"] .moon-icon { display: block; }

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
}

.mobile-menu-toggle .close-icon { display: none; }
body.mobile-menu-open .mobile-menu-toggle .menu-icon { display: none; }
body.mobile-menu-open .mobile-menu-toggle .close-icon { display: block; }

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 65px; /* height of header */
  left: 0;
  width: 100%;
  height: calc(100vh - 65px);
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  z-index: 99;
  padding: 1.5rem;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  overflow-y: auto;
}

body.mobile-menu-open .mobile-nav-drawer {
  transform: translateX(0);
}

.mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.mobile-nav-link {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.mobile-nav-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.mobile-sub-list {
  list-style: none;
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-left: 2px solid var(--border-color);
}

.mobile-sub-link {
  font-size: 1rem;
  color: var(--text-secondary);
  display: block;
}

/* --- Main Layout --- */
#app-content {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-spinner-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--fabric-teal);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Animations */
.fade-in {
  animation: fadeIn var(--transition-normal) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.scroll-fade {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.7s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.scroll-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

.gradient-divider {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color) 20%, var(--border-color) 80%, transparent);
  margin: 2.5rem 0;
  opacity: 0.6;
}

@keyframes ambientGlow {
  0% { transform: translate(0px, 0px) scale(1) rotate(0deg); }
  33% { transform: translate(30px, -50px) scale(1.1) rotate(120deg); }
  66% { transform: translate(-20px, 20px) scale(0.95) rotate(240deg); }
  100% { transform: translate(0px, 0px) scale(1) rotate(360deg); }
}

/* Footer styling */
.app-footer {
  background-color: var(--bg-footer);
  border-top: 1px solid var(--border-color);
  color: hsl(215, 20%, 75%);
  padding: 4rem 1.5rem 2rem 1.5rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand-section .footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-inverse);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: white;
  margin-bottom: 1rem;
}

.footer-logo .brand-icon {
  color: var(--fabric-teal);
}

.footer-tagline {
  font-size: 0.9rem;
  color: hsl(215, 15%, 60%);
  margin-bottom: 1.5rem;
  max-width: 320px;
}

.certification-badges-row {
  display: flex;
  gap: 0.5rem;
}

.badge-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.badge-pill.dp600 {
  background-color: hsla(210, 100%, 50%, 0.15);
  color: hsl(210, 100%, 65%);
  border: 1px solid hsla(210, 100%, 50%, 0.3);
}

.badge-pill.dp700 {
  background-color: hsla(270, 75%, 55%, 0.15);
  color: hsl(270, 75%, 70%);
  border: 1px solid hsla(270, 75%, 55%, 0.3);
}

.footer-links-col h4 {
  color: white;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.footer-links-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links-col a {
  font-size: 0.9rem;
  color: hsl(215, 15%, 65%);
}

.footer-links-col a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.5rem;
}

.footer-bottom-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: hsl(215, 10%, 50%);
}

.footer-bottom-container p {
  text-align: center;
}

.footer-bottom-container .disclaimer {
  font-style: italic;
}


/* ==========================================================================
   COMMON COMPONENT STYLES & INTERACTIVE STYLES
   ========================================================================== */

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

/* Gradients text */
.text-gradient {
  background: var(--gradient-fabric);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--gradient-fabric);
  color: white;
  border: none;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 15px hsla(210, 100%, 50%, 0.3);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-light);
  border-color: var(--text-muted);
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  border-color: var(--border-glow);
}

.card-glassmorphic {
  background: var(--card-glass);
  border: 1px solid var(--card-glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Badges */
.badge {
  display: inline-flex;
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-teal { background-color: hsla(175, 85%, 43%, 0.15); color: var(--fabric-teal); }
.badge-blue { background-color: hsla(210, 100%, 50%, 0.15); color: var(--fabric-blue); }
.badge-purple { background-color: hsla(270, 75%, 55%, 0.15); color: var(--fabric-purple); }
.badge-orange { background-color: hsla(38, 90%, 55%, 0.15); color: var(--color-warning); }

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

html[data-theme="dark"] .form-control {
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] select.form-control {
  background-color: rgba(0, 0, 0, 0.38);
}

html[data-theme="light"] .form-control {
  background-color: hsl(45, 45%, 98%);
  border: 1.5px solid rgba(140, 25%, 15%, 0.16);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] select.form-control {
  background-color: hsl(45, 40%, 94%);
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.55;
}

select.form-control:invalid,
select.form-control:has(option[value=""]:checked) {
  color: var(--text-muted);
  opacity: 0.55;
}

select.form-control option {
  color: var(--text-primary);
  background-color: var(--bg-card);
  opacity: 1;
}

.form-control:focus {
  outline: none;
  border-color: var(--fabric-teal);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04), 0 0 0 3px hsla(175, 85%, 43%, 0.15);
}

.form-group label:has(+ input[required])::after,
.form-group label:has(+ select[required])::after,
.form-group label:has(+ textarea[required])::after {
  content: " *";
  color: var(--color-error);
  font-weight: 600;
  margin-left: 0.15rem;
}


/* ==========================================================================
   PAGE-SPECIFIC COMPONENT STYLES
   ========================================================================== */

/* --- HOME PAGE --- */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  padding: 3rem 0 5rem 0;
  position: relative;
}

.hero-glow {
  position: absolute;
  top: -10%;
  right: 5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, hsla(175, 85%, 43%, 0.12) 0%, hsla(270, 75%, 55%, 0.12) 50%, transparent 100%);
  filter: blur(80px);
  animation: ambientGlow 15s infinite ease-in-out;
  pointer-events: none;
  z-index: -1;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-series-tag {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fabric-teal);
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
}

.hero-author {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 540px;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.book-cover-mockup {
  width: 320px;
  height: 460px;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), var(--shadow-glow);
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.hero-visual:hover .book-cover-mockup {
  transform: rotate3d(0, 1, 0, -10deg) scale(1.02);
}

/* ==========================================================================
   TOP SERIES ANNOUNCEMENT BAR & DYNAMIC BOOK COVERS
   ========================================================================== */

.series-top-bar {
  background: linear-gradient(90deg, hsl(222, 30%, 6%), hsl(222, 25%, 10%));
  color: var(--fabric-teal);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  padding: 0.45rem 1rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-display);
  user-select: none;
  z-index: 102;
  position: relative;
}

.book-cover-container {
  aspect-ratio: 210 / 300;
  width: 100%;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-slow), box-shadow var(--transition-slow), border-color var(--transition-slow);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: hsl(222, 25%, 6%);
  user-select: none;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.book-cover-container:hover {
  transform: translateY(-8px) rotateY(10deg) rotateX(2deg) scale(1.02);
  box-shadow: 
    -10px 20px 40px rgba(0, 0, 0, 0.5), 
    0 0 30px var(--border-glow);
  border-color: var(--border-glow);
}

.book-cover-container.hero-cover {
  width: 250px;
  height: 357px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), var(--shadow-glow);
}

.book-cover-container.grid-cover {
  height: 360px;
  width: 100%;
}

.book-detail-header .book-cover-container.grid-cover {
  height: auto;
}

.book-cover-inner {
  width: 100%;
  height: 100%;
  background-size: 100% 100%; /* Stretches the texture to bleed all the way to all 4 edges */
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem 0.65rem 0.65rem 0.65rem; /* Margins for content layout inside cover */
  position: relative;
}

.book-cover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(20, 24, 33, 0.05) 0%, rgba(10, 12, 17, 0.7) 100%);
  z-index: 1;
}

.book-cover-series-info {
  position: relative;
  z-index: 2;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.4rem; /* Fit in one line */
  font-weight: 300;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  white-space: nowrap; /* Avoid wrapping */
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.25rem;
}

.book-cover-title-section,
.book-cover-subtitle-section,
.book-cover-icon-below-waves,
.book-cover-footer {
  position: relative;
  z-index: 2;
}

.book-cover-title-section {
  text-align: center;
  padding: 0 0.5rem; /* Constrain horizontal width to keep it inside edges */
}

.book-cover-title {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.25;
  color: white;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.grid-cover .book-cover-title {
  font-size: 0.8rem;
}

.hero-cover .book-cover-title {
  font-size: 0.95rem;
}

.book-cover-subtitle-section {
  text-align: center;
  padding: 0 0.25rem;
  margin-top: -0.4rem; /* Soft negative margin to bring it up closer to the wave base */
  margin-bottom: 0.4rem;
}

.book-cover-subtitle-line {
  font-family: var(--font-sans);
  font-size: 0.38rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.25;
  font-variant: all-small-caps; /* Small caps */
  text-transform: lowercase;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.book-cover-subtitle-line-second {
  font-family: var(--font-sans);
  font-size: 0.35rem; /* Second line slightly smaller */
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.25;
  font-variant: all-small-caps;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  margin-top: 0.08rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.grid-cover .book-cover-subtitle-line {
  font-size: 0.35rem;
}

.grid-cover .book-cover-subtitle-line-second {
  font-size: 0.32rem;
}

.book-cover-volume-badge {
  display: inline-block;
  font-size: 0.4rem;
  font-weight: 700;
  color: var(--fabric-teal);
  letter-spacing: 0.08em;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 0.05rem 0.3rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.book-cover-middle-spacer {
  flex-grow: 1;
  min-height: 50px; /* Leave space for the wave in the center background */
}

.book-cover-icon-below-waves {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem; /* Margin to balance below Volume badge */
  margin-bottom: 0.15rem;
}

.book-cover-icon-below-waves svg {
  width: 26px !important;
  height: 26px !important;
  stroke: var(--fabric-teal) !important; /* Force neon teal wave color */
  stroke-width: 2px !important; /* Standard clear outline width */
  color: var(--fabric-teal) !important;
  fill: none !important;
  filter: drop-shadow(0 0 3px var(--fabric-teal)) !important; /* Softer, less glowy accent */
}

.book-cover-footer {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.35rem;
}

.book-cover-author {
  font-family: var(--font-sans);
  font-size: 0.55rem; /* Make author name 1.5 points smaller */
  font-weight: 300; /* Regular thin font, not bold */
  color: white;
  margin-bottom: 0.12rem;
}

.book-cover-credentials {
  font-family: var(--font-sans);
  font-size: 0.28rem; /* Make credentials smaller to fit nicely under name */
  font-weight: 400;
  line-height: 1.15; /* Tighten line height */
  color: rgba(255, 255, 255, 0.45);
  text-transform: none;
}

/* Topics Grid Section */
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem auto;
}

.section-header h2 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 5rem;
}

.topic-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.topic-icon {
  width: 44px;
  height: 44px;
  background-color: var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fabric-blue);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.topic-card:hover .topic-icon {
  background-color: var(--fabric-blue);
  color: white;
}

/* Quick Center / Split sections */
.home-split-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  margin-bottom: 5rem;
}

.home-split-left, .home-split-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* --- RESOURCES PAGE --- */
.resources-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.search-bar-wrapper {
  position: relative;
  flex: 1;
  max-width: 460px;
  min-width: 280px;
}

.search-bar-wrapper .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.search-bar-wrapper input {
  padding-left: 2.75rem;
}

.category-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tab-pill {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-pill:hover {
  border-color: var(--text-muted);
}

.tab-pill.active {
  background: var(--gradient-fabric);
  color: white;
  border-color: transparent;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

.resource-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.resource-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.resource-type-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.resource-title {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.resource-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  flex: 1;
}

.resource-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 1rem;
}

.resource-fileinfo {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
}

/* --- ERRATA PAGE --- */
.errata-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
}

.errata-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.errata-table th, .errata-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

.errata-table th {
  background-color: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
}

.errata-table tbody tr:last-child td {
  border-bottom: none;
}

.errata-table tbody tr:hover {
  background-color: var(--bg-card-hover);
}

.errata-chapter {
  font-weight: 600;
}

.errata-date {
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.errata-issue {
  color: var(--color-error);
}

.errata-correction {
  color: var(--color-success);
  font-weight: 500;
}

.errata-form-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: fit-content;
}

/* --- UPDATES PAGE --- */
.updates-timeline {
  position: relative;
  max-width: 800px;
  margin: 3rem auto;
  padding-left: 2rem;
  border-left: 2px solid var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 3.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-2rem - 6px);
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: var(--fabric-teal);
  border: 4px solid var(--bg-primary);
  box-shadow: 0 0 0 3px var(--border-glow);
  z-index: 1;
}

.timeline-date {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fabric-teal);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.timeline-card {
  padding: 1.5rem;
}

.timeline-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.timeline-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.timeline-guidance {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-color);
}

.guidance-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--fabric-purple);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* --- STUDY CENTER --- */
.study-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 5rem;
}

.study-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.study-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.study-list-item i {
  color: var(--fabric-teal);
  width: 18px;
  height: 18px;
  margin-top: 3px;
  flex-shrink: 0;
}

/* Practice Quiz */
.quiz-widget {
  max-width: 760px;
  margin: 3rem auto;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.quiz-score {
  font-size: 0.9rem;
  font-weight: 600;
}

.quiz-question-text {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.quiz-options-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-option {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

.quiz-option:hover:not(.disabled) {
  background-color: var(--bg-secondary);
  border-color: var(--text-muted);
}

.quiz-option-radio {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quiz-option-radio::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: transparent;
  transition: background-color var(--transition-fast);
}

.quiz-option.selected {
  border-color: var(--fabric-blue);
  background-color: hsla(210, 100%, 50%, 0.05);
}

.quiz-option.selected .quiz-option-radio {
  border-color: var(--fabric-blue);
}

.quiz-option.selected .quiz-option-radio::after {
  background-color: var(--fabric-blue);
}

/* State when answer revealed */
.quiz-option.correct-reveal {
  border-color: var(--color-success);
  background-color: hsla(142, 70%, 45%, 0.08);
}
.quiz-option.correct-reveal .quiz-option-radio {
  border-color: var(--color-success);
  background-color: var(--color-success);
}
.quiz-option.correct-reveal .quiz-option-radio::after {
  content: '\2713'; /* checkmark */
  color: white;
  font-size: 0.7rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-option.wrong-reveal {
  border-color: var(--color-error);
  background-color: hsla(0, 85%, 60%, 0.08);
}
.quiz-option.wrong-reveal .quiz-option-radio {
  border-color: var(--color-error);
  background-color: var(--color-error);
}
.quiz-option.wrong-reveal .quiz-option-radio::after {
  content: '\2715'; /* cross */
  color: white;
  font-size: 0.7rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-explanation-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  animation: fadeIn var(--transition-fast);
}

.quiz-explanation-box.correct {
  background-color: hsla(142, 70%, 45%, 0.05);
  border-color: hsla(142, 70%, 45%, 0.2);
}

.quiz-explanation-box.wrong {
  background-color: hsla(0, 85%, 60%, 0.05);
  border-color: hsla(0, 85%, 60%, 0.2);
}

.quiz-explanation-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.quiz-widget-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* --- BLOG PAGE --- */
.blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 2rem;
}

.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.blog-card-title {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.blog-card-excerpt {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  flex: 1;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 1rem;
}

.blog-author-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.blog-author-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background-color: var(--fabric-purple);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
}

.read-more-link {
  color: var(--fabric-blue);
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.read-more-link:hover {
  gap: 0.5rem;
}

/* --- ABOUT AUTHOR PAGE --- */
.about-grid {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 3.5rem;
  align-items: start;
}

.author-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.author-photo-container {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: var(--radius-full);
  padding: 5px;
  background: var(--gradient-fabric);
  box-shadow: var(--shadow-md);
}

.author-photo {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 4px solid var(--bg-card);
}

.author-name-title h2 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.author-subtitle {
  color: var(--fabric-teal);
  font-weight: 600;
  font-size: 1rem;
}

.author-socials {
  display: flex;
  gap: 1rem;
}

.social-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.social-icon-btn:hover {
  background-color: var(--gradient-fabric);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
}

.author-main-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.about-bio {
  font-size: 1.05rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.author-expertise-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Detail Book Page Layout */
.book-detail-header {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.book-detail-metadata {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 0;
}

.metadata-item-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.metadata-item-value {
  font-weight: 600;
  font-size: 0.95rem;
}

.book-chapters-section {
  max-width: 800px;
  margin-bottom: 5rem;
}

.chapters-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.chapter-accordion-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  overflow: hidden;
}

.chapter-header-btn {
  width: 100%;
  background: none;
  border: none;
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  text-align: left;
}

.chapter-title-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chapter-num {
  background-color: var(--border-light);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--fabric-teal);
  flex-shrink: 0;
}

.chapter-name {
  font-weight: 700;
  font-size: 1rem;
}

.chapter-chevron {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.chapter-accordion-item.open .chapter-chevron {
  transform: rotate(180deg);
}

.chapter-content {
  padding: 0 1.25rem 1.25rem 3.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: none;
  border-top: 1px solid var(--border-light);
  padding-top: 1.25rem;
  animation: fadeIn var(--transition-fast);
}

.chapter-accordion-item.open .chapter-content {
  display: block;
}

.chapter-labs-list {
  margin-top: 0.75rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.chapter-labs-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chapter-labs-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background-color: var(--fabric-purple);
}

/* Future books series view */
.series-overview-section {
  margin-top: 4rem;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.series-book-card {
  transition: transform var(--transition-fast);
}

.series-book-card:hover {
  transform: translateY(-4px);
}

.series-book-cover-placeholder {
  height: 320px;
  background-color: var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-weight: 700;
  text-align: center;
  padding: 1.5rem;
  border: 2px dashed var(--border-color);
}

.series-book-cover-placeholder i {
  width: 32px;
  height: 32px;
}

/* ==========================================================================
   MEDIA QUERIES (RESPONSIVENESS)
   ========================================================================== */

@media (max-width: 1024px) {
  .hero-section {
    gap: 2rem;
  }
  
  .hero-title {
    font-size: 2.25rem;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .author-sidebar {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
  }
  
  .book-detail-header {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  
  .book-detail-header .hero-visual {
    max-width: 320px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 1rem;
  }
  
  .hero-desc {
    margin: 0 auto;
  }
  
  .hero-ctas {
    justify-content: center;
  }
  
  .home-split-row {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .resources-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-bar-wrapper {
    max-width: 100%;
  }
  
  .errata-container {
    grid-template-columns: 1fr;
  }
  
  .study-sections {
    grid-template-columns: 1fr;
  }
  
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ==========================================================================
   AI SECURITY AGENT CONSOLE STYLES
   ========================================================================== */

.agent-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

.agent-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.agent-intro-card {
  padding: 1.5rem;
}

.scenario-suggestions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.scenario-btn {
  width: 100%;
  text-align: left;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.scenario-btn:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--fabric-teal);
  color: var(--text-primary);
  transform: translateX(3px);
}

.scenario-btn i {
  color: var(--fabric-teal);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.chat-console {
  display: flex;
  flex-direction: column;
  height: 600px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.chat-console-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.agent-avatar-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--gradient-fabric);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.chat-history {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chat-message {
  display: flex;
  gap: 1rem;
  max-width: 85%;
  animation: fadeIn var(--transition-normal) forwards;
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message.agent {
  align-self: flex-start;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-message.user .message-avatar {
  background-color: var(--border-color);
  color: var(--text-secondary);
}

.chat-message.agent .message-avatar {
  background: var(--gradient-fabric);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
}

.message-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.message-sender-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.chat-message.user .message-sender-name {
  text-align: right;
}

.message-bubble {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.chat-message.user .message-bubble {
  background: var(--gradient-fabric);
  color: white;
  border-bottom-right-radius: 0;
  box-shadow: var(--shadow-sm);
}

.chat-message.agent .message-bubble {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 0;
}

/* Styled Code blocks inside chat response */
.message-bubble code {
  font-family: Consolas, Monaco, monospace;
  font-size: 0.85rem;
  background-color: rgba(0, 0, 0, 0.15);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
}

html[data-theme="light"] .message-bubble code {
  background-color: rgba(0, 0, 0, 0.05);
}

.message-bubble pre {
  margin: 1rem 0;
  background-color: hsl(222, 25%, 6%);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

html[data-theme="light"] .message-bubble pre {
  background-color: hsl(210, 30%, 94%);
  border-color: var(--border-color);
}

.code-block-header {
  background-color: hsl(222, 25%, 10%);
  padding: 0.6rem 1rem;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

html[data-theme="light"] .code-block-header {
  background-color: hsl(210, 30%, 90%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
}

.copy-code-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

html[data-theme="light"] .copy-code-btn {
  border-color: rgba(0, 0, 0, 0.15);
}

.copy-code-btn:hover {
  color: white;
  border-color: white;
}

html[data-theme="light"] .copy-code-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.message-bubble pre code {
  display: block;
  padding: 1rem;
  overflow-x: auto;
  background: none;
  color: #e5c07b; /* soft gold text */
}

html[data-theme="light"] .message-bubble pre code {
  color: #a626a4; /* soft purple/magenta code for light theme */
}

/* Terminal controls in code block */
.terminal-dots {
  display: flex;
  gap: 6px;
  margin-right: 0.75rem;
}

.terminal-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.terminal-dots .dot.red { background-color: #ff5f56; }
.terminal-dots .dot.yellow { background-color: #ffbd2e; }
.terminal-dots .dot.green { background-color: #27c93f; }

/* Typing Indicator animation */
.typing-indicator {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  padding: 0.5rem 0.25rem;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: var(--radius-full);
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 100% { transform: translateY(0); opacity: 0.35; }
  50% { transform: translateY(-4px); opacity: 1; }
}

/* Chat Input form */
.chat-input-bar {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  display: flex;
  gap: 1rem;
  align-items: center;
}

.chat-input-field {
  flex: 1;
  background-color: var(--bg-primary);
}

.send-message-btn {
  background: var(--gradient-fabric);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.send-message-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 10px hsla(210, 100%, 50%, 0.25);
}

.send-message-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.agent-disclaimer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.5rem 1.5rem;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-light);
}

@media (max-width: 900px) {
  .agent-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (max-width: 868px) {
  .hero-grid-container {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }
  .hero-grid-container > div {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
}

