/* Contact Section - Main container and layout styles - Mobile First */
.contact-section {
  background: var(--contact-section-bg) !important;

  & p {
    margin-bottom: 0;
  }

  /* Contact Highlights Grid - Apple Keynote style highlight cards */
  & .contact-highlights-grid {
    /* Positioning & Display */
    display: grid;

    /* Box Model */
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-md);
    max-width: 100%;
    margin: 0 auto;

    /* Grid Template Areas - Mobile First */
    grid-template-areas:
      "profile social social social"
      "profile email email email";

    /* Grid Template Columns */
    grid-template-columns: minmax(100px, 30%) 1fr 1fr minmax(100px, 30%);

    /* Hide specific cards on mobile */
    & .highlight-card.location-card,
    & .highlight-card.looking-for-card,
    & .highlight-card.offer-card {
      display: none;
    }

    /* Animation classes for contact cards */
    & .highlight-card.contact-card-hidden {
      opacity: 0;
      transform: translateY(30px);
      transition: opacity 0.5s ease, transform 0.5s ease;
    }

    & .highlight-card.contact-card-visible {
      opacity: 1;
      transform: translateY(0);
    }

    /* Clickable card styles */
    & .clickable-card {
      text-decoration: none;
      color: var(--text-color);
      transition: transform 0.3s ease, box-shadow 0.3s ease;
      cursor: pointer;

      &:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 30px var(--card-shadow);
      }
    }

    /* Highlight Card - Base styles for all highlight cards */
    & .highlight-card {
      /* Positioning & Display */
      position: relative;
      overflow: hidden;
      height: 100%;

      /* Box Model */
      min-height: 180px;
      border-radius: var(--border-radius-lg);

      /* Colors & Backgrounds */
      background-color: var(--card-bg);
      box-shadow: 0 5px 15px var(--card-shadow);
      border: 1px solid var(--border-color);

      /* Effects & Transitions */
      transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.5s ease;

      &.profile-picture-card {
        /* Positioning & Display */
        position: relative;
        overflow: hidden;

        /* Box Model */
        padding: 0;
        width: 100%;
        height: auto;

        /* Other */
        background-color: var(--card-bg);
        box-shadow: 0 5px 15px var(--card-shadow);
        border: 1px solid var(--border-color);
        cursor: pointer;

        & img {
          /* Positioning & Display */
          position: absolute;
          top: 0;
          left: 0;

          /* Box Model */
          width: 100%;
          height: 100%;

          /* Other */
          object-fit: cover;

          /* Effects & Transitions */
          transition: transform 0.5s ease;
        }

        /* Highlight Card Overlay - Text overlay for the profile picture card */
        & .profile-picture-overlay {
          /* Positioning & Display */
          position: absolute;
          bottom: 0;
          left: 0;
          right: 0;

          /* Box Model */
          padding: 1rem;

          /* Colors & Backgrounds */
          background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));

          & h3 {
            /* Typography */
            margin-bottom: 0.5rem;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
            font-size: 0.9rem;
            color: white;
          }

          & p {
            /* Typography */
            font-size: 0.8rem;
            margin-bottom: 0;
            opacity: 0.9;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
          }
        }
      }

      /* Mini Cards Container - Container for split cards */
      &.mini-cards-container {
        /* Positioning & Display */
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: stretch;
        border: none;
        overflow: visible;
        box-shadow: none !important;

        /* Box Model */
        gap: 0.75rem;
        padding: 0;
        background-color: transparent;

        &:hover {
          transform: none !important;
        }

        /* Mini Card - Individual cards within the mini-cards container */
        & .mini-card {
          /* Positioning & Display */
          position: relative;
          flex: 1;
          display: flex;
          flex-direction: column;
          overflow: visible;
          /* Changed from hidden to visible to prevent text cutting */
          height: auto;
          /* Allow height to adjust to content */

          /* Box Model */
          border-radius: var(--border-radius-lg);

          /* Colors & Backgrounds */
          background-color: var(--card-bg);
          box-shadow: 0 5px 15px var(--card-shadow);
          border: 1px solid var(--border-color);

          /* Effects & Transitions */
          transition: transform 0.3s ease, box-shadow 0.3s ease;

          & .highlight-card-content {
            /* Box Model */
            padding: var(--spacing-sm);
            padding-bottom: 0;
            justify-content: space-between;
            flex-direction: row;
            align-items: center;
            width: 100%;

            /* Positioning & Display */
            display: flex;

            & .highlight-card-icon {
              /* Box Model */
              margin-bottom: 0;
              margin-right: 0.75rem;

              /* Typography */
              font-size: 1.2rem;
            }

            & h3 {
              /* Box Model */
              margin-bottom: 0;
              margin-right: auto;

              /* Typography */
              font-size: 0.9rem;
            }

            & .highlight-card-link {
              /* Box Model */
              padding-top: 0;
              margin-top: 0;
              margin-left: 0.75rem;

              /* Typography */
              font-size: 0.85rem;

              & span {
                /* Positioning & Display */
                display: none;
              }

              & i {
                /* Box Model */
                margin-left: 0;
              }
            }
          }

          & .text-description {
            padding: var(--spacing-sm);
            padding-top: 6px;
            font-size: 12px;
            line-height: 16px;
            word-wrap: break-word;
            /* Ensures text wraps properly */
          }
        }
      }

      /* Highlight Card Content - Inner content container */
      & .highlight-card-content {
        /* Positioning & Display */
        display: flex;
        flex-direction: column;

        /* Box Model */
        height: 100%;
        padding: var(--spacing-sm);

        /* Highlight Card Icon - Icon at the top of cards */
        & .highlight-card-icon {
          /* Box Model */
          margin-bottom: 0.75rem;

          /* Typography */
          font-size: 1.4rem;
          color: var(--accent-color);

          & i {
            /* Effects & Transitions */
            transition: transform 0.3s ease;
          }
        }

        /* Highlight Card Link - Styled link at the bottom of cards */
        & .highlight-card-link {
          /* Positioning & Display */
          display: flex;
          align-items: center;
          margin-top: auto;

          /* Box Model */
          padding-top: 0.75rem;

          /* Typography */
          text-decoration: none;
          font-weight: 600;
          font-size: 0.85rem;
          color: var(--accent-color);

          /* Effects & Transitions */
          transition: color 0.2s ease;

          & i {
            /* Box Model */
            margin-left: 0.25rem;

            /* Effects & Transitions */
            transition: transform 0.2s ease;
          }
        }

        /* Expertise Tags - Tags list in the expertise card */
        & .expertise-tags {
          /* Positioning & Display */
          display: flex;
          flex-wrap: wrap;

          /* Box Model */
          gap: 0.35rem;
          margin: 0.5rem 0 0;
          padding: 0;

          /* Other */
          list-style: none;

          & li {
            /* Box Model */
            padding: 0.25rem 0.6rem;
            border-radius: var(--border-radius-pill);

            /* Typography */
            font-size: 0.75rem;
            font-weight: 500;
            color: var(--accent-color);

            /* Colors & Backgrounds */
            background-color: rgba(var(--accent-rgb), 0.07);
          }
        }

        /* Availability Badge - Special badge in the availability card */
        & .availability-badge {
          /* Positioning & Display */
          display: inline-flex;
          align-items: center;
          margin-top: 0.75rem;

          /* Box Model */
          padding: 0.35rem 0.6rem;
          border-radius: var(--border-radius-pill);

          /* Typography */
          font-size: 0.8rem;
          font-weight: 500;

          /* Colors & Backgrounds */
          background-color: rgba(75, 181, 67, 0.15);
          color: #4bb543;
        }

        /* Contact Status Dot - Pulsing status indicator */
        & .contact-status-dot {
          /* Positioning & Display */
          position: relative;
          display: inline-block;

          /* Box Model */
          width: 10px;
          height: 10px;
          margin-right: 0.4rem;
          border-radius: 50%;

          /* Colors & Backgrounds */
          background-color: #4bb543;

          &.available::after {
            /* Positioning & Display */
            content: "";
            position: absolute;
            top: -4px;
            left: -4px;
            right: -4px;
            bottom: -4px;

            /* Box Model */
            border-radius: 50%;

            /* Colors & Backgrounds */
            background-color: rgba(75, 181, 67, 0.4);

            /* Effects & Transitions */
            animation: pulse 2s infinite;
          }
        }
      }
    }
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  70% {
    transform: scale(2);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* Small tablet styles */
@media (min-width: 576px) {
  .contact-section {
    padding-bottom: 5.5rem;

    & .contact-highlights-grid {
      gap: var(--spacing-md);

      & .highlight-card {
        min-height: 200px;

        & .highlight-card-content {
          padding: 1.5rem;

          & .highlight-card-icon {
            margin-bottom: 1rem;
            font-size: 1.5rem;
          }

          & .highlight-card-link {
            padding-top: 1rem;
            font-size: 0.9rem;

            & i {
              margin-left: 0.35rem;
            }
          }

          & .expertise-tags {
            gap: 0.4rem;
            margin-top: 0.75rem;

            & li {
              padding: 0.3rem 0.7rem;
              font-size: 0.78rem;
            }
          }

          & .availability-badge {
            padding: 0.4rem 0.7rem;
            font-size: 0.825rem;
            margin-top: 0.9rem;
          }

          & .contact-status-dot {
            width: 11px;
            height: 11px;
            margin-right: 0.45rem;
          }
        }

        &.profile-picture-card {
          & .profile-picture-overlay {
            padding: 1.25rem;

            & h3 {
              font-size: 0.95rem;
            }

            & p {
              font-size: 0.85rem;
            }
          }
        }

        &.mini-cards-container {
          gap: 0.85rem;
          background-color: transparent;

          & .mini-card .highlight-card-content {
            padding: 1rem;

            & .highlight-card-icon {
              font-size: 1.25rem;
              margin-right: 0.85rem;
            }

            & h3 {
              font-size: 0.92rem;
            }

            & .highlight-card-link {
              font-size: 0.88rem;
              margin-left: 0.85rem;
            }
          }
        }
      }
    }
  }
}

/* Medium tablet styles */
@media (min-width: 768px) {
  .contact-section {
    padding-bottom: 5rem;

    & .contact-highlights-grid {
      /* Grid Template Areas */
      grid-template-areas:
        "profile social email email"
        "profile location lookingfor lookingfor"
        "expertise expertise expertise expertise";

      /* Grid Template Columns */
      grid-template-columns: 150px 1fr 1fr 150px;

      /* Show previously hidden cards on tablet and above */
      & .highlight-card.location-card,
      & .highlight-card.looking-for-card,
      & .highlight-card.offer-card {
        display: block;
      }

      & .highlight-card {
        min-height: 220px;

        &.profile-picture-card {
          width: 150px;

          & .profile-picture-overlay h3 {
            font-size: 1rem;
          }
        }

        & .highlight-card-content .highlight-card-link:hover {
          /* Typography */
          color: var(--accent-color-hover);

          & i {
            /* Effects & Transitions */
            transform: translateX(3px);
          }
        }

        &.mini-cards-container .mini-card:hover {
          /* Effects & Transitions */
          transform: translateY(-3px);
          box-shadow: 0 10px 25px var(--card-shadow);
        }
      }
    }
  }
}

/* Large tablet styles */
@media (min-width: 992px) {
  .contact-section {
    padding-bottom: 6rem;

    & .contact-highlights-grid {
      /* Grid Template Areas */
      grid-template-areas:
        "profile social email location"
        "lookingfor lookingfor  expertise expertise";

      /* Grid Template Columns */
      grid-template-columns: repeat(4, 1fr);

      padding: 0 var(--spacing-xl);

      & .highlight-card {
        &:hover {
          /* Effects & Transitions */
          transform: translateY(-5px);
          box-shadow: 0 15px 30px var(--card-shadow);
        }

        &.profile-picture-card {
          width: auto;
          height: 100%;

          &:hover img {
            /* Effects & Transitions */
            transform: scale(1.05);
          }

          & .profile-picture-overlay {
            padding: 1.75rem;

            & h3 {
              font-size: 1.1rem;
            }

            & p {
              font-size: 0.9rem;
            }
          }
        }

        & .highlight-card-content {
          padding: 1.75rem;

          & .highlight-card-icon {
            margin-bottom: 1.25rem;
            font-size: 1.6rem;
          }

          & .highlight-card-link {
            padding-top: 1.15rem;
            font-size: 0.925rem;

            & i {
              margin-left: 0.4rem;
            }
          }
        }

        &.mini-cards-container .mini-card .highlight-card-content {
          & .highlight-card-icon {
            font-size: 1.3rem;
          }

          & h3 {
            font-size: 0.95rem;
          }
        }
      }
    }
  }
}

/* Desktop styles */
@media (min-width: 1200px) {
  .contact-section {
    padding-bottom: 7rem;

    & .contact-highlights-grid {
      /* Grid Template Areas */
      grid-template-areas:
        "profile profile email email social social location location"
        "profile profile lookingfor lookingfor lookingfor expertise expertise expertise";

      /* Grid Template Columns */
      grid-template-columns: repeat(8, 1fr);
      max-width: 1200px;

      & .highlight-card {
        &.profile-picture-card {
          grid-row: auto;
        }

        & .highlight-card-content {
          padding: 2rem;

          & .highlight-card-icon {
            margin-bottom: 1.5rem;
            font-size: 1.75rem;
          }

          & .highlight-card-link {
            padding-top: 1.25rem;
            font-size: 0.95rem;

            & i {
              margin-left: 0.5rem;
            }
          }

          & .expertise-tags {
            gap: 0.5rem;
            margin-top: 1rem;

            & li {
              padding: 0.35rem 0.8rem;
              font-size: 0.8rem;

              &:hover {
                /* Colors & Backgrounds */
                background-color: rgba(var(--accent-rgb), 0.15);

                /* Effects & Transitions */
                transform: translateY(-2px);
              }
            }
          }

          & .availability-badge {
            margin-top: 1rem;
            padding: 0.5rem 0.75rem;
            font-size: 0.85rem;
          }

          & .contact-status-dot {
            width: 12px;
            height: 12px;
            margin-right: 0.5rem;

            &.available::after {
              top: -5px;
              left: -5px;
              right: -5px;
              bottom: -5px;
            }
          }
        }
      }
    }
  }
}