/* Our Experts Page Styles */

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Header Section */
.experts-header {
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(30, 60, 114, 0.8) 0%,
    rgba(42, 82, 152, 0.8) 100%
  );
  background-image: url("../imgs/our-experts-bg.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  padding: 80px 0;
  text-align: center;
  overflow: hidden;
  min-height: 60vh; /* Dynamic height based on viewport */
  max-height: 85vh; /* Prevent excessive height on large screens */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw; /* Full viewport width */
  margin-left: calc(-50vw + 50%); /* Break out of container for full width */
  aspect-ratio: 21/9; /* Wider aspect ratio to reduce white space */
}

/* Fallback for browsers that don't support WebP */
@supports not (background-image: url("../imgs/bg-expert-default.webp")) {
  .experts-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  }
}

/* Fallback for browsers that don't support aspect-ratio */
@supports not (aspect-ratio: 16/9) {
  .experts-header {
    height: 60vh; /* Fallback height for older browsers */
    width: 100vw; /* Full viewport width */
    margin-left: calc(-50vw + 50%); /* Break out of container for full width */
  }

  @media (max-width: 768px) {
    .experts-header {
      height: 50vh;
      width: 100vw; /* Full viewport width */
      margin-left: calc(
        -50vw + 50%
      ); /* Break out of container for full width */
    }
  }

  @media (max-width: 480px) {
    .experts-header {
      height: 40vh;
      width: 100vw; /* Full viewport width */
      margin-left: calc(
        -50vw + 50%
      ); /* Break out of container for full width */
    }
  }
}

.experts-header-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

.experts-title {
  font-size: 4rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 2px;
}

.experts-subtitle {
  font-size: 1.2rem;
  color: #ffffff;
  font-weight: 300;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.experts-profile-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  opacity: 0.3;
}

.experts-profile-overlay::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  border-radius: 50%;
}

/* Our Experts Section */
.our-experts {
  padding: 80px;
  background-color: #f8f6f0;
}

/* Experts Grid - 4 columns per row */
.experts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 60px;
}

.expert-item {
  background: transparent;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  min-height: 400px;
  padding: 16px 0;
}

.expert-item:hover {
  transform: translateY(-5px);
}

.expert-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.expert-item:hover::before {
  transform: scaleX(1);
}

.expert-avatar {
  margin-bottom: 20px;
  position: relative;
}

.expert-avatar img {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ecf0f1;
  transition: all 0.3s ease;
}

.expert-name {
  color: #000;
  transition: all 0.3s ease;
}

.expert-item:hover .expert-name {
  color: #000;
  text-decoration: underline;
}

.expert-title {
  color: #d4af37;
  margin-bottom: 0;
  font-weight: 600;
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0px;
  text-align: center;
}

