/* Main Text Animation Block Styles */

.blockxpert-text-animation-wrapper {
  width: 100%;
  position: relative;
  z-index: 1;

  .headline-wrapper {
    margin-bottom: 20px;
    overflow: hidden;

    .main-headline {
      display: block;
      margin: 0;
      padding: 0;
      font-weight: 800;
      line-height: 1.3;
      letter-spacing: -1px;
      word-break: break-word;

      span {
        display: inline-block;
        will-change: transform, opacity, color;
      }
    }
  }

  .tagline-wrapper {
    overflow: hidden;

    .tagline {
      display: block;
      margin: 0;
      padding: 0;
      font-weight: 400;
      opacity: 0.9;

      span {
        display: inline-block;
        will-change: filter, opacity, transform;
      }
    }
  }
}

/* Editor Styles */
.wp-block-blockxpert-text-animation {
  background: linear-gradient(135deg, rgba(15, 15, 15, 0.5) 0%, rgba(26, 26, 26, 0.5) 100%);

  &.is-selected {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.1) 0%, rgba(26, 26, 26, 0.8) 100%);
  }

  .blockxpert-text-animation-wrapper {
    padding: 40px 20px;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .blockxpert-text-animation-wrapper {
    .headline-wrapper {
      .main-headline {
        font-size: clamp(1.75rem, 5vw, 3rem) !important;
      }
    }

    .tagline-wrapper {
      .tagline {
        font-size: clamp(0.875rem, 2.5vw, 1.25rem) !important;
      }
    }
  }
}

@media (max-width: 480px) {
  .blockxpert-text-animation-wrapper {
    padding: 20px 10px !important;

    .headline-wrapper {
      margin-bottom: 15px;

      .main-headline {
        font-size: clamp(1.5rem, 4vw, 2.5rem) !important;
        letter-spacing: -0.5px;
      }
    }

    .tagline-wrapper {
      .tagline {
        font-size: clamp(0.75rem, 2vw, 1rem) !important;
      }
    }
  }
}

/* Animation Accessibility */
@media (prefers-reduced-motion: reduce) {
  .blockxpert-text-animation-wrapper {
    .headline-wrapper {
      .main-headline {
        span {
          animation: none !important;
          transition: none !important;
          opacity: 1 !important;
          transform: none !important;
        }
      }
    }

    .tagline-wrapper {
      .tagline {
        span {
          animation: none !important;
          transition: none !important;
          opacity: 1 !important;
          filter: none !important;
          transform: none !important;
        }
      }
    }
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .wp-block-blockxpert-text-animation {
    background: linear-gradient(135deg, rgba(15, 15, 15, 0.8) 0%, rgba(26, 26, 26, 0.95) 100%);
  }
}

/* High Contrast Support */
@media (prefers-contrast: more) {
  .blockxpert-text-animation-wrapper {
    .headline-wrapper {
      .main-headline {
        letter-spacing: 0px;
        font-weight: 900;
      }
    }

    .tagline-wrapper {
      .tagline {
        font-weight: 600;
        opacity: 1;
      }
    }
  }
}

/* Selection Prevention for Smooth Animation */
.blockxpert-text-animation-wrapper {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;

  .main-headline span,
  .tagline span {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
  }
}
