/* ==========================================================================
   IMPORTS & FONTS
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   CUSTOM PROPERTIES (ROOT VARIABLES)
   ========================================================================== */
:root {
  /* Theme colors - Aligned with main app theme */
  --perpus-primary: #0F2E1A;
  --perpus-primary-dark: #0a1f12;
  --perpus-primary-hover: #1b4332;

  /* Neutral palette (Light) */
  --perpus-bg-light: #ffffff;
  --perpus-surface-light: #f8fafc;
  --perpus-border-light: #e2e8f0;
  --perpus-divider-light: #cbd5e1;
  --perpus-text-primary-light: #0f172a;
  --perpus-text-secondary-light: #334155;
  --perpus-text-muted-light: #64748b;

  /* Neutral palette (Dark) */
  --perpus-bg-dark: #0f0f0f;
  --perpus-surface-dark: #1a1a1a;
  --perpus-border-dark: #333333;
  --perpus-divider-dark: #404040;
  --perpus-text-primary-dark: #e5e5e5;
  --perpus-text-secondary-dark: #a3a3a3;
  --perpus-text-muted-dark: #737373;

  /* Assign default (Light) */
  --perpus-bg: var(--perpus-bg-light);
  --perpus-surface: var(--perpus-surface-light);
  --perpus-border: var(--perpus-border-light);
  --perpus-divider: var(--perpus-divider-light);
  --perpus-text-primary: var(--perpus-text-primary-light);
  --perpus-text-secondary: var(--perpus-text-secondary-light);
  --perpus-text-muted: var(--perpus-text-muted-light);

  /* Shadows */
  --perpus-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.04);
  --perpus-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --perpus-shadow-hover: 0 20px 48px rgba(0, 0, 0, 0.10);

  /* Sizing & motion */
  --perpus-radius: 14px;
  --perpus-transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --perpus-bg: var(--perpus-bg-dark);
    --perpus-surface: var(--perpus-surface-dark);
    --perpus-border: var(--perpus-border-dark);
    --perpus-divider: var(--perpus-divider-dark);
    --perpus-text-primary: var(--perpus-text-primary-dark);
    --perpus-text-secondary: var(--perpus-text-secondary-dark);
    --perpus-text-muted: var(--perpus-text-muted-dark);
  }
}

/* ==========================================================================
   TEXT TRUNCATION UTILITIES
   ========================================================================== */
.line-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-line-clamp: var(--line-clamp-lines, 2);
  line-clamp: var(--line-clamp-lines, 2);
}

.line-clamp-1 {
  --line-clamp-lines: 1;
}

.line-clamp-2 {
  --line-clamp-lines: 2;
}

.line-clamp-3 {
  --line-clamp-lines: 3;
}

.line-clamp-4 {
  --line-clamp-lines: 4;
}

/* ==========================================================================
   TYPOGRAPHY & SECTION HEADINGS
   ========================================================================== */
.section-label {
  color: #C9A84C;
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  font-weight: 600;
}

.page-hero .section-label {
  color: #DFC06B;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  color: var(--perpus-primary);
  margin-bottom: 1rem;
}

.section-subtitle {
  color: #4b5563;
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto;
}

.perpus-header {
  text-align: center;
  margin-bottom: 3rem;
}

/* ==========================================================================
   NETFLIX-STYLE SECTIONS
   ========================================================================== */

/* Light mode for Perpustakaan page (aligned with app theme) */
.perpustakaan-netflix-mode {
  background: #FAF6EE;
  min-height: 100vh;
}

.perpustakaan-hero-dark {
  background: linear-gradient(135deg, #0F2E1A 0%, #1b4332 50%, #2D6A4F 100%);
  position: relative;
  overflow: hidden;
}

.perpustakaan-hero-dark::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(212, 184, 122, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(197, 168, 109, 0.06) 0%, transparent 50%);
  opacity: 0.5;
  pointer-events: none;
}

.perpustakaan-netflix-mode .page-content {
  background: #FAF6EE;
}

/* Section Styling */
.perpus-section {
  margin-bottom: 60px;
}

.perpus-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid #EDE4D3;
  position: relative;
}

.perpus-section-header::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 60px;
  height: 3px;
  background: linear-gradient(to right, #C9A84C, transparent);
}

.section-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon {
  font-size: 28px;
  line-height: 1;
  opacity: 0.9;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.perpus-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: #0F2E1A;
  margin: 0;
  letter-spacing: -0.02em;
}

.section-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0F2E1A;
  background: rgba(201, 168, 76, 0.15);
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid rgba(201, 168, 76, 0.25);
}

.view-all-link {
  background: none;
  border: none;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  color: #C9A84C;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 8px 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-all-link:hover {
  color: #0F2E1A;
  background: rgba(201, 168, 76, 0.15);
  transform: translateX(2px);
}

.view-all-link.active {
  color: #1b4332;
  background: rgba(201, 168, 76, 0.1);
}

.view-all-link.active:hover {
  color: #0F2E1A;
  background: rgba(201, 168, 76, 0.2);
  transform: translateX(-2px);
}

/* Netflix Horizontal Scroll Row - hanya desktop (>= 1024px); mobile pakai grid 1 kolom di bawah */
@media (min-width: 1024px) {
  .netflix-row {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 20px;
    padding-top: 10px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  .netflix-row::-webkit-scrollbar {
    height: 8px;
  }

  .netflix-row::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
  }

  .netflix-row::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
  }

  .netflix-row::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
  }
}

/* Responsive for section header */
/* ═══════════════════════════════════════════════════════════
   ACTION BUTTONS - 3-Button Simple Layout
   ═══════════════════════════════════════════════════════════ */

.perpus-action-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  padding: 0 4px;
}

.action-button-main {
  flex: 1;
  padding: 14px 20px;
  background: white;
  border: 1.5px solid #EDE4D3;
  border-radius: 12px;
  color: #0F2E1A;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(15, 46, 26, 0.08);
}

.action-button-main:hover {
  background: #FAF6EE;
  border-color: #C9A84C;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201, 168, 76, 0.2);
}

.action-button-main.active {
  background: #0F2E1A;
  border-color: #0F2E1A;
  color: white;
  box-shadow: 0 4px 16px rgba(15, 46, 26, 0.3);
}

/* ═══════════════════════════════════════════════════════════
   MODAL OVERLAYS & CONTENT
   ═══════════════════════════════════════════════════════════ */

