/* Floating Share Panel */
.share-panel {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: row;
    align-items: center;
}

/* The share buttons container - slides in/out */
.share-buttons {
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    padding: 8px 4px;
    border-radius: 0 20px 20px 0;
    touch-action: pan-y;
    user-select: none;
}

/* When panel is open */
.share-panel.open .share-buttons {
    transform: translateX(0);
}

/* Tab/Handle to pull the panel - Grip dots */
.share-handle {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px 8px;
    cursor: pointer;
    border-radius: 0 20px 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    touch-action: pan-y;
    user-select: none;
    /* Hidden behind buttons at -58px, 3px gap when pulled */
    margin-left: -58px;
    z-index: -1;
    /* No transition during drag - follows finger */
    transition: none;
}

.share-handle:hover,
.share-handle:active {
    background: rgba(255,255,255,0.3);
}

/* Grip dots to indicate pull - vertical dots */
.grip-dot {
    width: 5px;
    height: 5px;
    background: var(--primary-color, #2c3e50);
    border-radius: 50%;
}

[data-theme="dark"] .grip-dot {
    background: #888;
}

/* Swipe hint animation */
@keyframes swipeHint {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(3px); }
}

.share-handle .grip-dot:first-child {
    animation: swipeHint 1.5s ease-in-out infinite;
}

/* On mobile/tablet - show only half */
@media (max-width: 1024px) {
    .share-buttons {
        transform: translateX(-50%);
    }
    .share-handle {
        margin-left: -32px;
    }
    
    .share-panel.open .share-buttons {
        transform: translateX(0);
    }
}

/* Individual share buttons */
.share-btn {
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 20px;
    color: white;
    transition: background 0.3s, transform 0.2s;
    border: none;
    cursor: pointer;
    margin: 4px;
    border-radius: 16px;
}

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

/* Main Share Button - Opens native share or dropdown */
.share-btn.main-share {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px;
}

.share-btn.main-share:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Facebook button */
.share-btn.facebook {
    background: #1877F2;
    border-radius: 14px;
}

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

/* Instagram button */
.share-btn.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    border-radius: 14px;
}

.share-btn.instagram:hover {
    background: linear-gradient(45deg, #e6683c, #dc2743, #cc2366, #bc1888, #f09433);
}

/* SVG icons */
.share-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Dropdown Menu for More Share Options */
.share-dropdown {
    position: absolute;
    left: 60px;
    top: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    padding: 10px 0;
    min-width: 200px;
    display: none;
    flex-direction: column;
    z-index: 1001;
}

.share-dropdown.show {
    display: flex;
}

.share-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-color, #333);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.share-dropdown-item:hover {
    background: #f5f5f5;
}

.share-dropdown-item svg {
    width: 20px;
    height: 20px;
    fill: var(--text-color, #333);
}

/* Share dropdown item colors */
.share-dropdown-item.twitter svg { fill: #1DA1F2; }
.share-dropdown-item.linkedin svg { fill: #0077B5; }
.share-dropdown-item.whatsapp svg { fill: #25D366; }
.share-dropdown-item.telegram svg { fill: #0088cc; }
.share-dropdown-item.email svg { fill: #EA4335; }
.share-dropdown-item.copy svg { fill: #666; }

.share-dropdown-item span {
    flex: 1;
}

/* Tablet adjustments */
@media (max-width: 1024px) {
    .share-handle {
        padding: 25px 10px;
        gap: 7px;
    }
    
    .grip-dot {
        width: 6px;
        height: 6px;
    }
}


/* Mobile adjustments */
@media (max-width: 768px) {
    .share-btn {
        width: 50px;
        height: 50px;
        margin: 3px;
        border-radius: 12px;
    }
    
    .share-handle {
        padding: 30px 10px;
        gap: 8px;
    }
    
    .grip-dot {
        width: 6px;
        height: 6px;
    }
    
    .share-dropdown {
        left: 55px;
        min-width: 180px;
    }
}

/* Dark mode support */
[data-theme="dark"] .share-buttons {
    background: #2a2a2a;
    box-shadow: 2px 0 10px rgba(0,0,0,0.4);
}

[data-theme="dark"] .share-handle {
    background: rgba(60,60,60,0.5);
}

[data-theme="dark"] .share-handle:hover {
    background: rgba(80,80,80,0.6);
}

[data-theme="dark"] .share-dropdown {
    background: #2a2a2a;
}

[data-theme="dark"] .share-dropdown-item {
    color: #f0f0f0;
}

[data-theme="dark"] .share-dropdown-item:hover {
    background: #3a3a3a;
}