.expert-details {
  position: absolute;
  top: 25%;
  left: 0;
  right: 0;
  height: 100%;
  background: #ffffff;
  max-height: 300px;
  opacity: 1;
  padding: 20px;
  border-top-left-radius: 40px;
  border-bottom-right-radius: 40px;
  z-index: 10;
  animation: fadeIn 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Detailed content styling for hover state - Figma Design */
.expert-details-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.expert-details-content h4 {
  font-size: 22px;
  font-weight: 800;
  color: #010101;
  margin-bottom: 8px;
  text-align: center;
  line-height: 32px;
  letter-spacing: 0;
}

.expert-details-content .expert-title-detail {
  font-size: 12px;
  color: #b88917;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
  line-height: 18px;
  letter-spacing: 0;
}

.expert-details-content .expert-bio {
  font-size: 14px;
  color: #7d7e78;
  line-height: 22px;
  margin-bottom: 20px;
  text-align: left;
  letter-spacing: -0.2px;
  font-weight: 400;
  max-height: 177px;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: #b88917 #f1f1f1;
}

/* Custom scrollbar for webkit browsers */
.expert-details-content .expert-bio::-webkit-scrollbar {
  width: 6px;
}

.expert-details-content .expert-bio::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.expert-details-content .expert-bio::-webkit-scrollbar-thumb {
  background: #b88917;
  border-radius: 3px;
}

.expert-details-content .expert-bio::-webkit-scrollbar-thumb:hover {
  background: #a07815;
}

.expert-details-content .expert-signature {
  margin-top: auto;
  text-align: right;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Pagination */
.experts-pagination {
  display: flex;
  justify-content: center;
  margin-top: 60px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #ffffff;
  border: 2px solid #ecf0f1;
  border-radius: 50%;
  color: #7f8c8d;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

.pagination-btn:hover {
  background: #b88917;
  border-color: #b88917;
  color: #ffffff;
  transform: scale(1.1);
}

.pagination-numbers {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
}

.pagination-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: #7f8c8d;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

.pagination-number:hover {
  background: #b88917;
  border-color: #b88917;
  color: #ffffff;
  transform: scale(1.1);
}

.pagination-number.active {
  background: #b88917;
  border-color: #b88917;
  color: #ffffff;
}

.pagination-ellipsis {
  color: #bdc3c7;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 0 5px;
}

/* No Experts State */
.no-experts {
  text-align: center;
  padding: 80px 20px;
  color: #7f8c8d;
  font-size: 1.1rem;
}

.expert-details-content a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .experts-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
  }
}

@media (max-width: 768px) {
  .experts-header {
    min-height: 50vh;
    max-height: 70vh;
    width: 100vw; /* Full viewport width */
    margin-left: calc(-50vw + 50%); /* Break out of container for full width */
    aspect-ratio: 16/6; /* Wider aspect ratio for mobile to reduce white space */
  }

  .experts-title {
    font-size: 2.5rem;
  }

  .experts-subtitle {
    font-size: 1rem;
    letter-spacing: 2px;
  }

  .section-title {
    font-size: 2rem;
    margin-bottom: 40px;
  }

  .experts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .expert-item {
    padding: 15px 5px;
  }

  .expert-avatar img {
    width: 100px;
    height: 100px;
  }

  .expert-name {
    font-size: 1.2rem;
  }

  .expert-title {
    font-size: 0.9rem;
  }

  .pagination-controls {
    flex-wrap: wrap;
    gap: 5px;
  }

  .pagination-numbers {
    margin: 0 10px;
  }

  .pagination-number,
  .pagination-btn {
    width: 35px;
    height: 35px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .experts-header {
    padding: 60px 0;
    min-height: 25vh;
    max-height: 60vh;
    width: 100vw; /* Full viewport width */
    margin-left: calc(-50vw + 50%); /* Break out of container for full width */
    aspect-ratio: 16/8; /* Wide aspect ratio for small mobile screens to reduce white space */
  }

  .experts-title {
    font-size: 2rem;
  }

  .our-experts {
    padding: 60px 0;
  }

  .experts-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .expert-item {
    padding: 15px 5px;
  }

  .expert-avatar img {
    width: 80px;
    height: 80px;
  }

  .pagination-numbers {
    gap: 3px;
  }

  .pagination-number,
  .pagination-btn {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }
}

/* Loading Animation */
.expert-item.loading {
  opacity: 0.7;
  pointer-events: none;
}

.expert-item.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid #ecf0f1;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Accessibility */
.expert-item:focus {
  outline: 3px solid #3498db;
  outline-offset: 2px;
}

.pagination-btn:focus,
.pagination-number:focus {
  outline: 3px solid #3498db;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .experts-header {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .experts-title,
  .experts-subtitle {
    color: #000000 !important;
  }

  .expert-item {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .pagination-controls {
    display: none;
  }
}

.yl-tribe-info {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  background: #f8f3ed;
  padding: 14px 10px;
  margin-top: 16px;
  max-width: 520px;
}

.yl-tribe-info-text {
  font-size: 12px;
  line-height: 18px;
  color: #4e4e43;
}

.tribe-code-display {
  display: flex;
  align-items: center;
  background: #f8f3ed;
  border: 1px solid #f8f3ed;
  padding: 12px 16px;
  margin-bottom: 20px;
  gap: 12px;
}

.tribe-code-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tribe-code-content {
  flex: 1;
}

.tribe-code-label {
  font-size: 12px;
  color: #4e4e43;
  font-weight: 500;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tribe-code-value {
  font-size: 16px;
  font-weight: 600;
  color: #4e4e43;
  letter-spacing: 1px;
}
