/**
 * AI Shopper News - Social Sharing Styles
 * Version: 1.0
 * Date: November 10, 2025
 * 
 * Styles for page-level floating share bar and article-level share modals
 * Mobile responsive and accessible
 */

/* ========================================
   FLOATING SHARE BAR (Page-Level)
   ======================================== */

.floating-share-bar {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 16px 12px;
    z-index: 999;
    transition: all 0.3s ease;
}

.floating-share-bar:hover {
    box-shadow: 0 6px 30px rgba(0,0,0,0.2);
}

.floating-share-bar .share-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    text-align: center;
    writing-mode: horizontal-tb;
}

.floating-share-bar .share-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-share-bar .share-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

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

.floating-share-bar .share-btn svg {
    width: 24px;
    height: 24px;
}

/* Platform-specific colors */
.floating-share-bar .share-facebook {
    background: #1877F2;
    color: white;
}

.floating-share-bar .share-facebook:hover {
    background: #0d5dbf;
}

.floating-share-bar .share-twitter {
    background: #000000;
    color: white;
}

.floating-share-bar .share-twitter:hover {
    background: #333333;
}

.floating-share-bar .share-linkedin {
    background: #0A66C2;
    color: white;
}

.floating-share-bar .share-linkedin:hover {
    background: #084d94;
}

.floating-share-bar .share-bluesky {
    background: #0085ff;
    color: white;
}

.floating-share-bar .share-bluesky:hover {
    background: #006acc;
}

.floating-share-bar .share-email {
    background: #EA4335;
    color: white;
}

.floating-share-bar .share-email:hover {
    background: #c5331e;
}

.floating-share-bar .share-copy {
    background: #5f6368;
    color: white;
}

.floating-share-bar .share-copy:hover {
    background: #3c4043;
}

.floating-share-bar .share-copy.copied {
    background: #34A853;
}

/* Tooltip on hover */
.floating-share-bar .share-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.floating-share-bar .share-btn:hover::after {
    opacity: 1;
}

/* ========================================
   SHARE MODAL (Article-Level)
   ======================================== */

.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.share-modal.show {
    opacity: 1;
}

.share-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.share-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.share-modal.show .share-modal-content {
    transform: scale(1);
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.share-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #1a202c;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.share-modal-close:hover {
    background: #f3f4f6;
    color: #333;
}

.share-modal-body {
    padding: 24px;
}

/* AI Shopper News branding in modal */
.share-branding {
    text-align: center;
    margin-bottom: 16px;
}

.share-logo {
    max-width: 120px;
    height: auto;
}

.share-note {
    font-size: 0.8rem;
    color: #667eea;
    text-align: center;
    margin: 0 0 16px 0;
    font-weight: 500;
}

.share-article-title {
    font-size: 0.95rem;
    color: #4a5568;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.share-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.share-button svg {
    width: 20px;
    height: 20px;
}

/* Platform colors for modal buttons */
.share-button.share-facebook {
    background: #1877F2;
}

.share-button.share-facebook:hover {
    background: #0d5dbf;
}

.share-button.share-twitter {
    background: #000000;
}

.share-button.share-twitter:hover {
    background: #333333;
}

.share-button.share-linkedin {
    background: #0A66C2;
}

.share-button.share-linkedin:hover {
    background: #084d94;
}

.share-button.share-bluesky {
    background: #0085ff;
}

.share-button.share-bluesky:hover {
    background: #006acc;
}

.share-button.share-email {
    background: #EA4335;
}

.share-button.share-email:hover {
    background: #c5331e;
}

.share-button.share-copy {
    background: #5f6368;
}

.share-button.share-copy:hover {
    background: #3c4043;
}

.share-button.share-copy.copied {
    background: #34A853;
}

/* Share Site Divider and Button in Modal */
.share-site-divider {
    display: flex;
    align-items: center;
    margin: 16px 0 12px 0;
    color: #9ca3af;
    font-size: 0.85rem;
}

.share-site-divider::before,
.share-site-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.share-site-divider span {
    padding: 0 12px;
    white-space: nowrap;
}

.share-button.share-site-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    justify-content: center;
}

.share-button.share-site-btn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653d8a 100%);
}

.share-site-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: white;
    padding: 2px;
}

/* ========================================
   ARTICLE CARD SHARE BUTTON (Inline)
   ======================================== */

.article-share-inline {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.article-share-btn {
    background: none;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.article-share-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
}

.article-share-btn svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    /* Hide floating bar on mobile, use modal instead */
    .floating-share-bar {
        display: none;
    }
    
    /* Add mobile-friendly page share button */
    .mobile-share-trigger {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 999;
        transition: all 0.3s ease;
        padding: 0;
    }
    
    .mobile-share-trigger:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
    }
    
    .mobile-share-trigger .mobile-share-icon {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: white;
        padding: 4px;
    }
    
    .mobile-share-trigger svg {
        width: 24px;
        height: 24px;
    }
    
    /* Modal adjustments for mobile */
    .share-modal-content {
        width: 95%;
        max-width: 400px;
    }
    
    .share-buttons-grid {
        grid-template-columns: 1fr;
    }
    
    .share-button {
        justify-content: flex-start;
        padding: 16px 20px;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .floating-share-bar {
        left: 10px;
        padding: 12px 10px;
    }
    
    .floating-share-bar .share-btn {
        width: 44px;
        height: 44px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .share-modal-header {
        padding: 20px 16px;
    }
    
    .share-modal-header h3 {
        font-size: 1.25rem;
    }
    
    .share-modal-body {
        padding: 20px 16px;
    }
    
    .share-article-title {
        font-size: 0.9rem;
    }
}

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

.share-btn:focus,
.share-button:focus,
.article-share-btn:focus,
.share-modal-close:focus {
    outline: 3px solid #0ea5e9;
    outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .floating-share-bar,
    .share-modal,
    .share-modal-content,
    .share-btn,
    .share-button,
    .article-share-btn {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .floating-share-bar {
        border: 2px solid #000;
    }
    
    .share-modal-content {
        border: 2px solid #000;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .floating-share-bar,
    .mobile-share-trigger,
    .share-modal,
    .article-share-inline {
        display: none !important;
    }
}
