/* Page Header Component Styles - Gradient header bar matching app theme */

.page-header {
  --page-header-height: 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 0;
  min-height: var(--page-header-height);
  padding: 0 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--app-primary-start, #2563EB) 0%, var(--app-primary-end, #EC4899) 100%);
  box-shadow: 0 4px 16px rgba(14, 111, 186, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  /* Fixed header aligned with main content (starts where sidebar content starts) */
  position: fixed;
  top: 5px;
  left: var(--main-content-offset, 121px);
  right: 24px;
  z-index: 80;
}

.page-header-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  position: relative;
  flex: 1 1 auto;
}

/* Back button placed inside page header before the icon */
.page-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-right: 4px;
  transition: all 0.2s ease;
}

.page-back-btn .page-back-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
  color: #ffffff;
}

.page-back-btn:hover .page-back-icon {
  background: rgba(255, 255, 255, 0.22);
}

.page-header-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

/* Blade FontAwesome SVG icon trong page-header */
.page-header-icon svg {
  width: 1em;
  height: 1em;
  color: #ffffff;
  fill: currentColor;
}

.page-header h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff;
  letter-spacing: -0.4px;
  font-family: var(--app-font, 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans');
}

.page-header-text {
  min-width: 0;
  flex: 1 0 25%;
  max-width: 25%;
}

/* Meta container: nằm inline sau title, chiếm 75% còn lại */
.page-header-meta {
  display: flex;
  align-items: center;
  flex: 3 1 75%;
  min-width: 0;
  overflow: hidden;
}

/* Description/subtitle removed to match compact header design */
.page-header-text h1+p {
  display: none;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.page-header-actions .actions-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-header-actions .btn-primary,
.page-header-actions .btn-secondary,
.page-header-actions .btn-ghost,
.page-header-actions .btn-danger {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.page-header-actions .btn-primary:hover,
.page-header-actions .btn-secondary:hover,
.page-header-actions .btn-ghost:hover,
.page-header-actions .btn-danger:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.2);
}

/* Default button style in header actions */
.page-header-actions button,
.page-header-actions .btn {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-header-actions button:hover,
.page-header-actions .btn:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.2);
}

/* Campaign Detail Header Meta - tên chiến dịch, sản phẩm, trạng thái */
.cd-header-meta {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0;
  position: relative;
}

/* Phần campaign name + product name co giãn, chiếm ~3/4 */
.cd-header-info-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 3 1 auto;
  min-width: 0;
  overflow: hidden;
  margin-left: 2px;
}

/* Phần status badge đẩy về phải, chiếm ~1/4 */
.cd-header-status-group {
  flex: 1 0 auto;
  display: flex;
  justify-content: flex-end;
  padding-right: 4px;
}

.cd-header-campaign,
.cd-header-product {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: none;
  flex: 0 1 auto;
}

.cd-header-campaign {
  flex-shrink: 1;
  min-width: 40px;
}

.cd-header-product {
  flex: 1 1 auto;
  min-width: 40px;
}

.cd-header-sep {
  color: rgba(255, 255, 255, 0.4);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Status badge trong header - dùng màu gốc theo từng trạng thái từ status-badge.css */
.cd-header-meta .status-badge {
  font-size: 11px;
  padding: 2px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.page-header-main {
  flex: 1 1 auto;
  min-width: 0;
}

.page-header-actions {
  flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .page-header {
    padding: 0 16px;
    gap: 8px;
    min-height: 48px;
  }

  .page-header-main {
    flex: 1 1 auto;
    min-width: 0;
  }

  .page-header-text {
    flex: 0 1 auto;
    max-width: none;
    min-width: 0;
  }

  .page-header-meta {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  .page-header h1 {
    font-size: 14px;
  }

  .page-header-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .page-back-btn .page-back-icon {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }

  .page-header-actions {
    margin-left: auto;
  }

  .cd-header-info {
    gap: 10px;
    flex-wrap: wrap;
  }

  .cd-header-value {
    max-width: 120px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .page-header {
    padding: 0 12px;
    gap: 6px;
    min-height: 44px;
    right: 12px;
  }

  .page-header h1 {
    font-size: 13px;
  }

  .page-header-icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .page-header-main {
    gap: 6px;
  }
}