/**
 * One Elementor - One Back to Top Widget
 * Beautiful back to top button with smooth animations
 */

/* ========================================
   Back to Top Container
======================================== */
.oe-back-to-top {
    position: fixed;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.oe-back-to-top.position-right {
    right: 30px;
    bottom: 30px;
}

.oe-back-to-top.position-left {
    left: 30px;
    bottom: 30px;
}

.oe-back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Show in Elementor Editor */
.elementor-editor-active .oe-back-to-top,
.elementor-editor-preview .oe-back-to-top {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

/* ========================================
   Button
======================================== */
.oe-back-to-top-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    padding: 0;
    background-color: #ef583a;
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(239, 88, 58, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    outline: none;
}

.oe-back-to-top-button:hover {
    background-color: #FB8C00;
    box-shadow: 0 6px 25px rgba(239, 88, 58, 0.4);
    transform: translateY(-3px) scale(1.05);
}

.oe-back-to-top-button:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 15px rgba(239, 88, 58, 0.3);
}

/* Button with text */
.oe-back-to-top-button.has-text {
    width: auto;
    height: auto;
    min-width: 50px;
    min-height: 50px;
    padding: 12px 20px;
    border-radius: 30px;
    flex-direction: row;
    gap: 8px;
}

/* ========================================
   Icon
======================================== */
.oe-back-to-top-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    transition: transform 0.3s ease;
}

.oe-back-to-top-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
}

.oe-back-to-top-button:hover .oe-back-to-top-icon {
    transform: translateY(-2px);
}

/* ========================================
   Text
======================================== */
.oe-back-to-top-text {
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: transform 0.3s ease;
}

.oe-back-to-top-button:hover .oe-back-to-top-text {
    transform: translateY(-1px);
}

/* ========================================
   Glow Effect
======================================== */
.oe-back-to-top-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: all 0.5s ease;
    pointer-events: none;
}

.oe-back-to-top-button:hover::before {
    transform: translate(-50%, -50%) scale(2);
    opacity: 1;
}

/* ========================================
   Pulse Animation
======================================== */
.oe-back-to-top-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: currentColor;
    opacity: 0;
    animation: pulse 2s infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

.oe-back-to-top-button:hover::after {
    animation: none;
}

/* ========================================
   Shimmer Effect
======================================== */
.oe-back-to-top-button {
    position: relative;
    overflow: hidden;
}

.oe-back-to-top-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -100%;
    width: 100%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: skewX(-25deg);
    transition: left 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

.oe-back-to-top-button:hover::after {
    left: 200%;
}

/* ========================================
   Responsive Design
======================================== */

/* Tablet */
@media (max-width: 1024px) {
    .oe-back-to-top.position-right {
        right: 25px;
        bottom: 25px;
    }

    .oe-back-to-top.position-left {
        left: 25px;
        bottom: 25px;
    }

    .oe-back-to-top-button {
        width: 48px;
        height: 48px;
    }

    .oe-back-to-top-icon {
        font-size: 22px;
    }

    .oe-back-to-top-icon svg {
        width: 22px;
        height: 22px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .oe-back-to-top.position-right {
        right: 20px;
        bottom: 20px;
    }

    .oe-back-to-top.position-left {
        left: 20px;
        bottom: 20px;
    }

    .oe-back-to-top-button {
        width: 45px;
        height: 45px;
        min-width: 45px;
        min-height: 45px;
    }

    .oe-back-to-top-button.has-text {
        padding: 10px 16px;
    }

    .oe-back-to-top-icon {
        font-size: 20px;
    }

    .oe-back-to-top-icon svg {
        width: 20px;
        height: 20px;
    }

    .oe-back-to-top-text {
        font-size: 13px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .oe-back-to-top.position-right {
        right: 15px;
        bottom: 15px;
    }

    .oe-back-to-top.position-left {
        left: 15px;
        bottom: 15px;
    }

    .oe-back-to-top-button {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        box-shadow: 0 3px 15px rgba(239, 88, 58, 0.3);
    }

    .oe-back-to-top-button.has-text {
        padding: 8px 14px;
    }

    .oe-back-to-top-icon {
        font-size: 18px;
    }

    .oe-back-to-top-icon svg {
        width: 18px;
        height: 18px;
    }

    .oe-back-to-top-text {
        font-size: 12px;
    }
}

/* ========================================
   Accessibility
======================================== */
.oe-back-to-top-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.oe-back-to-top-button:focus-visible {
    outline: 2px solid #FFFFFF;
    outline-offset: 2px;
}

/* ========================================
   Print Styles
======================================== */
@media print {
    .oe-back-to-top {
        display: none;
    }
}
