/* Variables - Enhanced Color Palette */
:root {
  --footer-bg-primary: #1a1a2e;
  --footer-bg-secondary: #16213e;
  --footer-gradient: linear-gradient(135deg, var(--footer-bg-primary) 0%, var(--footer-bg-secondary) 100%);
  --footer-text-primary: #ffffff;
  --footer-text-secondary: #e2e8f0;
  --footer-text-muted: #94a3b8;
  --footer-text-accent: var(--accent1);
  --footer-border-subtle: rgba(255, 255, 255, 0.1);
  --footer-border-accent: rgba(var(--accent1-rgb), 0.3);
  /* Typography Hierarchy */
  --footer-title-primary: 1.25rem;
  --footer-title-weight: 700;
  --footer-title-spacing: -0.025em;
  --footer-link-size: 0.95rem;
  --footer-link-weight: 400;
  --footer-link-spacing: 0.01em;
  --footer-bottom-size: 0.875rem;
  --footer-bottom-weight: 400;
  /* Spacing System */
  --footer-padding: 5rem 0 2.5rem;
  --footer-margin: 5rem;
  --footer-section-gap: 3rem;
  --footer-content-gap: 1.5rem;
  --footer-link-gap: 0.75rem;
}

.site-footer {
  background: var(--footer-gradient);
  position: relative;
  margin-top: var(--footer-margin);

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
      transparent 0%,
      var(--footer-border-accent) 20%,
      var(--footer-border-accent) 80%,
      transparent 100%
    );
  }

  &::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
      ellipse at top center,
      rgba(var(--primary-rgb), 0.05) 0%,
      transparent 50%
    );
    pointer-events: none;
  }

  .container {
    position: relative;
    z-index: 2;
    padding: var(--footer-padding);
  }

  .footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--footer-section-gap);
    margin-bottom: 4rem;
    position: relative;
  }

  .footer-section {
    position: relative;

    &:not(:last-child)::after {
      content: '';
      position: absolute;
      right: -1.5rem;
      top: 0;
      bottom: 0;
      width: 1px;
      background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--footer-border-subtle) 20%,
        var(--footer-border-subtle) 80%,
        transparent 100%
      );
    }

    h3 {
      color: var(--footer-text-primary);
      font-size: var(--footer-title-primary);
      font-weight: var(--footer-title-weight);
      letter-spacing: var(--footer-title-spacing);
      margin-bottom: var(--footer-content-gap);
      text-transform: uppercase;
      position: relative;
      padding-bottom: 0.75rem;

      &::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 2rem;
        height: 2px;
        background: linear-gradient(90deg, var(--footer-text-accent), transparent);
        border-radius: 1px;
      }
    }

    ul {
      list-style: none;
      padding: 0;
      margin: 0;

      li {
        margin-bottom: var(--footer-link-gap);
        transform: translateX(0);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

        &:hover {
          transform: translateX(0.25rem);
        }

        a {
          color: var(--footer-text-secondary);
          text-decoration: none;
          font-size: var(--footer-link-size);
          font-weight: var(--footer-link-weight);
          letter-spacing: var(--footer-link-spacing);
          line-height: 1.6;
          position: relative;
          display: inline-block;
          transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

          &::before {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 0;
            width: 0;
            height: 1px;
            background: var(--footer-text-accent);
            transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
          }

          &:hover {
            color: var(--footer-text-primary);
            text-shadow: 0 0 8px rgba(var(--accent1-rgb), 0.3);

            &::before {
              width: 100%;
            }
          }

          &[target="_blank"] {
            &::after {
              content: '\2197';
              font-size: 0.8em;
              margin-left: 0.25rem;
              opacity: 0.6;
              transition: opacity 0.3s ease;
            }

            &:hover::after {
              opacity: 1;
            }
          }
        }
      }
    }
  }

  .footer-bottom {
    border-top: 1px solid var(--footer-border-subtle);
    padding-top: 2.5rem;
    text-align: center;
    position: relative;

    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 3rem;
      height: 1px;
      background: var(--footer-text-accent);
      box-shadow: 0 0 8px rgba(var(--accent1-rgb), 0.4);
    }

    p {
      color: var(--footer-text-muted);
      font-size: var(--footer-bottom-size);
      font-weight: var(--footer-bottom-weight);
      line-height: 1.7;
      margin: 0;
      max-width: 600px;
      margin: 0 auto;

      a {
        color: var(--footer-text-accent);
        text-decoration: none;
        font-weight: 500;
        transition: all 0.3s ease;

        &:hover {
          color: var(--footer-text-primary);
          text-shadow: 0 0 6px rgba(var(--accent1-rgb), 0.4);
        }
      }
    }
  }

  /* Responsive Design */
  @media (max-width: 768px) {
    margin-top: 3rem;

    .container {
      padding: 3rem 0 2rem;
    }

    .footer-grid {
      grid-template-columns: 1fr;
      gap: 2.5rem;
      margin-bottom: 3rem;
    }

    .footer-section {
      text-align: center;

      &:not(:last-child)::after {
        display: none;
      }

      &::after {
        content: '';
        position: absolute;
        bottom: -1.25rem;
        left: 50%;
        transform: translateX(-50%);
        width: 60%;
        height: 1px;
        background: linear-gradient(
          90deg,
          transparent 0%,
          var(--footer-border-subtle) 50%,
          transparent 100%
        );
      }

      &:last-child::after {
        display: none;
      }

      h3::after {
        left: 50%;
        transform: translateX(-50%);
      }
    }

    .footer-bottom {
      padding-top: 2rem;

      p {
        font-size: 0.8rem;
      }
    }
  }
}
