/**
 * PEC Department Pages - Sticky Sidebar Navigation
 * 4-column sidebar, 8-column content area
 */

/* ========== DEPARTMENT PAGE HEADER (uses breadcrumb hero) ========== */
.pec-page-hero-subtitle {
  font-size: 1.125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin: 0.75rem 0 0 0;
  line-height: 1.4;
}

/* ========== DEPARTMENT CONTENT AREA ========== */
.pec-department-content {
  padding: 60px 0;
  background: #fff;
  position: relative;
}

/* ========== SIDEBAR NAVIGATION (4 columns) ========== */
.pec-department-sidebar {
  position: relative;
}

.pec-department-nav {
  background: #fff;
  border-radius: var(--pec-radius, 16px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 0;
  position: relative;
  z-index: 100;
  display: block;
  width: 100%;
}

.pec-department-nav-heading {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--pec-black, #1a1a1a);
  margin: 0;
  padding: 24px 24px 16px 24px;
  border-bottom: 2px solid rgba(190, 0, 0, 0.1);
  background: #fff;
  z-index: 10;
  border-radius: var(--pec-radius, 16px) var(--pec-radius, 16px) 0 0;
}

/* Removed custom scrollbar styles since we're not using overflow-y anymore */

.pec-department-nav-list {
  list-style: none;
  padding: 8px 0 24px 0;
  margin: 0;
}

.pec-department-nav-list li {
  margin: 0;
  padding: 0;
}

.pec-department-nav-link {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: var(--pec-black, #1a1a1a);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  position: relative;
  gap: 10px;
}

.pec-department-nav-link i {
  font-size: 0.75rem;
  color: var(--pec-red, #be0000);
  opacity: 0.6;
  transition: all 0.3s ease;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.pec-department-nav-link:hover {
  color: var(--pec-red, #be0000);
  background: rgba(190, 0, 0, 0.05);
  border-left-color: var(--pec-red, #be0000);
  padding-left: 28px;
}

.pec-department-nav-link:hover i {
  opacity: 1;
  transform: translateX(3px);
}

.pec-department-nav-link.active {
  color: var(--pec-red, #be0000);
  background: rgba(190, 0, 0, 0.08);
  border-left-color: var(--pec-red, #be0000);
  font-weight: 600;
}

.pec-department-nav-link.active i {
  opacity: 1;
  color: var(--pec-red, #be0000);
}

.pec-department-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--pec-red, #be0000);
}

/* ========== MAIN CONTENT AREA (8 columns) ========== */
.pec-department-main-content {
  background: #fff;
  position: relative;
  min-height: 400px; /* Ensure content area has minimum height */
}

/* ========== TAB CONTENT SYSTEM ========== */
.pec-tab-content-wrapper {
  position: relative;
  width: 100%;
}

.pec-tab-content {
  display: none;
  opacity: 0;
  animation: fadeOut 0.3s ease-out forwards;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.pec-tab-content.active {
  display: block;
  opacity: 1;
  animation: fadeIn 0.4s ease-in forwards;
  margin-bottom: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid #e8e8e8;
}

/* Smooth fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Smooth fade-out animation */
@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Ensure active tab content maintains section styling */
.pec-tab-content.active.pec-department-section {
  scroll-margin-top: 100px; /* Offset for header */
}

.pec-department-section {
  margin-bottom: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid #e8e8e8;
  scroll-margin-top: 100px; /* Offset for header */
}

/* Alternate sections with card styling - only apply to active tab content */
.pec-tab-content.active.pec-department-section:nth-child(even),
.pec-department-section:nth-child(even) {
  background: rgba(190, 0, 0, 0.0625); /* 25% more opacity than nav hover (0.05 * 1.25 = 0.0625) */
  border: 1px solid rgba(190, 0, 0, 0.15); /* Light red border */
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 40px 32px;
  margin-bottom: 60px;
  border-bottom: 1px solid rgba(190, 0, 0, 0.15); /* Override default border-bottom */
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.pec-department-section:nth-child(even):hover {
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.pec-department-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* If last section is even, remove bottom margin */
.pec-department-section:nth-child(even):last-child {
  margin-bottom: 0;
}

/* Section title font size - decreased by 4px */
.pec-department-section .pec-section-title {
  font-size: clamp(1.5rem, 4vw, 2rem); /* Decreased by 4px from default (1.75rem to 1.5rem, 2.25rem to 2rem) */
}

.pec-department-section-content {
  margin-top: 24px;
  line-height: 1.8;
  color: #333;
}

.pec-department-section-content p {
  margin-bottom: 16px;
  font-size: 1rem;
}

.pec-department-section-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--pec-black, #1a1a1a);
  margin-top: 32px;
  margin-bottom: 16px;
}

.pec-department-section-content h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--pec-black, #1a1a1a);
  margin-top: 24px;
  margin-bottom: 12px;
}

.pec-department-section-content ul,
.pec-department-section-content ol {
  margin: 16px 0;
  padding-left: 24px;
}

.pec-department-section-content ul li,
.pec-department-section-content ol li {
  margin-bottom: 8px;
  line-height: 1.7;
}

/* ========== DEPARTMENT BUTTON STYLING ========== */
.pec-department-button-wrap {
  margin-top: 16px;
  margin-bottom: 16px;
}

.pec-department-button-wrap:first-child {
  margin-top: 0;
}

.pec-department-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--pec-red, #be0000);
  color: #fff;
  text-decoration: none;
  border-radius: var(--pec-radius, 16px);
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid var(--pec-red, #be0000);
  box-shadow: 0 2px 8px rgba(190, 0, 0, 0.2);
}

.pec-department-btn i {
  font-size: 1.125rem;
}

.pec-department-btn:hover {
  background: var(--pec-black, #1a1a1a);
  border-color: var(--pec-black, #1a1a1a);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.pec-department-btn:active {
  transform: translateY(0);
}

/* ========== SYLLABUS BUTTONS (INLINE-BLOCK - DYNAMIC) ========== */
.pec-syllabus-info {
  margin-bottom: 24px;
  color: #666;
  font-size: 1rem;
  line-height: 1.6;
}

.pec-syllabus-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
  align-items: stretch;
}

.pec-syllabus-buttons .pec-department-btn {
  flex: 0 1 auto; /* Don't grow, can shrink, auto basis - maintains natural width */
  min-width: 180px;
  max-width: 100%; /* Prevent buttons from exceeding container */
  justify-content: center;
  text-align: center;
  white-space: nowrap; /* Prevent text wrapping inside button */
}

/* Minutes of Meeting / MOU PDF buttons (matches pec-v4 MOUs.php) */
.pec-minutes-buttons .pec-department-btn {
  flex: 0 1 calc(33.333% - 11px);
  min-width: 180px;
  max-width: 100%;
}

.pec-mou-docs-title {
  margin-top: 2rem;
}

/* Responsive: 2 buttons per row on tablet */
@media (min-width: 768px) and (max-width: 991.98px) {
  .pec-syllabus-buttons .pec-department-btn {
    flex: 0 1 calc(50% - 8px); /* 2 buttons per row with gap */
    min-width: 160px;
  }

  .pec-minutes-buttons .pec-department-btn {
    flex: 0 1 calc(50% - 8px);
  }
}

/* Responsive: Stack on mobile */
@media (max-width: 767.98px) {
  .pec-syllabus-buttons {
    flex-direction: column;
    gap: 12px;
  }

  .pec-syllabus-buttons .pec-department-btn {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
  }
}

/* ========== HOD PROFILE STYLING ========== */
.pec-hod-profile {
  margin-top: 24px;
}

.pec-hod-image-wrap {
  margin-bottom: 24px;
  text-align: center;
}

.pec-hod-image {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  object-fit: cover;
}

.pec-hod-basic-info {
  background: rgba(190, 0, 0, 0.05);
  border: 1px solid rgba(190, 0, 0, 0.15);
  border-radius: 12px;
  padding: 20px;
}

.pec-hod-info-item {
  margin-bottom: 16px;
}

.pec-hod-info-item:last-child {
  margin-bottom: 0;
}

.pec-hod-info-item strong {
  display: block;
  color: var(--pec-red, #be0000);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.pec-hod-info-item p {
  margin: 0;
  color: var(--pec-black, #1a1a1a);
  font-size: 1rem;
  font-weight: 500;
}

.pec-hod-details h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--pec-black, #1a1a1a);
  margin-top: 32px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(190, 0, 0, 0.2);
}

.pec-hod-details h3:first-child {
  margin-top: 0;
}

.pec-hod-details h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--pec-black, #1a1a1a);
  margin-top: 20px;
  margin-bottom: 12px;
}

.pec-hod-details ul {
  margin: 12px 0 24px 0;
  padding-left: 24px;
}

.pec-hod-details ul li {
  margin-bottom: 10px;
  line-height: 1.7;
  color: #333;
}

.pec-hod-details p {
  margin-bottom: 24px;
  line-height: 1.8;
  color: #333;
}

/* Responsive adjustments for HOD profile */
@media (max-width: 767.98px) {
  .pec-hod-image {
    max-width: 240px;
  }

  .pec-hod-basic-info {
    margin-top: 20px;
  }

  .pec-hod-details h3 {
    font-size: 1.25rem;
    margin-top: 24px;
  }
}

/* ========== CERTIFICATION YEAR HEADINGS ========== */
.pec-certification-year {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pec-red, #be0000);
  margin-top: 48px;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(190, 0, 0, 0.2);
}

.pec-certification-year:first-of-type {
  margin-top: 32px;
}

.pec-department-section-content > h3:first-child {
  margin-top: 0;
}

/* ========== FACILITIES IMAGES STYLING ========== */
.pec-facilities-images {
  margin-top: 32px;
}

.pec-facility-image-item {
  text-align: center;
  margin-bottom: 24px;
}

.pec-facility-image {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  object-fit: cover;
}

.pec-facility-image:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.pec-facility-image-name {
  margin-top: 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--pec-black, #1a1a1a);
  text-align: center;
  letter-spacing: 0.5px;
}

@media (max-width: 767.98px) {
  .pec-facility-image-item {
    margin-bottom: 32px;
  }

  .pec-facility-image-name {
    font-size: 0.9375rem;
  }
}

/* ========== RESPONSIVE DESIGN ========== */

/* Tablet and below: Sidebar above content */
@media (max-width: 991.98px) {
  .pec-department-nav {
    margin-bottom: 40px;
  }

  .pec-department-section {
    scroll-margin-top: 20px;
  }

  .pec-department-content {
    padding: 40px 0;
  }
}

/* Mobile: Adjust padding */
@media (max-width: 767.98px) {
  .pec-department-nav {
    border-radius: 12px;
  }

  .pec-department-nav-heading {
    padding: 20px 20px 12px 20px;
    font-size: 1rem;
    border-radius: 12px 12px 0 0;
  }

  .pec-department-nav-link {
    padding: 10px 20px;
    font-size: 0.875rem;
    gap: 8px;
  }

  .pec-department-nav-link i {
    font-size: 0.6875rem;
    width: 14px;
  }

  .pec-department-nav-link:hover {
    padding-left: 24px;
  }

  .pec-tab-content {
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .pec-tab-content.active {
    margin-bottom: 40px;
    padding-bottom: 30px;
  }

  .pec-department-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
  }

  .pec-tab-content.active.pec-department-section:nth-child(even),
  .pec-department-section:nth-child(even) {
    padding: 30px 20px;
    border-radius: 12px;
    margin-bottom: 40px;
  }

  .pec-department-section-content {
    margin-top: 20px;
  }
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Tab navigation accessibility */
.pec-department-nav-link[aria-selected="true"] {
  color: var(--pec-red, #be0000);
  background: rgba(190, 0, 0, 0.08);
  border-left-color: var(--pec-red, #be0000);
  font-weight: 600;
}

.pec-tab-content[aria-hidden="true"] {
  display: none !important;
}

.pec-tab-content[aria-hidden="false"] {
  display: block;
}

/* Mobile: Ensure tabs work smoothly on small screens */
@media (max-width: 991.98px) {
  .pec-tab-content-wrapper {
    margin-top: 20px;
  }

  .pec-tab-content.active {
    animation: fadeInMobile 0.3s ease-in forwards;
  }

  @keyframes fadeInMobile {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
}