/* Modal overlay: add role="dialog" aria-modal="true" on the element in JSX for accessibility */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
  }

  .modal-content {
    border-radius: 16px;
    max-height: 70vh;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--perpus-primary, #071a0c);
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 50%;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #333;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px 24px;
  display: flex;
  justify-content: flex-end;
}

/* Search Modal Input */
.search-modal-input {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(7, 26, 12, 0.05);
  border: 2px solid rgba(7, 26, 12, 0.1);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.search-modal-input:focus-within {
  border-color: var(--perpus-primary, #071a0c);
  background: rgba(7, 26, 12, 0.08);
}

.search-modal-input svg {
  color: rgba(7, 26, 12, 0.5);
  flex-shrink: 0;
}

.search-modal-input input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  color: #333;
  outline: none;
}

.search-modal-input input::placeholder {
  color: rgba(7, 26, 12, 0.4);
}

.search-modal-input .clear-search {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.08);
  border: none;
  border-radius: 50%;
  font-size: 18px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-modal-input .clear-search:hover {
  background: rgba(0, 0, 0, 0.15);
  color: #333;
}

/* Modal Options (Sort & Year) */
.modal-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(7, 26, 12, 0.03);
  border: 2px solid transparent;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.modal-option:hover {
  background: rgba(7, 26, 12, 0.06);
  border-color: rgba(7, 26, 12, 0.1);
}

.modal-option.active {
  background: rgba(15, 46, 26, 0.08);
  border-color: #0F2E1A;
  color: #0F2E1A;
  font-weight: 600;
}

.modal-option .checkmark {
  font-size: 18px;
  color: #0F2E1A;
}

.btn-modal-apply {
  padding: 12px 32px;
  background: #0F2E1A;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal-apply:hover {
  background: #1b4332;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 46, 26, 0.25);
}

/* ═══════════════════════════════════════════════════════════
   QUICK FILTER CHIPS (Mobile-Friendly)
   ═══════════════════════════════════════════════════════════ */

.perpus-quick-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 0;
  margin-bottom: 24px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.perpus-quick-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1.5px solid #EDE4D3;
  background: white;
  color: #0F2E1A;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: #C9A84C;
  background: rgba(201, 168, 76, 0.08);
  transform: translateY(-1px);
}

.filter-chip.active {
  background: #0F2E1A;
  color: white;
  border-color: #0F2E1A;
  box-shadow: 0 2px 8px rgba(15, 46, 26, 0.25);
}

.filter-chip span {
  font-size: 1.1em;
}

/* ═══════════════════════════════════════════════════════════
   COLLAPSIBLE SECTIONS (Mobile)
   ═══════════════════════════════════════════════════════════ */

.collapse-toggle {
  display: none;
  padding: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--perpus-primary, #071a0c);
  margin-left: auto;
}

.perpus-section.collapsed .netflix-row-container {
  display: none;
}

/* ═══════════════════════════════════════════════════════════
   TABLET OPTIMIZATIONS (641px - 1023px)
   ═══════════════════════════════════════════════════════════ */

