/**
 * HelpBix Share Widget Styles - Mobile-First & Accessible
 * Mobile-first approach with progressive enhancement
 */

/* ===== BASE STYLES (Mobile First) ===== */
.helpbix-share-widget {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e8eaed;
    position: relative;
}

/* Floating widget variant */
.helpbix-share-widget--floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 12px;
    transition: all 0.3s ease;
}

.helpbix-share-widget--floating:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

/* Widget title */
.share-widget-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a73e8;
    margin-bottom: 16px;
    margin-top: 0;
    line-height: 1.3;
    text-align: center;
}

/* Share buttons container - Optimized for single line */
.share-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
}

.share-buttons::-webkit-scrollbar {
    display: none;
}

/* Individual share button - Optimized sizing for single line */
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    color: #fff;
    cursor: pointer;
    min-width: 40px;
    min-height: 40px;
    max-width: 120px;
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    flex-shrink: 0;
}

/* Touch-friendly hover states */
.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.share-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Focus states for accessibility */
.share-btn:focus {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1);
}

/* Share icon */
.share-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.share-btn:hover .share-icon {
    transform: scale(1.1);
}

/* Share text - hidden on mobile, visible on larger screens */
.share-text {
    display: none;
    white-space: nowrap;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Share count */
.share-count {
    display: none;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Platform-specific colors */
.share-twitter {
    background: #1da1f2;
    border-color: #1da1f2;
}

.share-twitter:hover {
    background: #0c85d0;
    border-color: #0c85d0;
}

.share-facebook {
    background: #1877f2;
    border-color: #1877f2;
}

.share-facebook:hover {
    background: #166fe5;
    border-color: #166fe5;
}

.share-whatsapp {
    background: #25d366;
    border-color: #25d366;
}

.share-whatsapp:hover {
    background: #20ba5a;
    border-color: #20ba5a;
}

.share-linkedin {
    background: #0077b5;
    border-color: #0077b5;
}

.share-linkedin:hover {
    background: #006097;
    border-color: #006097;
}

.share-email {
    background: #ea4335;
    border-color: #ea4335;
}

.share-email:hover {
    background: #d33426;
    border-color: #d33426;
}

.share-copy {
    background: #1a73e8;
    border-color: #1a73e8;
}

.share-copy:hover {
    background: #1558b0;
    border-color: #1558b0;
}

.share-copy.copied {
    background: #34a853;
    border-color: #34a853;
}

/* Copy status indicator */
.copy-status {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #34a853;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.copy-status.show {
    opacity: 1;
    transform: scale(1);
}

/* Toast notifications */
.share-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    background: #323232;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    width: auto;
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    transition: all 0.3s ease;
}

.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.share-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-toast-message {
    font-size: 0.875rem;
    font-weight: 500;
}

.share-toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.share-toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.share-toast-close:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* ===== TABLET STYLES (768px+) ===== */
@media (min-width: 768px) {
    .helpbix-share-widget {
        margin-top: 32px;
        padding-top: 24px;
    }
    
    .share-widget-title {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }
    
    .share-buttons {
        gap: 8px;
        flex-wrap: nowrap;
        justify-content: center;
    }
    
    .share-btn {
        padding: 12px;
        gap: 0;
        min-width: 44px;
        min-height: 44px;
        max-width: 44px;
    }
    
    .share-text {
        display: none;
    }
    
    .share-count {
        display: none;
    }
    
    .share-icon {
        width: 18px;
        height: 18px;
    }
    
    /* Floating widget adjustments */
    .helpbix-share-widget--floating {
        bottom: 30px;
        right: 30px;
        padding: 16px;
    }
}

/* ===== DESKTOP STYLES (1024px+) ===== */
@media (min-width: 1024px) {
    .helpbix-share-widget {
        margin-top: 40px;
        padding-top: 32px;
    }
    
    .share-widget-title {
        font-size: 1.2rem;
        margin-bottom: 24px;
    }
    
    .share-buttons {
        gap: 10px;
        flex-wrap: nowrap;
        justify-content: center;
    }
    
    .share-btn {
        padding: 14px;
        font-size: 0.9rem;
        min-height: 48px;
        max-width: 48px;
    }
    
    .share-icon {
        width: 19px;
        height: 19px;
    }
    
    /* Enhanced hover effects for desktop */
    .share-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    }
}

/* ===== LARGE DESKTOP STYLES (1200px+) ===== */
@media (min-width: 1200px) {
    .share-buttons {
        gap: 12px;
    }
    
    .share-btn {
        padding: 16px;
        font-size: 0.95rem;
        min-height: 52px;
        max-width: 52px;
    }
    
    .share-icon {
        width: 20px;
        height: 20px;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */

/* High contrast mode */
@media (prefers-contrast: high) {
    .share-btn {
        border: 2px solid currentColor;
    }
    
    .share-btn:focus {
        outline: 3px solid #000;
        outline-offset: 2px;
    }
    
    .share-toast {
        border: 2px solid #fff;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .share-btn,
    .share-icon,
    .share-toast,
    .copy-status {
        transition: none;
    }
    
    .share-btn:hover {
        transform: none;
    }
    
    .share-btn:hover .share-icon {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .helpbix-share-widget {
        border-top-color: #404040;
    }
    
    .share-widget-title {
        color: #4dabf7;
    }
    
    .helpbix-share-widget--floating {
        background: rgba(45, 45, 45, 0.95);
        color: #ffffff;
    }
    
    .share-toast {
        background: #2d2d2d;
        color: #ffffff;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .helpbix-share-widget {
        display: none;
    }
}

/* ===== LOADING STATES ===== */
.share-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.share-btn.loading .share-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== SUCCESS ANIMATIONS ===== */
.share-btn.success {
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ===== RESPONSIVE FLOATING WIDGET ===== */
@media (max-width: 600px) {
    .helpbix-share-widget--floating {
        bottom: 16px;
        right: 16px;
        padding: 8px;
    }
    
    .helpbix-share-widget--floating .share-buttons {
        gap: 4px;
    }
    
    .helpbix-share-widget--floating .share-btn {
        padding: 8px 10px;
        min-width: 36px;
        min-height: 36px;
        max-width: 90px;
    }
    
    .helpbix-share-widget--floating .share-icon {
        width: 16px;
        height: 16px;
    }
}

/* ===== EXTRA SMALL DEVICES (320px - 480px) ===== */
@media (max-width: 480px) {
    .share-buttons {
        gap: 4px;
        padding: 2px 0;
    }
    
    .share-btn {
        padding: 8px 10px;
        font-size: 0.75rem;
        min-width: 34px;
        min-height: 34px;
        max-width: 80px;
    }
    
    .share-icon {
        width: 16px;
        height: 16px;
    }
    
    .share-text {
        font-size: 0.7rem;
    }
    
    .helpbix-share-widget--floating {
        bottom: 12px;
        right: 12px;
        padding: 6px;
    }
    
    .helpbix-share-widget--floating .share-btn {
        padding: 6px 8px;
        min-width: 32px;
        min-height: 32px;
        max-width: 70px;
    }
    
    .helpbix-share-widget--floating .share-icon {
        width: 14px;
        height: 14px;
    }
} 