
.dtm-team-card {
  position: relative;
  overflow: hidden;
}

.dtm-dark-overlay {
  position: absolute;
  inset: 0;
  background: black;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.dtm-hover-overlay {
  position: relative;
  z-index: 2;
}

/* Team Members Frontend Styles - Enhanced Responsive Design */
.dtm-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(12px, 2.5vw, 24px);
  padding: clamp(10px, 3vw, 30px);
  margin: 0 auto;
  max-width: 1400px;
  width: 100%;
}

.dtm-team-card {
  border-radius: clamp(8px, 1.2vw, 16px);
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  min-height: 400px;
}

.dtm-team-card:hover {
  transform: translateY(-8px);
}

.dtm-card-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dtm-image-container {
  position: relative;
  width: 100%;
  height: clamp(250px, 35vw, 350px);
  overflow: hidden;
  background: transparent;
}

.dtm-member-image {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  transition: all 0.4s ease;
  display: block;
}

.dtm-placeholder-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
  color: #666;
}

.dtm-placeholder-icon {
  font-size: clamp(32px, 5vw, 48px);
  opacity: 0.5;
}

/* Hover overlay - NO black background, just text over blurred image */
.dtm-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.4s ease;
  padding: clamp(8px, 2vw, 16px);
  z-index: 2;
}

.dtm-team-card:hover .dtm-member-image {
  filter: blur(6px);
  transform: scale(1.02);
}

.dtm-team-card:hover .dtm-hover-overlay {
  opacity: 1;
}

/* Hover text - Better text management */
.dtm-hover-text {
  color: #ffffff;
  text-align: left;
  font-size: clamp(12px, 1.4vw, 16px);
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: 0.3px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  max-height: 100%;
  overflow: hidden;
  padding: clamp(4px, 1vw, 8px);
  word-wrap: break-word;
  hyphens: auto;
  font-family: 'Inter' !important;
}

/* Member info section - Transparent section BELOW image */
.dtm-member-info-section {
  background: transparent;
  padding: clamp(8px, 1.5vw, 20px) clamp(4px, 1vw, 8px) clamp(12px, 2vw, 24px) 0;
  min-height: clamp(60px, 8vw, 90px);
  display: flex;
  align-items: center;
}

.dtm-member-details {
  width: 100%;
  text-align: left;
}

.dtm-member-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  gap: clamp(8px, 1.5vw, 16px);
}

.dtm-member-name {
  color: #ffffff;
  font-size: clamp(14px, 1.8vw, 20px);
  font-weight: 500;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: clamp(0.5px, 0.1vw, 1.2px);
  line-height: 1.3;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  font-family: Inter !important;
}

.dtm-member-flag {
  width: clamp(24px, 4vw, 48px);
  height: clamp(14px, 2.4vw, 28px);
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.dtm-member-position {
  color: #cccccc;
  font-size: clamp(11px, 1.3vw, 15px);
  margin: 0;
  font-weight: 400;
  line-height: 1.4;
  max-width: 80%;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  font-family: 'Inter';
  position: relative;
  top: -2px;
}

/* Remove the old overlay styles */
.dtm-member-info-overlay {
  display: none;
}

/* No members message */
.dtm-no-members {
  text-align: center;
  padding: clamp(20px, 4vw, 50px) clamp(15px, 3vw, 30px);
  color: #666;
  font-size: clamp(14px, 1.6vw, 18px);
  background: #f9f9f9;
  border-radius: clamp(6px, 1vw, 12px);
  border: 2px dashed #ddd;
}

/* Enhanced Responsive Breakpoints */

/* Extra Large Screens (1440px and above) */
@media (min-width: 1440px) {
  .dtm-team-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1600px;
  }
}

/* Large Screens (1200px - 1439px) */
@media (min-width: 1200px) and (max-width: 1439px) {
  .dtm-team-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 100%;
  }
}

/* Medium-Large Screens (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  .dtm-team-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .dtm-image-container {
    height: clamp(280px, 32vw, 320px);
  }
}

/* Medium Screens (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  .dtm-team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(15px, 2vw, 20px);
  }
  
  .dtm-image-container {
    height: clamp(250px, 35vw, 300px);
  }
  
  .dtm-member-info-section {
    min-height: clamp(65px, 8vw, 80px);
  }
}

/* Small-Medium Screens (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
  .dtm-team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(12px, 2vw, 18px);
  }
  
  .dtm-image-container {
    height: clamp(220px, 40vw, 280px);
  }
  
  .dtm-hover-text {
    -webkit-line-clamp: 5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }
}

/* Small Screens (480px - 575px) */
@media (min-width: 480px) and (max-width: 575px) {
  .dtm-team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(10px, 2vw, 15px);
  }
  
  .dtm-image-container {
    height: clamp(200px, 42vw, 260px);
  }
  
  .dtm-member-info-section {
    min-height: clamp(60px, 10vw, 75px);
  }
}

/* Extra Small Screens (320px - 479px) */
@media (max-width: 479px) {
  .dtm-team-grid {
    grid-template-columns: 1fr;
    gap: clamp(8px, 2vw, 12px);
    padding: clamp(8px, 2vw, 15px);
  }
  
  .dtm-image-container {
    height: clamp(240px, 50vw, 320px);
  }
  
  .dtm-hover-text {
    -webkit-line-clamp: 4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    padding: clamp(15px, 4vw, 25px);
  }
  
  .dtm-member-info-section {
    min-height: clamp(55px, 12vw, 70px);
  }
  
  .dtm-member-name {
    letter-spacing: clamp(0.3px, 0.08vw, 0.8px);
  }
}