@media (min-width: 641px) {
  .mobile-only {
    display: none !important;
  }

  .perpus-section-header {
    cursor: default;
  }

  .perpus-section-header:hover {
    background: transparent;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {

  /* Keep Quick Filters on Tablet */
  .perpus-quick-filters {
    padding: 14px 0;
    margin-bottom: 20px;
  }

  /* Show action buttons on tablet too */
  .perpus-action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
  }

  /* Hide toolbar on tablet - use action buttons */
  .perpus-toolbar {
    display: none !important;
  }

  /* Tablet Card Layout - cover 2:3 (lebih pendek dari 3:4) */
  .perpus-card-cover {
    aspect-ratio: 2 / 3;
  }

  .perpus-title {
    font-size: 1rem;
  }

  .perpus-author {
    font-size: 0.8rem;
  }
}

/* Desktop Optimizations */
@media (min-width: 1024px) {

  /* Hide mobile-only elements */
  .perpus-quick-filters {
    display: none;
  }

  .perpus-action-buttons {
    display: none;
  }

  /* Show desktop toolbar */
  .perpus-toolbar {
    display: flex !important;
    background: linear-gradient(135deg, #fafaf8 0%, #f5f5f0 100%);
    padding: 20px 24px;
    flex-wrap: wrap;
  }

  .toolbar-left {
    flex: 1;
    min-width: auto;
  }

  .search-box {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(7, 26, 12, 0.1);
    padding: 11px 16px;
  }

  .search-box svg,
  .search-box input {
    color: #333;
  }

  .search-box input::placeholder {
    color: rgba(7, 26, 12, 0.4);
  }

  .search-box input {
    font-size: 14px;
  }

  .filter-group {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(7, 26, 12, 0.1);
    padding: 10px 14px;
  }

  .filter-group svg,
  .filter-group select {
    color: #333;
  }

  .filter-group select {
    font-size: 13px;
    min-width: auto;
    max-width: none;
  }

  .filter-group select option {
    background: white;
    color: #333;
  }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE OPTIMIZATIONS (< 640px)
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 640px) {

  /* Container padding adjustment */
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Compact Hero Section */
  .page-hero {
    padding: 30px 0 20px;
  }

  .section-label {
    color: #C9A84C;
    font-size: 0.95rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    font-weight: 600;
  }

  .page-hero .section-label {
    color: #DFC06B;
  }

  .page-subtitle {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  /* Compact content box on mobile */
  .content-box {
    padding: 20px 16px;
    border-radius: 16px;
  }

  /* Karir search box - stack on mobile */
  .karir-search-box {
    flex-direction: column;
    gap: 8px;
  }

  .karir-btn-search {
    width: 100%;
  }

  /* Action Buttons - Mobile Optimized */
  .perpus-action-buttons {
    gap: 6px;
    margin-bottom: 12px;
    padding: 0 4px;
  }

  .action-button-main {
    padding: 11px 14px;
    font-size: 13px;
    border-radius: 10px;
  }

  /* Quick Filter Chips - Mobile Adjustments */
  .perpus-quick-filters {
    padding: 10px 0;
    margin-bottom: 14px;
    gap: 6px;
  }

  .filter-chip {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  /* Hide old toolbar on mobile - replaced with action buttons */
  .perpus-toolbar {
    display: none;
  }

  /* Section Headers - Collapsible on Mobile */
  .perpus-section {
    margin-bottom: 32px;
  }

  .perpus-section-header {
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid #EDE4D3;
  }

  .perpus-section-header:hover {
    background: #FAF6EE;
    border-color: #C9A84C;
  }

  .perpus-section-header .section-info {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .collapse-toggle {
    display: block;
  }

  .section-icon {
    font-size: 20px;
  }

  .perpus-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #0F2E1A;
    margin: 0;
    letter-spacing: -0.02em;
  }

  .view-all-link {
    font-size: 0.8rem;
    padding: 5px 10px;
    width: 100%;
    justify-content: center;
  }

  /* Cards Grid - Mobile: 1 card per row (important agar menang atas cache/CDN) */
  .netflix-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px;
    padding: 8px 0;
    overflow: visible;
  }

  .perpus-card-cinematic {
    width: 100%;
  }

  /* Card - Mobile: tanpa max-height agar viewer, tombol BACA, favorit, bagi tidak terpotong */
  .perpus-card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  /* Disable hover effects on mobile */
  .perpus-card-cinematic:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .perpus-card-cover {
    border-radius: 12px 12px 0 0;
    aspect-ratio: 2 / 3;
    flex-shrink: 0;
    min-height: 0;
  }

  .perpus-card-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: visible;
  }

  .perpus-title {
    font-size: 0.9rem;
    line-height: 1.25;
    margin-bottom: 3px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .perpus-author {
    font-size: 0.7rem;
    margin: 0 0 8px 0;
    font-style: italic;
    opacity: 0.8;
  }

  .perpus-meta-row {
    gap: 8px;
    margin-bottom: 6px;
  }

  .perpus-meta-item {
    font-size: 0.65rem;
  }

  .perpus-meta-item svg {
    width: 11px;
    height: 11px;
  }

  .perpus-stats {
    padding-top: 6px;
    margin-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }

  .perpus-stat-item {
    font-size: 0.68rem;
    gap: 3px;
  }

  .perpus-stat-item svg {
    width: 12px;
    height: 12px;
  }

  /* Footer Actions - Compact */
  .perpus-footer {
    gap: 6px;
    padding-top: 10px;
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }

  .perpus-cta {
    flex: 1;
    padding: 11px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 8px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(7, 26, 12, 0.25);
  }

  .perpus-actions {
    display: flex;
    gap: 6px;
  }

  .action-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .action-btn svg {
    width: 18px;
    height: 18px;
  }

  .action-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* ==========================================================================
   GRID LAYOUT
   ========================================================================== */
.perpus-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 0;
}

@media (min-width: 768px) {
  .perpus-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  .perpus-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1400px;
    margin: 0 auto;
    gap: 28px;
  }
}

@media (min-width: 1280px) {
  .perpus-grid {
    gap: 32px;
  }
}

/* Ads block below content (perpustakaan) */
.ads-bottom {
  margin-top: 64px;
}

/* ==========================================================================
   CARD BASE
   ========================================================================== */
.perpus-card {
  background: var(--perpus-bg);
  border-radius: var(--perpus-radius);
  overflow: hidden;
  box-shadow: var(--perpus-shadow-md);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  width: 100%;
  /* Full width di mobile/tablet */
}

.perpus-card:hover {
  transform: scale(1.08) translateY(-8px);
  z-index: 10;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* Perpustakaan mode specific card styling */
.perpustakaan-netflix-mode .perpus-card {
  background: white;
  box-shadow: 0 4px 12px rgba(15, 46, 26, 0.08);
  border: 1px solid #EDE4D3;
}

.perpustakaan-netflix-mode .perpus-card:hover {
  box-shadow: 0 12px 32px rgba(15, 46, 26, 0.15);
  border-color: #C9A84C;
}

/* ── Card Image / Cover (2:3 agar tidak terlalu tinggi) ──────────────── */
.perpus-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.perpus-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.perpus-card:hover .perpus-cover-img {
  transform: scale(1.08);
}

/* ── Card Badges (on cover) ──────────────────────────────────────────── */
.perpus-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--perpus-primary);
  color: white;
  z-index: 2;
}

.perpus-card-type {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.92);
  color: var(--perpus-text-secondary);
  backdrop-filter: blur(4px);
  z-index: 2;
}

/* ── Favorite Badge (on cover) ──────────────────────────────────────── */
.perpus-favorite-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.95);
  color: white;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  z-index: 3;
  animation: favoritePopIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  backdrop-filter: blur(8px);
}

@keyframes favoritePopIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.perpus-card:hover .perpus-favorite-badge {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.5);
}

/* ==========================================================================
   CARD CONTENT
   ========================================================================== */
.perpus-card-content {
  padding: 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.perpus-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--perpus-text-primary);
  margin-bottom: 8px;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

/* Perpustakaan mode text colors */
.perpustakaan-netflix-mode .perpus-title {
  color: #0F2E1A;
}

.perpustakaan-netflix-mode .perpus-meta-item {
  color: #64748b;
}

.perpustakaan-netflix-mode .perpus-empty {
  background: white;
  color: #64748b;
  border: 1px solid #EDE4D3;
}

.perpustakaan-netflix-mode .perpus-cover-placeholder {
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
  color: #64748b;
}

/* ── Card Author & Meta ──────────────────────────────────────────────── */
.perpus-author {
  font-size: 0.875rem;
  color: #999;
  margin: 6px 0 10px 0;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.perpustakaan-netflix-mode .perpus-author {
  color: #94a3b8;
}

.perpus-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 4px;
}

.perpus-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--perpus-text-muted);
}

/* ── Statistics Row (Passive Information) ──────────────────────────── */
.perpus-stats {
  display: flex;
  align-items: center;
  margin-top: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.perpus-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--perpus-text-muted);
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.perpus-card:hover .perpus-stat-item {
  opacity: 1;
}

.perpus-stat-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.perpus-stat-value {
  font-weight: 500;
  color: var(--perpus-text-secondary);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

/* Perpustakaan mode stats */
.perpustakaan-netflix-mode .perpus-stats {
  border-top-color: #EDE4D3;
}

.perpustakaan-netflix-mode .perpus-stat-item {
  color: #64748b;
}

.perpustakaan-netflix-mode .perpus-stat-value {
  color: #0F2E1A;
}

/* ==========================================================================
   CARD FOOTER & INTERACTIVE ELEMENTS
   ========================================================================== */
.perpus-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  margin-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Primary button */
.perpus-cta {
  flex: 1;
  padding: 12px 20px;
  background: #0F2E1A;
  color: white;
  border: none;
  border-radius: 10px;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(15, 46, 26, 0.25);
}

.perpus-cta:hover {
  background: #1b4332;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(15, 46, 26, 0.35);
}

.perpus-cta:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(15, 46, 26, 0.25);
}

