/* ==========================================================================
   KOLEKSI E-BOOK DIGITAL - DEDICATED STYLESHEET
   Institut Kesehatan Karsa Husada Garut
   ========================================================================== */

.ebook-section {
  padding: 3.5rem 0 5rem;
  background-color: var(--bg-body, #f8fafc);
}

/* Quick Stats Bar */
.ebook-stats-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.ebook-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #ffffff;
  padding: 0.6rem 1.15rem;
  border-radius: 9999px;
  border: 1px solid var(--border-light, #e2e8f0);
  font-size: 0.825rem;
  color: var(--text-body, #334155);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ebook-stat-chip svg {
  color: var(--primary, #09a89e);
}

.ebook-stat-chip strong {
  color: var(--primary-dark, #065e58);
  font-weight: 700;
}

/* Filter & Search Toolbar */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  background: #ffffff;
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.category-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.tag-btn.active {
  background: var(--primary, #09a89e);
  border-color: var(--primary, #09a89e);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(9, 168, 158, 0.25);
}

.search-input-wrap {
  position: relative;
  min-width: 300px;
}

.search-input-wrap input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.875rem;
  background: #ffffff;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input-wrap input:focus {
  border-color: var(--primary, #09a89e);
  box-shadow: 0 0 0 3px rgba(9, 168, 158, 0.15);
}

.search-input-wrap svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

/* Platform E-Book Grid (3 Columns) */
.ebook-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-bottom: 4rem;
}

.ebook-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
}

.ebook-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.03);
  border-color: var(--primary, #09a89e);
}

/* Card Header Banner */
.ebook-cover-wrap {
  padding: 1.5rem 1.5rem 1.25rem;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 125px;
  position: relative;
}

.ebook-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ebook-badge {
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.ebook-access-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.ebook-cover-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Card Body */
.ebook-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.ebook-publisher-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: #078f86;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.ebook-category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.category-pill {
  font-size: 0.6875rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.ebook-desc {
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

/* Access Guidance Alert Box inside card */
.ebook-guide-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  font-size: 0.75rem;
  color: #334155;
  line-height: 1.45;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.ebook-guide-box svg {
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: #0284c7;
}

/* Action Button */
.ebook-actions {
  margin-top: auto;
  border-top: 1px solid #f1f5f9;
  padding-top: 1.15rem;
}

.btn-open-ebook {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1.25rem;
  background: linear-gradient(135deg, #078f86 0%, #09a89e 100%);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(9, 168, 158, 0.25);
  transition: all 0.2s ease;
  border: none;
}

.btn-open-ebook:hover {
  background: linear-gradient(135deg, #06726b 0%, #078f86 100%);
  box-shadow: 0 4px 12px rgba(9, 168, 158, 0.35);
  transform: translateY(-1px);
  color: #ffffff;
}

/* ==========================================================================
   INSTITUTIONAL HELP & PROCEDURE SECTION (.ebook-info-box)
   ========================================================================== */
.ebook-info-box {
  background: #ffffff;
  border: 1px solid rgba(9, 168, 158, 0.2);
  border-top: 4px solid var(--primary, #09a89e);
  border-radius: 18px;
  padding: 2.25rem 2.25rem 2rem;
  box-shadow: 0 12px 35px -8px rgba(9, 168, 158, 0.12), 0 4px 16px rgba(0, 0, 0, 0.04);
  margin-top: 3.5rem;
  position: relative;
  overflow: hidden;
}

.ebook-info-box::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(9, 168, 158, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* Header */
.ebook-info-header {
  display: flex;
  align-items: flex-start;
  gap: 1.15rem;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.ebook-info-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(9, 168, 158, 0.16) 0%, rgba(9, 168, 158, 0.06) 100%);
  border: 1.5px solid rgba(9, 168, 158, 0.3);
  color: var(--primary, #09a89e);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(9, 168, 158, 0.1);
}

.ebook-info-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.35rem;
  letter-spacing: -0.015em;
  font-family: var(--font-heading, inherit);
}

.ebook-info-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
  line-height: 1.55;
}

/* Grid of 3 Steps */
.ebook-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.ebook-step-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.5rem 1.35rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.ebook-step-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(9, 168, 158, 0.18), 0 4px 10px rgba(0, 0, 0, 0.04);
  border-color: rgba(9, 168, 158, 0.4);
  background: #ffffff;
}

/* Header inside each card */
.ebook-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.ebook-step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #09a89e 0%, #078f86 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(9, 168, 158, 0.35);
}

.ebook-step-badge-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(9, 168, 158, 0.08);
  border: 1px solid rgba(9, 168, 158, 0.2);
  color: #078f86;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ebook-step-content h4 {
  font-size: 0.985rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.55rem;
  line-height: 1.4;
}

.ebook-step-content p {
  font-size: 0.835rem;
  color: #475569;
  line-height: 1.6;
  margin: 0;
}

.ebook-step-content code {
  background: rgba(9, 168, 158, 0.1);
  color: #078f86;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.8rem;
  font-family: inherit;
}

.ebook-step-content strong {
  color: #0f172a;
  font-weight: 700;
}

/* Footer Help Contact Bar */
.ebook-help-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: linear-gradient(135deg, #eef7f6 0%, #f4faf9 100%);
  border: 1px solid rgba(9, 168, 158, 0.25);
  border-radius: 12px;
  padding: 1rem 1.35rem;
  position: relative;
  z-index: 1;
}

.ebook-help-footer-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.ebook-help-footer-text svg {
  color: #09a89e;
  flex-shrink: 0;
}

.btn-help-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.35rem;
  background: linear-gradient(135deg, #09a89e 0%, #078f86 100%);
  color: #ffffff !important;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(9, 168, 158, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-help-contact:hover {
  background: linear-gradient(135deg, #0ab8ad 0%, #089b91 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(9, 168, 158, 0.4);
  color: #ffffff !important;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .ebook-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ebook-steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .ebook-grid {
    grid-template-columns: 1fr;
  }
  .ebook-steps-grid {
    grid-template-columns: 1fr;
  }
  .ebook-info-box {
    padding: 1.5rem 1.15rem;
  }
  .ebook-info-header {
    flex-direction: column;
    gap: 0.75rem;
  }
  .ebook-help-footer {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .ebook-help-footer-text {
    justify-content: center;
  }
  .btn-help-contact {
    justify-content: center;
    width: 100%;
  }
  .search-input-wrap {
    min-width: 100%;
  }
  .filter-bar {
    padding: 1rem;
  }
}
