/* Back to Top Button Base Styles */
.btt-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.btt-button * {
    box-sizing: border-box;
}

.btt-button .btt-icon,
.btt-button .btt-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btt-button svg {
    display: block;
    transition: all 0.3s ease;
}

/* Entrance Animations */
@keyframes bttFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes bttSlideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bttZoomIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bttBounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Exit Animations */
@keyframes bttFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes bttSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

@keyframes bttZoomOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0);
        opacity: 0;
    }
}

@keyframes bttBounceOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* Apply Entrance Animations */
.btt-button.btt-slide-in {
    animation: bttSlideIn 0.4s ease-out forwards;
}

.btt-button.btt-zoom-in {
    animation: bttZoomIn 0.4s ease-out forwards;
}

.btt-button.btt-bounce-in {
    animation: bttBounceIn 0.5s ease-out forwards;
}

/* Apply Exit Animations */
.btt-button.btt-exit.btt-slide-in {
    animation: bttSlideOut 0.4s ease-out forwards;
}

.btt-button.btt-exit.btt-zoom-in {
    animation: bttZoomOut 0.4s ease-out forwards;
}

.btt-button.btt-exit.btt-bounce-in {
    animation: bttBounceOut 0.5s ease-out forwards;
}

/* Hover Animations */
@keyframes bttPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes bttBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes bttRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Hover Animation Classes */
.btt-button.btt-hover-pulse:hover {
    animation: bttPulse 0.6s ease-in-out infinite;
}

.btt-button.btt-hover-bounce:hover {
    animation: bttBounce 0.6s ease-in-out infinite;
}

.btt-button.btt-hover-scale:hover {
    transform: scale(1.15);
}

.btt-button.btt-hover-rotate:hover .btt-icon {
    animation: bttRotate 0.6s ease-in-out;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .btt-button {
        width: 45px !important;
        height: 45px !important;
    }
    
    .btt-button .btt-icon i,
    .btt-button .btt-icon svg {
        font-size: 18px !important;
        width: 18px !important;
        height: 18px !important;
    }
    
    .btt-button .btt-text {
        font-size: 12px !important;
    }
}

@media (max-width: 480px) {
    .btt-button {
        width: 40px !important;
        height: 40px !important;
    }
    
    .btt-button .btt-icon i,
    .btt-button .btt-icon svg {
        font-size: 16px !important;
        width: 16px !important;
        height: 16px !important;
    }
}

/* Accessibility */
.btt-button:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.btt-button:focus:not(:focus-visible) {
    outline: none;
}

.btt-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .btt-button {
        display: none !important;
    }
}

/* Editor Specific Styles */
.elementor-editor-active .btt-button {
    display: flex !important;
    opacity: 0.5;
}

.elementor-editor-active .btt-button:hover {
    opacity: 1;
}