/* Action icons */
.perpus-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.action-btn {
  position: relative;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.action-btn:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  border-color: transparent;
}

.action-btn:active {
  transform: scale(0.95) translateY(0);
}

/* Favorite button states */
.favorite-btn {
  color: #94a3b8;
}

.favorite-btn:hover {
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  color: #ef4444;
  border-color: #fecdd3;
}

.favorite-btn.active {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border-color: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.favorite-btn.active:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

/* Tablet: Slightly larger touch targets */
@media (max-width: 1023px) and (min-width: 640px) {
  .action-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
  }

  .perpus-actions {
    gap: 12px;
  }
}

/* Mobile: footer two rows, larger touch targets */
@media (max-width: 639px) {
  .perpus-footer {
    gap: 10px;
    padding-top: 12px;
    margin-top: 10px;
  }

  .perpus-cta {
    flex: 1;
    padding: 13px 16px;
    text-align: center;
  }

  .perpus-actions {
    display: flex;
    gap: 8px;
  }

  .action-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .perpus-stats {
    gap: 20px;
    padding-top: 8px;
    margin-top: 8px;
  }

  .perpus-stat-item {
    font-size: 12px;
  }

  .perpus-stat-item svg {
    width: 13px;
    height: 13px;
  }
}

/* Share button */
.share-btn {
  color: #94a3b8;
}

.share-btn:hover {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  color: #8b5cf6;
  border-color: #e9d5ff;
}

/* ==========================================================================
   PERPUSTAKAAN – EMPTY STATE & PLACEHOLDER
   ========================================================================== */
.perpus-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  background: var(--perpus-surface);
  border-radius: var(--perpus-radius);
  text-align: center;
  color: var(--perpus-text-muted);
}

.perpus-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.7;
}

.perpus-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
  color: #475569;
  font-size: 14px;
  gap: 8px;
}

.perpus-cover-placeholder svg {
  opacity: 0.6;
  width: 48px;
  height: 48px;
}

/* ==========================================================================
   DETAIL PAGE – LAYOUT & COMPONENTS
   ========================================================================== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 24px;
  transition: var(--perpus-transition);
  color: var(--perpus-text-secondary);
}

.page-hero .back-link {
  color: rgba(255, 255, 255, 0.8);
}

.back-link:hover {
  transform: translateX(-4px);
  color: var(--perpus-primary);
}

.page-hero .back-link:hover {
  color: white;
}

.berita-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 16px;
  color: var(--perpus-text-muted);
  font-size: 0.95rem;
}

.page-hero .berita-meta {
  color: rgba(255, 255, 255, 0.75);
}

.berita-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.page-hero .berita-meta span {
  background: rgba(255, 255, 255, 0.1);
}

/* ══════════════════════════════════════════════════════════════════════════
   DETAIL PAGE - STATS & ACTIONS
   ══════════════════════════════════════════════════════════════════════════ */

.detail-stats-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.detail-stats {
  display: flex;
  gap: 20px;
  margin-right: auto;
  flex-wrap: wrap;
}

.detail-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}

.detail-stat-item svg {
  opacity: 0.9;
}

.detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.detail-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.detail-btn:active {
  transform: translateY(0);
}

.detail-btn-favorite {
  background: rgba(255, 255, 255, 0.95);
  color: #64748b;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.detail-btn-favorite:hover {
  background: #fff1f2;
  color: #ef4444;
  border-color: #fecdd3;
}

.detail-btn-favorite.active {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border-color: #ef4444;
}

.detail-btn-favorite.active:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.detail-btn-share {
  background: rgba(255, 255, 255, 0.95);
  color: #64748b;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.detail-btn-share:hover {
  background: #faf5ff;
  color: #8b5cf6;
  border-color: #e9d5ff;
}

/* Error text */
.error-text {
  color: #dc2626;
  background: #fef2f2;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid #ef4444;
  margin: 16px 0;
}

.detail-layout {
  display: flex;
  flex-direction: row;
  gap: 32px;
  flex-wrap: wrap;
}

.detail-cover {
  flex: 0 0 260px;
  max-width: 320px;
}

.detail-cover img,
.detail-cover-placeholder {
  width: 100%;
  border-radius: 16px;
  background: rgba(15, 46, 26, 0.04);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.detail-cover-placeholder {
  aspect-ratio: 2 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 40px;
}

.detail-cover-placeholder p {
  margin-top: 8px;
  font-size: 14px;
}

.detail-info {
  flex: 1 1 260px;
  min-width: 0;
}

.detail-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--perpus-text-primary);
}

.detail-description {
  margin-bottom: 24px;
  color: var(--perpus-text-secondary);
  line-height: 1.7;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.detail-meta-card {
  background: var(--perpus-surface);
  border: 1px solid var(--perpus-border);
  border-radius: 12px;
  padding: 16px;
  transition: var(--perpus-transition);
}

.detail-meta-card:hover {
  background: white;
  border-color: var(--perpus-divider);
  box-shadow: var(--perpus-shadow-sm);
}

.detail-meta-card .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--perpus-text-muted);
  margin-bottom: 4px;
}

.detail-meta-card .value {
  font-weight: 600;
  color: var(--perpus-text-primary);
  word-break: break-word;
}

.materi-sejarah {
  margin-top: 32px;
  padding: 28px;
  background: rgba(15, 46, 26, 0.04);
  border-radius: 16px;
}

.materi-sejarah h3 {
  font-size: 1.3rem;
  margin-bottom: 16px;
  color: var(--perpus-primary);
  font-family: 'Playfair Display', serif;
}

.materi-sejarah-content {
  white-space: pre-wrap;
  line-height: 1.7;
  color: var(--perpus-text-primary);
}

/* ── Daftar Pustaka (Bibliography) ───────────────────────────────────── */
.daftar-pustaka {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--perpus-border);
}

.daftar-pustaka-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--perpus-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.daftar-pustaka-divider {
  width: 48px;
  height: 2px;
  background: var(--perpus-primary);
  margin-bottom: 20px;
}

.daftar-pustaka-content {
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--perpus-text-secondary);
  white-space: pre-wrap;
  padding-left: 24px;
  text-indent: -24px;
}

