/**
 * BBF Gallery - Share Modal CSS
 * Styles for share functionality
 * 
 * @author BBFDesign
 * @version 2.0.0
 */

/* ===================================
   SHARE MODAL
   =================================== */

.bbf-share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.bbf-share-modal.show {
    opacity: 1;
    visibility: visible;
}

.bbf-share-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.bbf-share-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

/* ===================================
   SHARE HEADER
   =================================== */

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

.bbf-share-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.bbf-share-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bbf-share-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* ===================================
   SHARE BODY
   =================================== */

.bbf-share-body {
    padding: 20px;
}

/* ===================================
   SHARE BUTTONS
   =================================== */

.bbf-share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.bbf-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

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

.bbf-share-btn:active {
    transform: translateY(0);
}

.bbf-share-btn i {
    font-size: 16px;
}

/* Platform-specific colors (set inline via JS) */
.bbf-share-facebook {
    background-color: #1877f2;
}

.bbf-share-twitter {
    background-color: #1da1f2;
}

.bbf-share-pinterest {
    background-color: #e60023;
}

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

.bbf-share-email {
    background-color: #666;
}

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

.bbf-share-telegram {
    background-color: #0088cc;
}

/* ===================================
   LINK COPY SECTION
   =================================== */

.bbf-share-link {
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.bbf-share-link label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    margin-bottom: 8px;
}

.bbf-share-link-group {
    display: flex;
    gap: 8px;
}

.bbf-share-link-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #f8f9fa;
}

.bbf-share-link-input:focus {
    outline: none;
    border-color: var(--bbf-accent-color, #007bff);
    background: #fff;
}

.bbf-share-copy-btn {
    padding: 10px 20px;
    background: var(--bbf-accent-color, #007bff);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.bbf-share-copy-btn:hover {
    background: #0056b3;
}

.bbf-share-copy-btn.success {
    background: #28a745;
}

.bbf-share-copy-btn i {
    margin-right: 4px;
}

/* ===================================
   SHARE BUTTON ON PAGE
   =================================== */

.bbf-share-page-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bbf-share-page-btn:hover {
    background: #f8f9fa;
    border-color: var(--bbf-accent-color, #007bff);
    color: var(--bbf-accent-color, #007bff);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bbf-share-page-btn i {
    margin-right: 6px;
}

/* Page Share Button Positioning */
.bbf-share-product-wrapper {
    position: absolute;
    z-index: 5;
}

.bbf-share-product-wrapper.pos-top-left {
    top: 10px;
    left: 10px;
}

.bbf-share-product-wrapper.pos-top-right {
    top: 10px;
    right: 10px;
}

.bbf-share-product-wrapper.pos-bottom-left {
    bottom: 10px;
    left: 10px;
}

.bbf-share-product-wrapper.pos-bottom-right {
    bottom: 10px;
    right: 10px;
}

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

@media (max-width: 576px) {
    .bbf-share-content {
        width: 95%;
        max-height: 85vh;
    }

    .bbf-share-header {
        padding: 16px;
    }

    .bbf-share-header h3 {
        font-size: 18px;
    }

    .bbf-share-body {
        padding: 16px;
    }

    .bbf-share-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .bbf-share-link-group {
        flex-direction: column;
    }

    .bbf-share-copy-btn {
        width: 100%;
    }
}

/* ===================================
   DARK MODE
   =================================== */

@media (prefers-color-scheme: dark) {
    .bbf-share-content {
        background: #2a2a2a;
        color: #fff;
    }

    .bbf-share-header {
        border-bottom-color: #444;
    }

    .bbf-share-header h3 {
        color: #fff;
    }

    .bbf-share-close {
        color: #999;
    }

    .bbf-share-close:hover {
        background: #3a3a3a;
        color: #fff;
    }

    .bbf-share-link {
        border-top-color: #444;
    }

    .bbf-share-link label {
        color: #ccc;
    }

    .bbf-share-link-input {
        background: #3a3a3a;
        border-color: #555;
        color: #fff;
    }

    .bbf-share-link-input:focus {
        background: #444;
    }
}

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

.bbf-share-btn:focus,
.bbf-share-copy-btn:focus,
.bbf-share-close:focus {
    outline: 2px solid var(--bbf-accent-color, #007bff);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .bbf-share-modal {
        background: rgba(0, 0, 0, 0.95);
    }

    .bbf-share-content {
        border: 3px solid #fff;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .bbf-share-modal,
    .bbf-share-content,
    .bbf-share-btn,
    .bbf-share-copy-btn {
        transition: none;
    }
}

/* ===================================
   ANIMATIONS
   =================================== */

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.bbf-share-modal.show .bbf-share-content {
    animation: slideUp 0.3s ease;
}

/* ── Share Modal Accessibility ── */

.bbf-share-modal:focus-visible {
    outline: none;
}

.bbf-share-btn:focus-visible,
.bbf-share-close:focus-visible,
.bbf-share-copy-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .bbf-share-modal,
    .bbf-share-modal * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
