.floating-share {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s cubic-bezier(0.4, 0.0, 0.2, 1), 
                visibility 0.6s cubic-bezier(0.4, 0.0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    pointer-events: none;
}

.floating-share.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Kun floating share häipyy */
.floating-share.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(20px) scale(0.9);
    pointer-events: none;
}

.floating-share-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(255, 255, 255, 0.2),
        inset 1px 0 0 rgba(255, 255, 255, 0.3),
        inset -1px 0 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    position: relative;
    padding: 6px;
    width: fit-content;
    margin: 0 auto;
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Kiiltävä reunaviiva - ylhäällä kun floating */
.floating-share-buttons::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.2) 100%);
    border-radius: 0 0 3px 3px;
    transition: all 0.3s ease;
}

.floating-share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 18px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: none;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px) saturate(160%);
    -webkit-backdrop-filter: blur(8px) saturate(160%);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #666;
}

/* POISTETAAN kaikki hover-animaatiot floatingissa */
.floating-share-button::before {
    display: none;
}

.floating-share-button::after {
    display: none;
}

.floating-share-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: none;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(255, 255, 255, 0.2);
}

/* Teksti piilossa floatingissa */
.floating-share-button-text {
    display: none;
}

.floating-share-button.copied {
    background: rgba(40, 167, 69, 0.25) !important;
    color: #28a745 !important;
    transform: scale(1.1);
    box-shadow: 
        0 12px 36px rgba(40, 167, 69, 0.25),
        0 6px 18px rgba(40, 167, 69, 0.15),
        inset 0 3px 0 rgba(255, 255, 255, 0.6),
        inset 0 -2px 0 rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(40, 167, 69, 0.3);
    animation: glassShine 0.8s ease-out;
}

@keyframes glassShine {
    0% {
        box-shadow: 
            0 8px 24px rgba(40, 167, 69, 0.25),
            0 4px 12px rgba(40, 167, 69, 0.15);
    }
    50% {
        box-shadow: 
            0 16px 48px rgba(40, 167, 69, 0.35),
            0 8px 24px rgba(40, 167, 69, 0.25),
            inset 0 4px 0 rgba(255, 255, 255, 0.8);
    }
    100% {
        box-shadow: 
            0 12px 36px rgba(40, 167, 69, 0.25),
            0 6px 18px rgba(40, 167, 69, 0.15);
    }
}

.floating-share-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    position: relative;
    z-index: 2;
}

.floating-share-button:hover .floating-share-icon {
    transform: none;
}

/* Dark mode - tumma maitolasi */
@media (prefers-color-scheme: dark) {
    .floating-share-buttons {
        background: rgba(20, 20, 20, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.4),
            0 4px 16px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.1),
            inset 0 -1px 0 rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(12px) saturate(120%);
        -webkit-backdrop-filter: blur(12px) saturate(120%);
    }
    
    .floating-share-button {
        background: rgba(40, 40, 40, 0.25);
        color: #e9ecef;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .floating-share-button:hover {
        background: rgba(40, 40, 40, 0.25);
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.4),
            0 4px 16px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.1),
            inset 0 -1px 0 rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Mobile layout */
@media (max-width: 768px) {
    .floating-share {
        bottom: 20px;
    }
    
    .floating-share-buttons {
        border-radius: 20px;
        padding: 4px;
        gap: 2px;
    }
    
    .floating-share-button {
        width: 40px;
        height: 40px;
        border-radius: 16px;
    }
    
    .floating-share-icon {
        width: 18px;
        height: 18px;
    }
    
    .floating-share-button.copied {
        transform: scale(1.08);
    }
}

/* Pienet näytöt */
@media (max-width: 480px) {
    .floating-share {
        bottom: 16px;
    }
    
    .floating-share-buttons::before {
        width: 16px;
        height: 3px;
    }
}

/* Safe area support */
@media (max-width: 768px) {
    @supports (bottom: env(safe-area-inset-bottom)) {
        .floating-share {
            bottom: calc(20px + env(safe-area-inset-bottom));
        }
    }
    
    @supports (bottom: constant(safe-area-inset-bottom)) {
        .floating-share {
            bottom: calc(20px + constant(safe-area-inset-bottom));
        }
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .floating-share,
    .floating-share-buttons,
    .floating-share-button,
    .floating-share-icon,
    .floating-share-buttons::before {
        transition: none;
        animation: none;
    }
    
    .floating-share-button:hover {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .floating-share-buttons {
        background: rgba(255, 255, 255, 0.95);
        border: 2px solid #000;
    }
    
    .floating-share-button {
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid rgba(0, 0, 0, 0.3);
    }
}