/* ── Foto Sejarah display ───────────────────────────────────────────── */
.foto-sejarah-display {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 8px;
}

.foto-sejarah-display img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  display: block;
  background: rgba(0, 0, 0, 0.03);
}

/* ==========================================================================
   REVEAL ANIMATION DELAYS
   ========================================================================== */
.reveal-delay-1 {
  transition-delay: 0.1s;
}

.reveal-delay-2 {
  transition-delay: 0.2s;
}

.reveal-delay-3 {
  transition-delay: 0.3s;
}

.reveal-delay-4 {
  transition-delay: 0.4s;
}

/* ==========================================================================
   ADDITIONAL UTILITIES
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-hero {
  background: linear-gradient(to right, rgba(7, 26, 12, 0.97), rgba(7, 26, 12, 0.9));
  color: white;
  padding: 60px 0;
  margin-bottom: 40px;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 16px;
}

.page-subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 700px;
}

.page-content {
  flex: 1;
  padding-bottom: 60px;
}

.content-box {
  background: white;
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--perpus-shadow-sm);
}

/* ==========================================================================
   BERITA (NEWS) – LIST PAGE
   ========================================================================== */
.berita-list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 640px) {
  .berita-list-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }
}

@media (min-width: 1024px) {
  .berita-list-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
}

.berita-card {
  display: flex;
  flex-direction: column;
  background: var(--perpus-bg);
  border-radius: var(--perpus-radius);
  padding: 28px;
  box-shadow: var(--perpus-shadow-sm);
  border: 1px solid var(--perpus-border);
  text-decoration: none;
  color: inherit;
  transition: var(--perpus-transition);
  cursor: pointer;
}

.berita-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--perpus-shadow-hover);
  border-color: var(--perpus-divider);
}

.berita-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.berita-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.berita-card:hover .berita-card-image img {
  transform: scale(1.05);
}

.berita-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: rgba(7, 26, 12, 0.08);
  color: var(--perpus-primary);
  margin-bottom: 16px;
  width: fit-content;
}

.berita-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--perpus-text-primary);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.berita-excerpt {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--perpus-text-muted);
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.berita-card .berita-meta {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--perpus-border);
}

.berita-card .berita-meta span {
  background: transparent;
  padding: 0;
}

.berita-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  background: var(--perpus-surface);
  border-radius: var(--perpus-radius);
  text-align: center;
  color: var(--perpus-text-muted);
  font-size: 1.1rem;
}

/* ==========================================================================
   BERITA (NEWS) – DETAIL PAGE
   ========================================================================== */
.berita-detail-image {
  margin-bottom: 28px;
  border-radius: 16px;
  overflow: hidden;
}

.berita-detail-image img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

.berita-detail-category {
  background: rgba(15, 46, 26, 0.1);
  color: var(--perpus-primary);
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.berita-detail-excerpt {
  font-size: 1.15rem;
  font-style: italic;
  color: var(--perpus-text-secondary);
  line-height: 1.8;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--perpus-border);
}

.berita-detail-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--perpus-text-primary);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* ==========================================================================
   NILAI (VALUES) – PAGE
   ========================================================================== */
.nilai-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 640px) {
  .nilai-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }
}

@media (min-width: 1024px) {
  .nilai-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
}

.nilai-card {
  background: var(--perpus-bg);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: var(--perpus-shadow-sm);
  border: 1px solid var(--perpus-border);
  transition: var(--perpus-transition);
  text-align: center;
}

.nilai-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--perpus-shadow-hover);
  border-color: var(--perpus-divider);
}

.nilai-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 20px;
  transition: var(--perpus-transition);
}

.nilai-card:hover .nilai-icon {
  transform: scale(1.1);
}

.nilai-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--perpus-text-primary);
  margin-bottom: 12px;
}

.nilai-card p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--perpus-text-muted);
}

/* ==========================================================================
   PERPUSTAKAAN DETAIL – REFACTORED LAYOUT
   ========================================================================== */
.detail-sidebar {
  flex: 0 0 280px;
  max-width: 320px;
}

.cover-container {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.cover-image {
  width: 100%;
  display: block;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.cover-placeholder {
  width: 100%;
  aspect-ratio: 2 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
  gap: 8px;
}

.placeholder-icon {
  font-size: 48px;
  opacity: 0.6;
}

.placeholder-text {
  font-size: 0.85rem;
  color: var(--perpus-text-muted);
}

.detail-main {
  flex: 1 1 280px;
  min-width: 0;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  color: var(--perpus-text-muted);
  font-size: 0.95rem;
}

.page-hero .detail-meta {
  color: rgba(255, 255, 255, 0.75);
}

.detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.meta-item {
  background: var(--perpus-surface);
  border: 1px solid var(--perpus-border);
  border-radius: 12px;
  padding: 14px 16px;
  transition: var(--perpus-transition);
}

.meta-item:hover {
  background: white;
  border-color: var(--perpus-divider);
  box-shadow: var(--perpus-shadow-sm);
}

.meta-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--perpus-text-muted);
  margin-bottom: 4px;
}

.meta-value {
  font-weight: 600;
  color: var(--perpus-text-primary);
  font-size: 0.95rem;
  word-break: break-word;
}

.history-section {
  margin-top: 32px;
  padding: 28px;
  background: rgba(15, 46, 26, 0.04);
  border-radius: 16px;
}

.history-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--perpus-primary);
  margin-bottom: 16px;
}

.history-content {
  white-space: pre-wrap;
  line-height: 1.7;
  color: var(--perpus-text-primary);
}

/* ── Detail page responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .content-box {
    padding: 20px;
  }

  .detail-layout {
    flex-direction: column;
  }

  .detail-sidebar,
  .detail-cover {
    flex: none;
    max-width: 100%;
  }

  .detail-info {
    flex: none;
  }

  .detail-title {
    font-size: 1.4rem;
  }

  .materi-sejarah {
    padding: 18px;
  }

  .materi-sejarah-content,
  .daftar-pustaka-content {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  /* Ensure nested reveal elements inside a visible parent appear */
  .content-box.visible .materi-sejarah.reveal,
  .content-box.visible .daftar-pustaka.reveal {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   KARIR (CAREER) – PAGE
   ========================================================================== */

/* Intro */
.karir-intro {
  max-width: 720px;
  margin: 0 auto 40px;
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--perpus-text-secondary);
}

.karir-intro strong {
  color: var(--perpus-primary);
}

