/* ===============================
   UNIFIED PAGE HEADERS - Jinan University
   Consistent styling for all page types
   =============================== */

/* Base Page Header Container */
.unified-page-header {
  margin-bottom: var(--space-3xl, 3rem);
  padding-top: var(--space-lg, 1.5rem);
}

/* Page Title Container */
.unified-page-title-container {
  position: relative;
}

/* Main Page Title */
.unified-page-title {
  font-family: var(--font-headings, "Lato", "Droid Arabic Kufi", sans-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--jinan-teal, #316667);
  margin-bottom: var(--space-lg, 1.5rem);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: var(--space-md, 1rem);
}

/* Page Title Icon */
.unified-page-icon {
  color: var(--jinan-gold, #cd9933);
  font-size: 0.9em;
  margin-right: var(--space-sm, 0.5rem);
  flex-shrink: 0;
}

/* RTL Support for Icons */
html[lang="ar"] .unified-page-icon,
html[data-lang="ar"] .unified-page-icon {
  margin-right: 0;
  margin-left: var(--space-sm, 0.5rem);
}

/* Page Title Text */
.unified-page-title-text {
  flex: 1;
  line-height: inherit;
}

/* Page Subtitle */
.unified-page-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted, #6c757d);
  margin-bottom: var(--space-xl, 2rem);
  line-height: 1.6;
  max-width: 800px;
}

/* Subtitle alignment inheritance */
.unified-page-subtitle.text-start {
  margin-left: 0;
  margin-right: auto;
}

.unified-page-subtitle.text-center {
  margin-left: auto;
  margin-right: auto;
}

.unified-page-subtitle.text-end {
  margin-left: auto;
  margin-right: 0;
}

/* Page Divider */
.unified-page-divider {
  border: none;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--jinan-teal, #316667) 0%,
    var(--jinan-gold, #cd9933) 100%
  );
  border-radius: var(--border-radius, 4px);
  margin: var(--space-xl, 2rem) 0 var(--space-3xl, 3rem) 0;
  width: 80px;
  position: relative;
  overflow: hidden;
}

/* Animated divider effect */
.unified-page-divider::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Divider alignment based on text alignment */
.text-start .unified-page-divider {
  margin-left: 0;
  margin-right: auto;
}

.text-center .unified-page-divider {
  margin-left: auto;
  margin-right: auto;
  width: 120px;
}

.text-end .unified-page-divider {
  margin-left: auto;
  margin-right: 0;
}

/* ===============================
   HERO PAGE HEADER VARIANT
   For special pages like news
   =============================== */

.unified-page-header-hero {
  background: linear-gradient(
    135deg,
    var(--jinan-teal, #316667) 0%,
    var(--jinan-teal-hover, #2a5758) 100%
  );
  color: var(--white, #ffffff);
  padding: var(--space-3xl, 3rem) 0;
  margin-bottom: 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.unified-page-header-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.03)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.03)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.03)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

.unified-page-title-hero {
  color: var(--white, #ffffff);
  font-size: 3rem;
  margin-bottom: var(--space-lg, 1.5rem);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

.unified-page-header-hero .unified-page-icon {
  color: var(--jinan-gold, #cd9933);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.unified-page-header-hero .unified-page-subtitle {
  color: rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 1;
}

/* ===============================
   BREADCRUMB NAVIGATION
   =============================== */

.unified-breadcrumb {
  margin-bottom: var(--space-lg, 1.5rem);
}

.unified-breadcrumb .breadcrumb {
  background: transparent;
  padding: var(--space-sm, 0.5rem) 0;
  margin: 0;
  font-size: 0.9rem;
}

.unified-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  color: var(--jinan-teal, #316667);
  content: "›";
  font-weight: 600;
}

.unified-breadcrumb .breadcrumb-item a {
  color: var(--jinan-teal, #316667);
  text-decoration: none;
  transition: var(--transition-standard, all 0.25s ease);
}

.unified-breadcrumb .breadcrumb-item a:hover {
  color: var(--jinan-gold, #cd9933);
  text-decoration: underline;
}

.unified-breadcrumb .breadcrumb-item.active {
  color: var(--text-muted, #6c757d);
}

/* ===============================
   RESPONSIVE DESIGN
   =============================== */

@media (max-width: 768px) {
  .unified-page-title {
    font-size: 2rem;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm, 0.5rem);
  }

  .unified-page-title.text-center {
    align-items: center;
  }

  .unified-page-title.text-end {
    align-items: flex-end;
  }

  .unified-page-title-hero {
    font-size: 2.25rem;
  }

  .unified-page-subtitle {
    font-size: 1rem;
  }

  .unified-page-header-hero {
    padding: var(--space-xl, 2rem) 0;
  }

  .unified-page-divider {
    width: 60px;
  }

  .text-center .unified-page-divider {
    width: 80px;
  }
}

@media (max-width: 480px) {
  .unified-page-title {
    font-size: 1.75rem;
  }

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

  .unified-page-header {
    margin-bottom: var(--space-xl, 2rem);
  }
}

/* ===============================
   ACCESSIBILITY ENHANCEMENTS
   =============================== */

.unified-page-title:focus-visible {
  outline: 2px solid var(--jinan-gold, #cd9933);
  outline-offset: 4px;
}

.unified-breadcrumb .breadcrumb-item a:focus-visible {
  outline: 2px solid var(--jinan-gold, #cd9933);
  outline-offset: 2px;
  border-radius: var(--border-radius, 4px);
}

/* ===============================
   PRINT STYLES
   =============================== */

@media print {
  .unified-page-header-hero {
    background: none !important;
    color: black !important;
    padding: var(--space-lg, 1.5rem) 0 !important;
  }

  .unified-page-title,
  .unified-page-title-hero {
    color: black !important;
    text-shadow: none !important;
  }

  .unified-page-divider {
    background: #333 !important;
  }

  .unified-breadcrumb {
    display: none;
  }
}

/* ===============================
   LEGACY COMPATIBILITY
   Maintain backward compatibility
   =============================== */

/* Map old classes to new unified system */
.main-page-title {
  @extend .unified-page-title;
}

.main-title-divider {
  @extend .unified-page-divider;
}

.majors-page-title {
  @extend .unified-page-title;
}

.majors-title-divider {
  @extend .unified-page-divider;
}

.news-title {
  @extend .unified-page-title-hero;
}

.publications-title {
  @extend .unified-page-title;
}

.publications-subtitle {
  @extend .unified-page-subtitle;
}

/* Legacy support for pages still using old classes */
.main-page-title,
.majors-page-title,
.news-title,
.publications-title,
.page-title {
  font-family: var(--font-headings, "Lato", "Droid Arabic Kufi", sans-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--jinan-teal, #316667);
  margin-bottom: var(--space-lg, 1.5rem);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: var(--space-md, 1rem);
}

.main-title-divider,
.majors-title-divider,
.title-divider {
  border: none;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--jinan-teal, #316667) 0%,
    var(--jinan-gold, #cd9933) 100%
  );
  border-radius: var(--border-radius, 4px);
  margin: var(--space-xl, 2rem) 0 var(--space-3xl, 3rem) 0;
  width: 80px;
}