@use '../globals';
@use '../variables' as *;
@use '../mixins' as *;

.certifications-section {
  background: var(--certifications-background);
  position: relative;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
      90deg,
      transparent 0%,
      var(--color-primary) 30%,
      var(--color-secondary) 70%,
      transparent 100%
    );
  }

  &__container {
    @include section-container;
  }

  &__header {
    @include section-header;
  }

  &__title {
    @include section-title;
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 800;
  }

  &__subtitle {
    @include section-subtitle;
  }

  &__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 425px), 1fr));
    gap: 2rem;

    @media (min-width: 900px) and (max-width: 1799px) {
      grid-template-columns: repeat(2, 1fr);
    }

    @media (min-width: 1200px) {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  &__card {
    text-align: center;
    border: none;
    border-radius: $card-border-radius-md;
    box-shadow: var(--certifications-card-shadow);
    background: var(--certifications-card-background);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem 1rem;
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;

    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: var(--certifications-card-overlay);
      opacity: 0;
      transition: opacity 0.3s ease;
      pointer-events: none;
    }

    &:hover {
      transform: translateY(-4px) scale(1.02);
      box-shadow: var(--shadow-glow-hover);

      &::before {
        opacity: 1;
      }
    }
  }

  &__card-header {
    margin-bottom: 1em;
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  &__card-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 0.75rem;
    color: var(--color-certifications-primary);
    display: block;
    flex-shrink: 0;
  }

  &__card-icon-image {
    height: 4rem;
    width: 4rem;
    object-fit: contain;
    margin: 0 auto 0.75rem;
    display: block;
    flex-shrink: 0;
  }

  &__card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: $color-heading;
    margin-bottom: 0.5rem;
    line-height: 1.4;
  }

  &__card-issuer {
    color: var(--color-text-muted);
    font-size: 0.875rem;
  }

  &__card-content {
    position: relative;
    z-index: 1;
  }

  &__card-badge {
    display: inline-block;
    background: var(--certifications-badge-background);
    color: var(--color-certifications-badge-text);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--certifications-badge-border);
  }

  // Responsive adjustments
  @include globals.mobile-only {
    &__card {
      padding: 1.25rem 1rem;
    }

    &__card-icon,
    &__card-icon-image {
      width: 3rem;
      height: 3rem;
      margin-bottom: 0.5rem;
    }

    &__card-title {
      font-size: 1rem;
    }
  }
}