/* Stats Grid */
.karir-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}

.karir-stat-card {
  background: var(--perpus-bg);
  border-radius: 20px;
  padding: 32px 20px;
  box-shadow: var(--perpus-shadow-sm);
  border: 1px solid var(--perpus-border);
  text-align: center;
  transition: var(--perpus-transition);
}

.karir-stat-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--perpus-shadow-hover);
  border-color: var(--perpus-divider);
}

.karir-stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--perpus-primary);
  line-height: 1;
  margin-bottom: 8px;
}

.karir-stat-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--perpus-text-muted);
  letter-spacing: 0.02em;
}

/* Action Cards */
.karir-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.karir-action-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--perpus-bg);
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: var(--perpus-shadow-sm);
  border: 1px solid var(--perpus-border);
  cursor: pointer;
  transition: var(--perpus-transition);
}

.karir-action-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--perpus-shadow-hover);
  border-color: var(--perpus-divider);
}

.karir-action-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(7, 26, 12, 0.06);
  color: var(--perpus-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--perpus-transition);
}

.karir-action-card:hover .karir-action-icon {
  background: var(--perpus-primary);
  color: white;
}

.karir-action-text {
  flex: 1;
  min-width: 0;
}

.karir-action-text h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--perpus-text-primary);
  margin-bottom: 4px;
}

.karir-action-text p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--perpus-text-muted);
}

.karir-action-arrow {
  flex-shrink: 0;
  color: var(--perpus-text-muted);
  opacity: 0;
  transform: translateX(-8px);
  transition: var(--perpus-transition);
}

.karir-action-card:hover .karir-action-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ── Karir Modal ─────────────────────────────────────────────────────── */
.karir-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: karirFadeIn 0.25s ease;
}

@keyframes karirFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.karir-modal {
  background: var(--perpus-bg);
  border-radius: 20px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
  animation: karirSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes karirSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.karir-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--perpus-border);
  position: sticky;
  top: 0;
  background: var(--perpus-bg);
  border-radius: 20px 20px 0 0;
  z-index: 2;
}

.karir-modal-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--perpus-text-primary);
}

.karir-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--perpus-border);
  background: var(--perpus-surface);
  font-size: 1.4rem;
  color: var(--perpus-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--perpus-transition);
}

.karir-modal-close:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #dc2626;
}

/* ── Karir Form ──────────────────────────────────────────────────────── */
.karir-form {
  padding: 28px;
}

.karir-form-section {
  margin-bottom: 28px;
}

.karir-form-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--perpus-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(7, 26, 12, 0.08);
}

.karir-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.karir-form-group {
  margin-bottom: 16px;
}

.karir-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--perpus-text-secondary);
  margin-bottom: 6px;
}

.karir-required {
  color: #dc2626;
}

.karir-form-group input,
.karir-form-group select,
.karir-form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--perpus-border);
  border-radius: 10px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--perpus-text-primary);
  background: var(--perpus-surface);
  transition: var(--perpus-transition);
  outline: none;
}

.karir-form-group input:focus,
.karir-form-group select:focus,
.karir-form-group textarea:focus {
  border-color: var(--perpus-primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(7, 26, 12, 0.08);
}

.karir-form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.karir-form-group input::placeholder,
.karir-form-group textarea::placeholder {
  color: var(--perpus-text-muted);
  opacity: 0.7;
}

.karir-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--perpus-border);
}

.karir-btn-cancel {
  padding: 12px 28px;
  border-radius: 12px;
  border: 1px solid var(--perpus-border);
  background: white;
  color: var(--perpus-text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--perpus-transition);
}

.karir-btn-cancel:hover {
  background: var(--perpus-surface);
  border-color: var(--perpus-divider);
}

.karir-btn-submit {
  padding: 12px 32px;
  border-radius: 12px;
  border: none;
  background: var(--perpus-primary);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--perpus-transition);
  box-shadow: 0 4px 16px rgba(7, 26, 12, 0.2);
}

.karir-btn-submit:hover {
  background: var(--perpus-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(7, 26, 12, 0.25);
}

.karir-btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── Karir Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .karir-stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .karir-stat-card {
    padding: 24px 16px;
  }

  .karir-stat-number {
    font-size: 2.2rem;
  }

  .karir-action-card {
    padding: 20px;
  }

  .karir-action-arrow {
    display: none;
  }

  .karir-form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .karir-modal {
    max-height: 95vh;
    border-radius: 16px;
  }

  .karir-modal-header {
    padding: 20px;
    border-radius: 16px 16px 0 0;
  }

  .karir-modal-header h2 {
    font-size: 1.1rem;
  }

  .karir-form {
    padding: 20px;
  }

  .karir-form-actions {
    flex-direction: column-reverse;
  }

  .karir-btn-cancel,
  .karir-btn-submit {
    width: 100%;
    text-align: center;
  }
}

/* ==========================================================================
   KONTAK (CONTACT) – PAGE
   ========================================================================== */

/* Grid: two columns */
.kontak-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  align-items: start;
}

/* Shared section title */
.kontak-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--perpus-text-primary);
  margin-bottom: 24px;
}

/* ── Info Column ─────────────────────────────────────────────────────── */
.kontak-info {
  background: var(--perpus-bg);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: var(--perpus-shadow-sm);
  border: 1px solid var(--perpus-border);
}

.kontak-items {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
}

.kontak-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.kontak-item-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(7, 26, 12, 0.06);
  color: var(--perpus-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kontak-item strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--perpus-text-muted);
  margin-bottom: 2px;
}

.kontak-item p {
  font-size: 0.95rem;
  color: var(--perpus-text-primary);
  line-height: 1.5;
  word-break: break-word;
}

/* Social */
.kontak-social {
  padding-top: 24px;
  border-top: 1px solid var(--perpus-border);
}

.kontak-social-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--perpus-text-muted);
  margin-bottom: 12px;
}

.kontak-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kontak-social-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--perpus-surface);
  color: var(--perpus-text-secondary);
  border: 1px solid var(--perpus-border);
  transition: var(--perpus-transition);
}

.kontak-social-link:hover {
  background: var(--perpus-primary);
  color: white;
  border-color: var(--perpus-primary);
  transform: translateY(-2px);
}

/* ── Form Column ─────────────────────────────────────────────────────── */
.kontak-form {
  background: var(--perpus-bg);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: var(--perpus-shadow-sm);
  border: 1px solid var(--perpus-border);
}

