* {
  box-sizing: border-box;
}

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #172033;
  --muted: #687386;
  --border: #dfe5ec;
  --accent: #2857d9;
  --accent-soft: #edf2ff;
  --accent-hover: #1f46b4;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(23, 32, 51, 0.06);
}

body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
}

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

.brand-mark {
    width: 144px;
    height: 44px;
    border-radius: 12px;
    object-fit: contain;
    background: white;
}

.brand-title {
  font-weight: 700;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.topbar input,
.topbar select,
.resource-toolbar select {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  background: white;
  color: var(--text);
}

.topbar input {
  min-width: 250px;
}

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px;
}

.intro-section {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 32px;
  align-items: center;
  padding: 34px;
  border: 1px solid #13295e;
  border-radius: 24px;
  background: linear-gradient(135deg, #0b1d4d 0%, #102a63 100%);
  box-shadow: 0 16px 40px rgba(11, 29, 77, 0.25);
  color: #ffffff;
}

.eyebrow {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: #2f55c8;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.intro-copy h1 {
  margin: 18px 0 12px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
  color: #ffffff;
}

.intro-copy p {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.7;
}

.intro-copy .lead {
  color: #ffffff;
  font-size: 18px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.chips span {
  border: 1px solid var(--border);
  background: white;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13px;
}

.video-placeholder {
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 28px;
  text-align: center;
  color: #ffffff;
  background:
    radial-gradient(circle at 70% 20%, rgba(70, 120, 255, 0.35), transparent 40%),
    linear-gradient(135deg, #142c66, #1a3a80);
}

.video-badge {
  padding: 6px 10px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.video-title {
  margin-top: 18px;
  font-size: 26px;
  font-weight: 700;
}

.video-subtitle {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.8);
}

.play-button {
  width: 60px;
  height: 60px;
  margin-top: 22px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 0 3px;
}

.play-button:hover {
  background: var(--accent-hover);
}

.video-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 12px;
}

.video-meta strong,
.video-meta span {
  display: block;
}

.video-meta strong {
  color: #ffffff;
}

.video-meta span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.video-meta .secondary-button {
  border-color: #ffffff;
  color: var(--text);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 40px;
  border-radius: 10px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 700;
}

.primary-button {
  background: var(--accent);
  color: white;
}

.secondary-button {
  border: 1px solid var(--border);
  background: white;
}

.full {
  width: 100%;
}

.resource-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 20px;
  border-right: 1px solid var(--border);
  background: #fbfcfe;
}

.sidebar-label {
  margin-bottom: 10px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.nav-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  padding: 11px 10px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.help-box {
  margin-top: 24px;
  border-radius: 14px;
  padding: 16px;
  background: var(--accent-soft);
}

.help-box p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.resource-main {
  min-width: 0;
  padding: 24px;
}

.resource-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
}

.resource-toolbar h2 {
  margin: 0;
}

.resource-toolbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.resource-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: white;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.resource-card:hover {
  transform: translateY(-2px);
  border-color: #bcc8d6;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.file-icon {
  min-width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  background: var(--accent-soft);
}

.file-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.file-icon.has-thumb {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f1f5f9;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.file-icon.has-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.file-icon.has-thumb img {
  object-fit: cover;
}

/* Image Lightbox Modal */
.image-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 10, 16, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.image-lightbox-overlay.hidden {
  display: none !important;
}

.image-lightbox-dialog {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-lightbox-dialog img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65);
  background: #0f172a;
}

.image-lightbox-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid white;
  background: #1e293b;
  color: white;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, background 0.15s ease;
  z-index: 10;
}

.image-lightbox-close:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.file-icon.file-badge {
  padding: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1;
  user-select: none;
}

.file-icon.badge-ppt {
  background: #fff4ed;
  color: #ea580c;
  border: 1px solid #fed7aa;
}

.file-icon.badge-pdf {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.card-subtype {
  display: none !important;
}

.resource-card h3 {
  margin: 14px 0 0;
  font-size: 17px;
}

.meta-chips {
  display: none;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.meta-chips span {
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 12px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.card-actions.single-action {
  grid-template-columns: 1fr;
}

.card-actions a:only-child {
  grid-column: 1 / -1;
  width: 100%;
}

.card-actions a,
.card-actions button {
  min-height: 38px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
}

.preview-link {
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
}

.download-link {
  background: var(--accent);
  color: white;
  border: none;
}

.empty-state {
  margin-top: 20px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
}

.empty-state p {
  color: var(--muted);
}

.hidden {
  display: none;
}

.footer {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 28px 34px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .topbar,
  .video-meta,
  .resource-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar input {
    min-width: 0;
    width: 100%;
  }

  .topbar-actions {
    width: 100%;
  }

  .intro-section {
    grid-template-columns: 1fr;
  }

  .resource-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 620px) {
  .topbar-actions {
    flex-direction: column;
  }

  main {
    padding: 16px;
  }

  .intro-section {
    padding: 22px;
  }

  .video-placeholder {
    aspect-ratio: auto;
    min-height: 250px;
    padding: 24px 18px;
  }

  .video-title {
    font-size: 22px;
    margin-top: 12px;
  }

  .video-subtitle {
    font-size: 13px;
    margin-top: 6px;
  }

  .play-button {
    width: 52px;
    height: 52px;
    margin-top: 16px;
    font-size: 18px;
    flex-shrink: 0;
  }

  .resource-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    padding-left: 16px;
    padding-right: 16px;
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 12px 16px;
  }

  .brand-mark {
    width: 120px;
    height: 38px;
  }

  .brand-title {
    font-size: 14px;
  }

  .brand-subtitle {
    display: none;
  }

  .intro-section {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .video-placeholder {
    aspect-ratio: auto;
    min-height: 230px;
    padding: 20px 14px;
  }

  .video-badge {
    padding: 4px 8px;
    font-size: 11px;
  }

  .video-title {
    font-size: 18px;
    margin-top: 10px;
    line-height: 1.35;
  }

  .video-subtitle {
    font-size: 12px;
    margin-top: 5px;
  }

  .play-button {
    width: 46px;
    height: 46px;
    margin-top: 14px;
    font-size: 16px;
    flex-shrink: 0;
    padding-left: 2px;
  }

  .video-meta {
    gap: 10px;
  }

  .video-meta .secondary-button {
    text-align: center;
  }

  .intro-copy h1 {
    font-size: 26px;
  }

  .intro-copy .lead {
    font-size: 15px;
  }

  .resource-layout {
    border-radius: 18px;
    margin-top: 18px;
  }

  .sidebar {
    padding: 14px;
  }

  .resource-main {
    padding: 16px 12px;
  }
}

.dynamic-categories {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.page-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.page-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

