/* Hason Share Frontend Styles */

.hason-share-wrapper {
    display: inline-block;
    margin: 15px 0;
    position: relative;
}

.hason-share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #000;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    position: relative;
}

.hason-share-button:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.hason-share-button:active {
    transform: scale(0.95);
}

/* Button shapes */
.hason-share-shape-default {
    border-radius: 4px;
}

.hason-share-shape-circle {
    border-radius: 50%;
}

.hason-share-shape-rectangle {
    border-radius: 8px;
    width: auto !important;
    padding: 0 20px;
}

.hason-share-shape-square {
    border-radius: 0;
}

.hason-share-shape-custom {
    border-radius: 4px;
}

/* Icon styles */
.hason-share-icon {
    display: block;
    pointer-events: none;
}

.hason-share-custom-icon {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* Content position styling */
.hason-share-content-position {
    display: block;
    text-align: center;
}

/* Sidebar sticky button */
.hason-share-sidebar {
    position: fixed;
    z-index: 999;
    transition: opacity 0.3s ease;
    transform: translateY(-50%); /* Always center vertically */
}

.hason-share-sidebar-left {
    left: 20px;
}

.hason-share-sidebar-right {
    right: 20px;
}

/* Sidebar positioning - always centered with offset via inline style */
/* Offset is applied via inline style: top: calc(50% + offset) */
/* Admin bar compensation is handled in inline style calculation */

/* Feedback message */
.hason-share-feedback {
    display: none;
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    margin-left: 10px;
    padding: 5px 10px;
    background: #000;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

.hason-share-feedback::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #000;
}

/* Sidebar button feedback adjustment */
.hason-share-sidebar .hason-share-feedback {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 10px;
}

.hason-share-sidebar .hason-share-feedback::before {
    right: auto;
    left: 100%;
    border-right-color: transparent;
    border-left-color: #000;
}

/* Visibility classes */
@media screen and (max-width: 768px) {
    .hason-share-hide-mobile {
        display: none !important;
    }
    
    /* Adjust sidebar position on mobile/tablet for better accessibility */
    .hason-share-sidebar-left {
        left: 10px;
    }
    
    .hason-share-sidebar-right {
        right: 10px;
    }
    
    /* Slightly smaller buttons on mobile for better UX */
    .hason-share-sidebar .hason-share-button {
        max-width: 50px;
        max-height: 50px;
    }
    
    .hason-share-sidebar .hason-share-icon {
        max-width: 24px;
        max-height: 24px;
    }
}

@media screen and (min-width: 769px) {
    .hason-share-hide-desktop {
        display: none !important;
    }
}

/* Tablet specific adjustments */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .hason-share-sidebar-left {
        left: 15px;
    }
    
    .hason-share-sidebar-right {
        right: 15px;
    }
}

/* Responsive adjustments */
@media screen and (max-width: 480px) {
    .hason-share-wrapper {
        text-align: center;
    }
    
    .hason-share-feedback {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        margin: 0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }
    
    .hason-share-feedback::before {
        display: none;
    }
}

/* Print styles */
@media print {
    .hason-share-wrapper,
    .hason-share-sidebar {
        display: none !important;
    }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Animation for sidebar appearing */
@keyframes fadeInSidebar {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

.hason-share-sidebar-middle.hason-share-animate {
    animation: fadeInSidebar 0.3s ease;
}
