/* ================================
   Smart Share Component - Media Type Aware
   ================================ */

/* Share Button - Only shows when result is ready */
.share-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #2adb5c, #4ae676);
    border: 1px solid rgba(42, 219, 92, 0.5);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.share-button:hover {
    background: linear-gradient(135deg, #25c451, #2adb5c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 219, 92, 0.4);
}

.share-button svg {
    width: 1.125rem;
    height: 1.125rem;
}

.share-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Share Modal Overlay */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.share-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Share Modal */
.share-modal {
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 100%);
    border: 1px solid rgba(42, 219, 92, 0.4);
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(42, 219, 92, 0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.share-modal-overlay.active .share-modal {
    transform: scale(1);
}

/* Modal Header */
.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(42, 219, 92, 0.2);
}

.share-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.share-modal-title svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #4ae676;
}

.share-modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.share-modal-close:hover {
    background: rgba(42, 219, 92, 0.1);
    color: #f8fafc;
    transform: rotate(90deg);
}

.share-modal-close svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* Media Type Badge */
.media-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(42, 219, 92, 0.1);
    border: 1px solid rgba(42, 219, 92, 0.3);
    color: #4ae676;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.media-type-badge svg {
    width: 1rem;
    height: 1rem;
}

/* Share Options Grid */
.share-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: rgba(42, 219, 92, 0.05);
    border: 1px solid rgba(42, 219, 92, 0.2);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.share-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(42, 219, 92, 0.1), rgba(74, 230, 118, 0.1));
    opacity: 0;
    transition: opacity 0.2s;
}

.share-option:hover::before {
    opacity: 1;
}

.share-option:hover {
    border-color: rgba(42, 219, 92, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(42, 219, 92, 0.2);
}

.share-option-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(42, 219, 92, 0.2), rgba(74, 230, 118, 0.2));
    border: 1px solid rgba(42, 219, 92, 0.3);
    position: relative;
    z-index: 1;
}

.share-option-icon svg {
    width: 1.75rem;
    height: 1.75rem;
}

.share-option-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #e2e8f0;
    text-align: center;
    position: relative;
    z-index: 1;
}

.share-option-desc {
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Platform-specific colors */
.share-option[data-platform="twitter"] .share-option-icon {
    background: linear-gradient(135deg, rgba(29, 155, 240, 0.2), rgba(26, 140, 216, 0.2));
    border-color: rgba(29, 155, 240, 0.3);
    color: #60a5fa;
}

.share-option[data-platform="facebook"] .share-option-icon {
    background: linear-gradient(135deg, rgba(24, 119, 242, 0.2), rgba(18, 96, 196, 0.2));
    border-color: rgba(24, 119, 242, 0.3);
    color: #60a5fa;
}

.share-option[data-platform="linkedin"] .share-option-icon {
    background: linear-gradient(135deg, rgba(10, 102, 194, 0.2), rgba(8, 82, 156, 0.2));
    border-color: rgba(10, 102, 194, 0.3);
    color: #60a5fa;
}

.share-option[data-platform="reddit"] .share-option-icon {
    background: linear-gradient(135deg, rgba(255, 69, 0, 0.2), rgba(204, 55, 0, 0.2));
    border-color: rgba(255, 69, 0, 0.3);
    color: #fb923c;
}

.share-option[data-platform="pinterest"] .share-option-icon {
    background: linear-gradient(135deg, rgba(230, 0, 35, 0.2), rgba(184, 0, 28, 0.2));
    border-color: rgba(230, 0, 35, 0.3);
    color: #f87171;
}

.share-option[data-platform="tumblr"] .share-option-icon {
    background: linear-gradient(135deg, rgba(53, 70, 92, 0.2), rgba(42, 56, 74, 0.2));
    border-color: rgba(53, 70, 92, 0.3);
    color: #94a3b8;
}

.share-option[data-platform="whatsapp"] .share-option-icon {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.2), rgba(30, 169, 82, 0.2));
    border-color: rgba(37, 211, 102, 0.3);
    color: #86efac;
}

.share-option[data-platform="telegram"] .share-option-icon {
    background: linear-gradient(135deg, rgba(34, 139, 230, 0.2), rgba(27, 111, 184, 0.2));
    border-color: rgba(34, 139, 230, 0.3);
    color: #60a5fa;
}

/* Copy Link Section */
.share-copy-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(42, 219, 92, 0.2);
}

.share-copy-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #cbd5e1;
    margin-bottom: 0.75rem;
    display: block;
}

.share-copy-group {
    display: flex;
    gap: 0.5rem;
}

.share-copy-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(42, 219, 92, 0.3);
    color: #e2e8f0;
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
}

.share-copy-input:focus {
    outline: none;
    border-color: rgba(42, 219, 92, 0.6);
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 0 3px rgba(42, 219, 92, 0.1);
}

.share-copy-button {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #10b981, #34d399);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-copy-button:hover {
    background: linear-gradient(135deg, #059669, #10b981);
    transform: translateY(-1px);
}

.share-copy-button svg {
    width: 1rem;
    height: 1rem;
}

.share-copy-button.copied {
    background: linear-gradient(135deg, #2adb5c, #4ae676);
    border-color: rgba(42, 219, 92, 0.5);
}

/* Success Toast */
.share-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #10b981, #34d399);
    color: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
}

.share-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.share-toast svg {
    width: 1.25rem;
    height: 1.25rem;
}

.share-toast-text {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 640px) {
    .share-modal {
        width: 95%;
        padding: 1.5rem;
        max-height: 85vh;
    }
    
    .share-options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .share-option {
        padding: 1.25rem 0.75rem;
    }
    
    .share-option-label {
        font-size: 0.8125rem;
    }
    
    .share-copy-group {
        flex-direction: column;
    }
    
    .share-copy-button {
        width: 100%;
        justify-content: center;
    }
    
    .share-toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        transform: translateY(200px);
    }
    
    .share-toast.show {
        transform: translateY(0);
    }
}

/* Animation */
@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.share-modal-overlay.active .share-option {
    animation: slideUp 0.3s ease forwards;
    opacity: 0;
}

.share-modal-overlay.active .share-option:nth-child(1) { animation-delay: 0.05s; }
.share-modal-overlay.active .share-option:nth-child(2) { animation-delay: 0.1s; }
.share-modal-overlay.active .share-option:nth-child(3) { animation-delay: 0.15s; }
.share-modal-overlay.active .share-option:nth-child(4) { animation-delay: 0.2s; }
.share-modal-overlay.active .share-option:nth-child(5) { animation-delay: 0.25s; }
.share-modal-overlay.active .share-option:nth-child(6) { animation-delay: 0.3s; }
.share-modal-overlay.active .share-option:nth-child(7) { animation-delay: 0.35s; }
.share-modal-overlay.active .share-option:nth-child(8) { animation-delay: 0.4s; }

/* Scrollbar for modal */
.share-modal::-webkit-scrollbar {
    width: 6px;
}

.share-modal::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
}

.share-modal::-webkit-scrollbar-thumb {
    background: rgba(42, 219, 92, 0.6);
}

.share-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(42, 219, 92, 0.8);
}