.kontak-form-group {
  margin-bottom: 18px;
}

.kontak-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--perpus-text-secondary);
  margin-bottom: 6px;
}

.kontak-form-group input,
.kontak-form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--perpus-border);
  border-radius: 10px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--perpus-text-primary);
  background: var(--perpus-surface);
  transition: var(--perpus-transition);
  outline: none;
}

.kontak-form-group input:focus,
.kontak-form-group textarea:focus {
  border-color: var(--perpus-primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(7, 26, 12, 0.08);
}

.kontak-form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.kontak-form-group input::placeholder,
.kontak-form-group textarea::placeholder {
  color: var(--perpus-text-muted);
  opacity: 0.7;
}

/* Alerts */
.kontak-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 20px;
}

.kontak-alert-success {
  background: rgba(7, 26, 12, 0.06);
  color: var(--perpus-primary);
  border: 1px solid rgba(7, 26, 12, 0.12);
}

.kontak-alert-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* Submit button */
.kontak-submit-btn {
  width: 100%;
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  background: var(--perpus-primary);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: var(--perpus-transition);
  box-shadow: 0 4px 16px rgba(7, 26, 12, 0.2);
  margin-top: 4px;
}

.kontak-submit-btn:hover {
  background: var(--perpus-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(7, 26, 12, 0.25);
}

.kontak-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── Kontak Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .kontak-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .kontak-info,
  .kontak-form {
    padding: 24px 20px;
  }

  .kontak-section-title {
    font-size: 1.2rem;
  }
}

/* ============================================
   PERPUSTAKAAN NETFLIX ENHANCEMENTS
   ============================================ */

