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

.projects-section {
  background: var(--projects-background);

  &__container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1rem;

    @include globals.desktop-only {
      padding: 0 1.5rem;
    }
  }

  &__header {
    text-align: center;
    margin-bottom: 4rem;
  }

  &__title {
    font-size: 1.875rem;
    font-weight: bold;
    margin-bottom: 1rem;
    background: var(--gradient-projects-title);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;

    @include globals.desktop-only {
      font-size: 2.25rem;
    }
  }

  &__subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    max-width: 48rem;
    margin: 0 auto;
  }

  &__grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;

    @include globals.mobile-only {
      grid-template-columns: repeat(2, 1fr);
    }

    @include globals.desktop-only {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  &__card {
    background: var(--projects-card-background);
    border-radius: $card-border-radius-md;
    box-shadow: var(--projects-card-shadow);
    overflow: hidden;
    transition: $transition-base;
    border: 1px solid var(--projects-card-border);

    &:hover {
      transform: translateY(-0.25rem);
      box-shadow: var(--projects-card-shadow-hover);

      .projects-section__image {
        transform: scale(1.05);
      }

      .projects-section__overlay {
        opacity: 1;
      }
    }
  }

  &__image-container {
    position: relative;
    overflow: hidden;
    height: 12rem;
  }

  &__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
  }

  &__overlay {
    position: absolute;
    inset: 0;
    background: var(--projects-overlay-background);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  &__actions {
    display: flex;
    gap: 1rem;
  }

  &__action-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;

    &--primary {
      background: var(--projects-button-primary-bg);
      color: var(--projects-button-primary-text);
      border-color: var(--projects-button-primary-border);

      &:hover {
        background: var(--projects-button-primary-hover-bg);
        transform: translateY(-1px);
      }
    }

    &--secondary {
      background: var(--projects-button-secondary-bg);
      color: var(--projects-button-secondary-text);
      border-color: var(--projects-button-secondary-border);

      &:hover {
        background: var(--projects-button-secondary-hover-bg);
        transform: translateY(-1px);
      }
    }
  }

  &__action-icon {
    width: 1rem;
    height: 1rem;
  }

  &__content {
    padding: $card-padding-lg;
  }

  &__header-content {
    margin-bottom: 1.5rem;
  }

  &__card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    line-height: 1.4;
  }

  &__card-description {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
  }

  &__technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  &__tech-badge {
    display: inline-block;
    background: var(--projects-tech-badge-bg);
    color: var(--projects-tech-badge-text);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--projects-tech-badge-border);
  }

  // Responsive adjustments
  @include globals.mobile-only {
    &__card {
      border-radius: $card-border-radius-sm;
    }

    &__content {
      padding: $card-padding-md;
    }

    &__image-container {
      height: 10rem;
    }

    &__actions {
      flex-direction: column;
      gap: 0.75rem;
    }

    &__action-button {
      justify-content: center;
      padding: 0.75rem 1rem;
    }
  }
}
