/**
 * HMF Floating Share - Styles
 * Version 1.0.5
 * Zwei Modi: Side (links vom Content) und Inline (über dem Content)
 */

:root {
    --hmf-share-bg: #A11531;
    --hmf-share-icon: #FFF8EB;
}

.hmf-floating-share {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    /* Startposition - wird von JS überschrieben */
    top: 200px;
    left: 20px;
    /* Sanfte Übergänge für Position */
    transition: left 0.2s ease, top 0.15s ease;
}

/* Side-Mode: Vertikal ausgerichtet */
.hmf-floating-share.hmf-side-mode {
    flex-direction: column;
}

/* Inline-Mode: Kann auch vertikal bleiben oder horizontal werden */
.hmf-floating-share.hmf-inline-mode {
    flex-direction: column;
}

/* Haupt-Toggle-Button */
.hmf-share-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
    border-radius: 50%;
    border: none;
    background-color: var(--hmf-share-bg) !important;
    color: var(--hmf-share-icon) !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0;
    aspect-ratio: 1 / 1;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.hmf-share-toggle:hover {
    background-color: var(--hmf-share-icon) !important;
    color: var(--hmf-share-bg) !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Geöffneter Zustand */
.hmf-floating-share.is-open .hmf-share-toggle {
    background-color: var(--hmf-share-bg) !important;
    color: var(--hmf-share-icon) !important;
}

.hmf-floating-share.is-open .hmf-share-toggle:hover {
    background-color: var(--hmf-share-icon) !important;
    color: var(--hmf-share-bg) !important;
}

/* Fokus-Styles für Barrierefreiheit */
.hmf-share-toggle:focus {
    outline: 3px solid var(--hmf-share-bg);
    outline-offset: 3px;
}

.hmf-share-toggle:focus:not(:focus-visible) {
    outline: none;
}

.hmf-share-toggle:focus-visible {
    outline: 3px solid var(--hmf-share-bg);
    outline-offset: 3px;
}

.hmf-share-toggle svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hmf-share-toggle .hmf-icon-share {
    opacity: 1;
}

.hmf-share-toggle .hmf-icon-close {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg);
}

/* Toggle aktiv - Icons wechseln */
.hmf-floating-share.is-open .hmf-share-toggle .hmf-icon-share {
    opacity: 0;
    transform: rotate(90deg);
}

.hmf-floating-share.is-open .hmf-share-toggle .hmf-icon-close {
    opacity: 1;
    transform: rotate(0deg);
}

/* Share Buttons Container */
.hmf-share-buttons {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease, margin-top 0.3s ease;
    margin-top: 0;
}

.hmf-floating-share.is-open .hmf-share-buttons {
    max-height: 350px;
    margin-top: 8px;
}

/* Einzelne Share Buttons */
.hmf-share-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
    border-radius: 50%;
    background-color: var(--hmf-share-bg) !important;
    color: var(--hmf-share-icon) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    transform: translateY(-10px) scale(0.8);
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0;
    aspect-ratio: 1 / 1;
}

.hmf-share-btn:first-child {
    margin-top: 0;
}

.hmf-share-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: currentColor;
}

/* Hover-Farben umkehren */
.hmf-share-btn:hover {
    background-color: var(--hmf-share-icon) !important;
    color: var(--hmf-share-bg) !important;
    transform: translateY(0) scale(1.1);
}

/* Fokus-Styles für Barrierefreiheit */
.hmf-share-btn:focus {
    outline: 3px solid var(--hmf-share-bg);
    outline-offset: 3px;
}

.hmf-share-btn:focus:not(:focus-visible) {
    outline: none;
}

.hmf-share-btn:focus-visible {
    outline: 3px solid var(--hmf-share-bg);
    outline-offset: 3px;
}

/* Animation der einzelnen Buttons */
.hmf-floating-share.is-open .hmf-share-btn {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.hmf-floating-share.is-open .hmf-share-btn:nth-child(1) {
    transition-delay: 0.05s;
}

.hmf-floating-share.is-open .hmf-share-btn:nth-child(2) {
    transition-delay: 0.1s;
}

.hmf-floating-share.is-open .hmf-share-btn:nth-child(3) {
    transition-delay: 0.15s;
}

.hmf-floating-share.is-open .hmf-share-btn:nth-child(4) {
    transition-delay: 0.2s;
}

.hmf-floating-share.is-open .hmf-share-btn:nth-child(5) {
    transition-delay: 0.25s;
}

/* Mobil - kleinere Buttons */
@media (max-width: 768px) {
    .hmf-share-toggle {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        max-width: 40px;
        max-height: 40px;
    }

    .hmf-share-toggle svg {
        width: 18px;
        height: 18px;
    }

    .hmf-share-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        max-width: 40px;
        max-height: 40px;
        margin-top: 6px;
    }

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

/* Barrierefreiheit - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .hmf-floating-share {
        transition: none !important;
    }
    
    .hmf-share-toggle,
    .hmf-share-toggle svg,
    .hmf-share-buttons,
    .hmf-share-btn {
        transition: none !important;
    }

    .hmf-floating-share.is-open .hmf-share-btn {
        transition-delay: 0s !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .hmf-share-toggle,
    .hmf-share-btn {
        border: 2px solid currentColor;
    }
}

/* Print - verstecken */
@media print {
    .hmf-floating-share {
        display: none !important;
    }
}
