/* =============================================
   Page Header Component
   ============================================= */

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #a5a5b0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
}

.page-header .subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0;
}

/* Page header with action button layout */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-header .header-left {
  flex: 1;
}

.page-header .header-right {
  margin-left: 16px;
}

/* Simple header (h1 left, subtitle right) */
.page-header > h1 {
  margin: 0;
}

.page-header > .subtitle {
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50%;
}

/* Responsive: stack header on small screens */
@media (max-width: 768px) {
  /* Keep title + subtitle on one row; allow header-right content to wrap below if needed */
  .page-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .page-header > .subtitle {
    max-width: 45%;
  }

  .page-header .header-right {
    width: 100%;
    margin-left: 0;
  }
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-header h1 {
    font-size: 23px;
  }

  .page-header .subtitle {
    font-size: 10px;
  }
}

/* Small phones landscape (short height) */
@media (orientation: landscape) and (max-height: 430px) and (max-width: 900px) {
  .page-header {
    margin-bottom: 14px;
  }

  .page-header h1 {
    font-size: 18px;
    margin-bottom: 4px;
  }

  .page-header .subtitle {
    font-size: 11px;
  }
}

@media (orientation: landscape) and (max-height: 320px) {
  .page-header {
    margin-bottom: 12px;
  }

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

  .page-header .subtitle {
    font-size: 10px;
  }
}

/* Phone portrait (360x740) - specific optimizations */
@media (width: 360px) and (height: 740px) and (orientation: portrait) {
  .page-header {
    margin-bottom: 12px !important;
    gap: 10px !important;
  }

  .page-header h1 {
    font-size: 16px !important;
  }

  .page-header .subtitle {
    font-size: 10px !important;
  }

  .page-header .header-right .btn {
    padding: 8px 12px !important;
    font-size: 11px !important;
  }

  .page-header .header-right .btn svg {
    width: 14px !important;
    height: 14px !important;
  }
}

/* Phone portrait (375x667) - specific optimizations */
@media (width: 375px) and (height: 667px) and (orientation: portrait) {
  .page-header {
    margin-bottom: 12px !important;
    gap: 10px !important;
  }

  .page-header h1 {
    font-size: 17px !important;
  }

  .page-header .subtitle {
    font-size: 11px !important;
  }

  .page-header .header-right .btn {
    padding: 9px 13px !important;
    font-size: 12px !important;
  }
}

/* Phone portrait (375x812) - specific optimizations */
@media (width: 375px) and (height: 812px) and (orientation: portrait) {
  .page-header {
    margin-bottom: 14px !important;
    gap: 12px !important;
  }

  .page-header h1 {
    font-size: 18px !important;
  }

  .page-header .subtitle {
    font-size: 12px !important;
  }
}

/* Phone portrait (380x706) - specific optimizations */
@media (width: 380px) and (height: 706px) and (orientation: portrait) {
  .page-header {
    margin-bottom: 12px !important;
    gap: 10px !important;
  }

  .page-header h1 {
    font-size: 17px !important;
  }

  .page-header .subtitle {
    font-size: 11px !important;
  }
}

/* Phone portrait (380x754) - specific optimizations */
@media (width: 380px) and (height: 754px) and (orientation: portrait) {
  .page-header {
    margin-bottom: 12px !important;
    gap: 10px !important;
  }

  .page-header h1 {
    font-size: 17px !important;
  }

  .page-header .subtitle {
    font-size: 11px !important;
  }
}

/* Phone portrait (380x810) - range-based query */
@media (min-width: 375px) and (max-width: 385px) and (min-height: 750px) and (max-height: 820px) and (orientation: portrait) {
  .page-header {
    margin-bottom: 12px !important;
    gap: 10px !important;
  }

  .page-header h1 {
    font-size: 17px !important;
  }

  .page-header .subtitle {
    font-size: 11px !important;
  }
}

/* Phone portrait (390x844) - specific optimizations */
@media (width: 390px) and (height: 844px) and (orientation: portrait) {
  .page-header {
    margin-bottom: 14px !important;
    gap: 12px !important;
  }

  .page-header h1 {
    font-size: 18px !important;
  }

  .page-header .subtitle {
    font-size: 12px !important;
  }
}

/* Phone portrait (411x823) - specific optimizations */
@media (width: 411px) and (height: 823px) and (orientation: portrait) {
  .page-header {
    margin-bottom: 14px !important;
  }

  .page-header h1 {
    font-size: 19px !important;
  }

  .page-header .subtitle {
    font-size: 12px !important;
  }
}

/* Phone portrait (412x892) - specific optimizations */
@media (width: 412px) and (height: 892px) and (orientation: portrait) {
  .page-header h1 {
    font-size: 20px !important;
  }
}

/* Phone portrait (412x915) - specific optimizations */
@media (width: 412px) and (height: 915px) and (orientation: portrait) {
  .page-header h1 {
    font-size: 20px !important;
  }
}

/* Phone portrait (414x736) - specific optimizations */
@media (width: 414px) and (height: 736px) and (orientation: portrait) {
  .page-header h1 {
    font-size: 19px !important;
  }
}

/* Phone portrait (414x896) - specific optimizations */
@media (width: 414px) and (height: 896px) and (orientation: portrait) {
  .page-header h1 {
    font-size: 20px !important;
  }
}

/* Phone portrait (430x932) - specific optimizations */
@media (width: 430px) and (height: 932px) and (orientation: portrait) {
  .page-header h1 {
    font-size: 20px !important;
  }
}

/* Phone portrait (1080x2400) - specific optimizations */
@media (width: 1080px) and (height: 2400px) and (orientation: portrait) {
  .page-header h1 {
    font-size: 28px !important;
  }

  .page-header .subtitle {
    font-size: 16px !important;
  }
}

/* 1080p width portrait - general rule */
@media (min-width: 1080px) and (orientation: portrait) {
  .page-header h1 {
    font-size: 28px !important;
  }
}

/* Landscape optimizations */
@media (orientation: landscape) and (max-height: 430px) and (max-width: 900px) {
  .page-header {
    margin-bottom: 8px !important;
  }

  .page-header h1 {
    font-size: 16px !important;
  }

  .page-header .subtitle {
    font-size: 10px !important;
  }
}

@media (orientation: landscape) and (max-height: 320px) {
  .page-header h1 {
    font-size: 14px !important;
  }
}

/* Tablet landscape (1024x505) - compact header */
@media (width: 1024px) and (height: 505px) and (orientation: landscape),
       (min-width: 1022px) and (max-width: 1026px) and (min-height: 503px) and (max-height: 507px) and (orientation: landscape) {
  .page-header {
    margin-bottom: 10px !important;
  }

  .page-header h1 {
    font-size: 20px !important;
    margin-bottom: 4px !important;
  }

  .page-header .subtitle {
    font-size: 11px !important;
  }
}