/* Ultra Small Screens (below 320px) */
@media (max-width: 319px) {
  .dtm-team-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 5px;
  }
  
  .dtm-image-container {
    height: 200px;
  }
  
  .dtm-member-name {
    font-size: 12px;
    letter-spacing: 0.2px;
  }
  
  .dtm-member-position {
    font-size: 10px;
  }
  
  .dtm-hover-text {
    font-size: 11px;
    padding: 10px;
  }
  
  .dtm-member-flag {
    width: 20px;
    height: 12px;
  }
}

/* Custom columns support with enhanced responsiveness */
.dtm-team-grid[data-columns="1"] {
  grid-template-columns: 1fr;
}

.dtm-team-grid[data-columns="2"] {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  max-width: 800px;
}

.dtm-team-grid[data-columns="3"] {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.dtm-team-grid[data-columns="5"] {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.dtm-team-grid[data-columns="6"] {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Responsive behavior for custom columns */
@media (max-width: 1200px) {
  .dtm-team-grid[data-columns="5"],
  .dtm-team-grid[data-columns="6"] {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

@media (max-width: 768px) {
  .dtm-team-grid[data-columns="3"],
  .dtm-team-grid[data-columns="4"],
  .dtm-team-grid[data-columns="5"],
  .dtm-team-grid[data-columns="6"] {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 576px) {
  .dtm-team-grid[data-columns="2"],
  .dtm-team-grid[data-columns="3"],
  .dtm-team-grid[data-columns="4"],
  .dtm-team-grid[data-columns="5"],
  .dtm-team-grid[data-columns="6"] {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 480px) {
  .dtm-team-grid[data-columns="2"],
  .dtm-team-grid[data-columns="3"],
  .dtm-team-grid[data-columns="4"],
  .dtm-team-grid[data-columns="5"],
  .dtm-team-grid[data-columns="6"] {
    grid-template-columns: 1fr;
  }
}

/* Animation on load */
.dtm-team-card {
  animation: dtmFadeInUp 0.6s ease forwards;
  opacity: 0;
  transform: translateY(30px);
}

.dtm-team-card:nth-child(1) { animation-delay: 0.1s; }
.dtm-team-card:nth-child(2) { animation-delay: 0.2s; }
.dtm-team-card:nth-child(3) { animation-delay: 0.3s; }
.dtm-team-card:nth-child(4) { animation-delay: 0.4s; }
.dtm-team-card:nth-child(5) { animation-delay: 0.5s; }
.dtm-team-card:nth-child(6) { animation-delay: 0.6s; }
.dtm-team-card:nth-child(7) { animation-delay: 0.7s; }
.dtm-team-card:nth-child(8) { animation-delay: 0.8s; }

@keyframes dtmFadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Container Query Support (for modern browsers) */
@supports (container-type: inline-size) {
  .dtm-team-grid {
    container-type: inline-size;
  }
  
  @container (max-width: 600px) {
    .dtm-team-card {
      min-height: 350px;
    }
    
    .dtm-member-name {
      font-size: 14px;
    }
    
    .dtm-member-position {
      font-size: 11px;
    }
  }
}

/* Accessibility */
/*.dtm-team-card:focus-within {*/
/*  outline: 3px solid #007cba;*/
/*  outline-offset: 2px;*/
/*}*/

.dtm-hover-overlay {
  pointer-events: none;
}

/* Touch device enhancements */
@media (hover: none) and (pointer: coarse) {
  .dtm-team-card.touch-active .dtm-member-image {
    filter: blur(6px);
    transform: scale(1.02);
  }

  .dtm-team-card.touch-active .dtm-hover-overlay {
    opacity: 1;
  }
  
  /* Larger touch targets on mobile */
  .dtm-team-card {
    padding: 2px;
  }
}

/* Landscape orientation adjustments for mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .dtm-image-container {
    height: clamp(180px, 30vh, 250px);
  }
  
  .dtm-member-info-section {
    min-height: 50px;
    padding: 8px 4px 12px 0;
  }
}

/* High DPI/Retina display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .dtm-member-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Print styles */
@media print {
  .dtm-team-grid {
    display: block;
    gap: 0;
    padding: 0;
  }

  .dtm-team-card {
    break-inside: avoid;
    margin-bottom: 20px;
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
    min-height: auto;
  }

  .dtm-hover-overlay {
    display: none;
  }

  .dtm-member-image {
    filter: none !important;
    transform: none !important;
    height: 200px !important;
  }

  .dtm-member-info-overlay {
    background: white;
    color: black;
    position: static;
  }

  .dtm-member-name,
  .dtm-member-position {
    color: black;
    text-shadow: none;
  }
  
  .dtm-image-container {
    height: 200px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .dtm-team-card {
    border: 2px solid #fff;
  }

  .dtm-member-name,
  .dtm-member-position {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 1);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .dtm-team-card,
  .dtm-member-image,
  .dtm-hover-overlay {
    transition: none;
  }

  .dtm-team-card {
    animation: none;
    opacity: 1;
    transform: none;
  }
  
  .dtm-team-card:hover {
    transform: none;
  }
  
  .dtm-team-card:hover .dtm-member-image {
    transform: none;
  }
}