/* --- Error Message Styling --- */
.perpus-error {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
  border: 2px solid #ffc107;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 32px;
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.error-icon {
  font-size: 32px;
  line-height: 1;
}

.error-content {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.error-message {
  margin: 0;
  color: #856404;
  font-size: 15px;
  font-weight: 500;
}

.error-hint {
  margin: 0;
  font-size: 13px;
  color: #856404;
  opacity: 0.9;
  width: 100%;
}

.error-hint code {
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.error-retry-btn {
  padding: 8px 20px;
  background: #ffc107;
  color: #856404;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.error-retry-btn:hover {
  background: #ffb300;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

/* --- Toolbar - Search, Sort, Filter --- */
.perpus-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(135deg, #fafaf8 0%, #f5f5f0 100%);
  padding: 20px 24px;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(7, 26, 12, 0.06);
  margin-bottom: 32px;
  flex-wrap: wrap;
  border: 1px solid rgba(7, 26, 12, 0.06);
}

.toolbar-left {
  flex: 1;
  min-width: 280px;
}

.toolbar-right {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid rgba(7, 26, 12, 0.08);
  border-radius: 12px;
  padding: 13px 18px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
}

.search-box:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(7, 26, 12, 0.12);
}

.search-box:focus-within {
  background: #ffffff;
  border-color: rgba(7, 26, 12, 0.3);
  box-shadow: 0 0 0 3px rgba(7, 26, 12, 0.08);
}

.search-box svg {
  color: rgba(7, 26, 12, 0.5);
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.search-box:focus-within svg {
  color: var(--perpus-primary);
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: var(--perpus-text-primary);
  font-weight: 400;
}

.search-box input::placeholder {
  color: rgba(7, 26, 12, 0.4);
}

.clear-search {
  background: none;
  border: none;
  color: rgba(7, 26, 12, 0.3);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.clear-search:hover {
  color: var(--perpus-primary);
  background: rgba(7, 26, 12, 0.08);
}

.clear-search:active {
  color: #333;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid rgba(7, 26, 12, 0.08);
  border-radius: 11px;
  padding: 11px 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
}

.filter-group:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(7, 26, 12, 0.15);
  box-shadow: 0 2px 6px rgba(7, 26, 12, 0.06);
}

.filter-group:focus-within {
  background: #ffffff;
  border-color: rgba(7, 26, 12, 0.25);
  box-shadow: 0 0 0 2px rgba(7, 26, 12, 0.06);
}

.filter-group svg {
  color: rgba(7, 26, 12, 0.5);
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.filter-group:hover svg,
.filter-group:focus-within svg {
  color: var(--perpus-primary);
}

.filter-group select {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--perpus-text-primary);
  cursor: pointer;
  padding: 0;
  min-width: 120px;
}

.filter-group select option {
  background: white;
  color: var(--perpus-text-primary);
  padding: 8px;
}

/* --- Cinematic Card Hover Effects --- */
.perpus-card-cinematic {
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s 0.3s;
}

/* Cinematic Hover - ONLY on Desktop */
@media (min-width: 1024px) {
  .perpus-card-cinematic:hover {
    transform: scale(1.08);
    z-index: 100;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s 0s;
  }
}

/* Cover cinematic (2:3) - selaras dengan blok .perpus-card-cover di atas */
.perpus-card-cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  width: 100%;
}

.perpus-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Overlay - ONLY on Desktop */
@media (min-width: 1024px) {
  .perpus-card-cinematic:hover .perpus-card-overlay {
    opacity: 1;
    pointer-events: auto;
  }
}

.overlay-play-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transform: translateY(10px);
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.perpus-card-cinematic:hover .overlay-play-btn {
  transform: translateY(0);
  opacity: 1;
  transition-delay: 0.1s;
}

.overlay-play-btn:hover {
  background: #fff;
  transform: scale(1.05);
}

/* --- Favorite Button Active State --- */

/* --- Netflix Row with Scroll Arrows --- */
.netflix-row-container {
  position: relative;
  margin: 0;
  padding: 0;
}

/* MOBILE FIRST: 1 card per row (base; desktop override di 1024px) */
.netflix-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 8px 0;
}

/* TABLET: 2 columns (640px - 1024px) */
@media (min-width: 640px) and (max-width: 1023px) {
  .netflix-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* DESKTOP: Netflix Horizontal Scroll (> 1024px) */
@media (min-width: 1024px) {
  .netflix-row-container {
    margin: 0 -24px;
    padding: 0 24px;
  }

  .netflix-row {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 8px 0 16px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .netflix-row::-webkit-scrollbar {
    display: none;
  }

  .perpus-card {
    flex: 0 0 280px;
    min-width: 280px;
    max-width: 280px;
  }
}

/* LARGE DESKTOP: Bigger Cards */
@media (min-width: 1280px) {
  .netflix-row {
    gap: 24px;
  }

  .perpus-card {
    flex: 0 0 320px;
    min-width: 320px;
    max-width: 320px;
  }
}

/* Scroll Arrows - ONLY on Desktop */
.netflix-arrow {
  display: none;
  /* Hidden by default (mobile/tablet) */
}

@media (min-width: 1024px) {
  .netflix-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    width: 56px;
    height: 100%;
    max-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
  }

  .netflix-arrow:hover {
    background: rgba(0, 0, 0, 0.85);
  }

  .netflix-arrow-left {
    left: 0;
    border-radius: 0 8px 8px 0;
  }

  .netflix-arrow-right {
    right: 0;
    border-radius: 8px 0 0 8px;
  }
}

/* --- Empty State Improvements --- */
.perpus-empty {
  text-align: center;
  padding: 80px 24px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 16px;
  margin: 40px 0;
}

.perpus-empty-icon {
  font-size: 80px;
  display: block;
  margin-bottom: 24px;
  opacity: 0.6;
}

.perpus-empty p {
  font-size: 18px;
  color: #666;
  margin: 0 0 20px 0;
}

.btn-clear-filter {
  padding: 12px 28px;
  background: var(--perpus-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 8px;
}

.btn-clear-filter:hover {
  background: var(--perpus-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(7, 26, 12, 0.25);
}

/* ============================================
   RESPONSIVE ENHANCEMENTS
   ============================================ */

/* Disable Hover Effects on Mobile/Tablet */
@media (max-width: 1023px) {
  .perpus-card-cinematic:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  .perpus-card-overlay {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .perpus-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .toolbar-left {
    min-width: 100%;
  }

  .toolbar-right {
    flex-direction: column;
    gap: 12px;
  }

  .filter-group {
    justify-content: space-between;
  }

  .error-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .error-retry-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .perpus-error {
    flex-direction: column;
    text-align: center;
  }

  .perpus-empty {
    padding: 60px 20px;
  }

  .perpus-empty-icon {
    font-size: 60px;
  }

  .netflix-row-container {
    margin: 0 -16px;
    padding: 0 16px;
  }

  .search-box {
    padding: 10px 12px;
  }

  .search-box input {
    font-size: 14px;
  }

  .detail-stats-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .detail-stats {
    width: 100%;
    gap: 12px;
  }

  .detail-actions {
    width: 100%;
    gap: 12px;
  }

  .detail-btn {
    flex: 1;
    justify-content: center;
    min-width: 0;
  }

  .detail-stat-item {
    font-size: 13px;
    padding: 5px 10px;
  }

  .page-title {
    font-size: 2rem;
  }
}

/* ═══════════════════════════════════════════════════════════
   KARIR - Check Status & Statistics Modals
   ═══════════════════════════════════════════════════════════ */

.karir-modal-small {
  max-width: 600px;
}

.karir-modal-large {
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Status Check */
.karir-status-check {
  padding: 24px;
}

.karir-status-instruction {
  font-size: 15px;
  color: #64748b;
  margin-bottom: 24px;
  line-height: 1.6;
}

.karir-search-box {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}

.karir-search-box input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.2s ease;
}

.karir-search-box input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.karir-btn-search {
  padding: 14px 28px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.karir-btn-search:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.karir-btn-search:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Status Result */
.karir-status-result {
  margin-top: 24px;
  animation: fadeIn 0.3s ease;
}

.karir-status-not-found {
  text-align: center;
  padding: 40px 20px;
}

.karir-status-not-found .status-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.karir-status-not-found h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.karir-status-not-found p {
  color: #64748b;
  margin-bottom: 6px;
}

.karir-status-not-found .status-hint {
  font-size: 14px;
  color: #94a3b8;
}

.karir-status-found {
  background: #f8fafc;
  border-radius: 12px;
  padding: 24px;
}

.status-badge {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.status-terdata {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.status-sedang-proses {
  background: #dbeafe;
  color: #1e40af;
}

.status-badge.status-berhasil-ditempatkan {
  background: #d1fae5;
  color: #065f46;
}

.status-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.status-detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-detail-item.full-width {
  grid-column: 1 / -1;
}

.status-label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-value {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

/* Status Timeline */
.status-timeline {
  position: relative;
  padding-left: 40px;
}

.status-timeline::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.timeline-item.completed {
  opacity: 1;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -28px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e2e8f0;
  border: 3px solid white;
  transition: all 0.3s ease;
}

.timeline-item.completed .timeline-dot {
  background: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.timeline-content h4 {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}

.timeline-content p {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

/* Statistics */
.karir-statistics {
  padding: 24px;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.stats-summary-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: white;
}

.stats-summary-card:nth-child(2) {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stats-summary-card:nth-child(3) {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stats-summary-icon {
  font-size: 36px;
  opacity: 0.9;
}

.stats-summary-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.stats-summary-label {
  font-size: 14px;
  opacity: 0.9;
  font-weight: 500;
}

.stats-section {
  margin-bottom: 40px;
}

.stats-section h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 20px;
}

/* Stats Table */
.stats-table {
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.stats-table-row {
  display: grid;
  grid-template-columns: 200px 1fr 60px;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.2s ease;
}

.stats-table-row:last-child {
  border-bottom: none;
}

.stats-table-row:hover {
  background: #f8fafc;
}

.stats-table-label {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.stats-table-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.stats-table-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.stats-table-value {
  font-size: 16px;
  font-weight: 700;
  color: #3b82f6;
  text-align: right;
}

/* Stats Chart */
.stats-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 12px;
  height: 300px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.stats-chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stats-chart-value {
  font-size: 14px;
  font-weight: 700;
  color: #3b82f6;
}

.stats-chart-bar-fill {
  width: 100%;
  max-width: 60px;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 6px 6px 0 0;
  min-height: 20px;
  transition: height 0.5s ease;
}

.stats-chart-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {

  .karir-modal-large,
  .karir-modal-small {
    max-width: 95%;
    margin: 10px;
  }

  .karir-search-box {
    flex-direction: column;
  }

  .karir-btn-search {
    width: 100%;
  }

  .stats-summary {
    grid-template-columns: 1fr;
  }

  .stats-table-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stats-table-bar {
    order: 3;
  }

  .stats-table-value {
    order: 2;
    text-align: left;
  }

  .stats-chart {
    height: 250px;
    padding: 16px;
  }

  .stats-chart-bar-fill {
    max-width: 40px;
  }
}