/* ================================================
   SHARE BUTTON
   ================================================ */

.share-wrapper {
    display: flex;
    justify-content: center;
    position: relative;
}

.share-wrapper.share-top {
    margin-bottom: 1rem;
}

.share-top-row {
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 2rem;
}

.share-top-row .back-btn {
    position: relative;
    z-index: 1;
    margin-bottom: 0;
}

.share-top-row .share-wrapper.share-top {
    position: absolute;
    left: 0;
    right: 0;
    margin-bottom: 0;
}

.share-wrapper.share-bottom {
    margin-top: 2rem;
}

/* Poetry pages: inside book-container */
.book-container > .share-wrapper.share-bottom {
    margin-top: 1.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.4rem 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
}

.share-btn:hover {
    background: var(--accent-red);
    color: #fff;
}

.share-btn svg {
    width: 14px;
    height: 14px;
}

/* ================================================
   SHARE DROPDOWN
   ================================================ */

.share-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: var(--z-dropdown);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

/* Bottom share: dropdown opens upward */
.share-wrapper.share-bottom .share-dropdown {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 0.4rem;
    transform: translateY(4px);
}

.share-wrapper.share-bottom .share-dropdown.active {
    transform: translateY(0);
}

.share-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.share-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.85rem;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: all 0.2s ease;
}

.share-dropdown-item:first-child {
    border-radius: 6px 6px 0 0;
}

.share-dropdown-item:last-child {
    border-radius: 0 0 6px 6px;
}

.share-dropdown-item:hover {
    color: var(--accent-red);
    background: rgba(200, 62, 62, 0.05);
}

.share-dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.share-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.2rem 0;
}

/* ================================================
   TOAST NOTIFICATION
   ================================================ */

.share-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-primary);
    color: var(--bg-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: var(--z-nav);
    pointer-events: none;
}

.share-toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ================================================
   FOCUS
   ================================================ */
.share-btn:focus-visible {
    outline: 2px solid var(--accent-red);
    outline-offset: 2px;
}

/* ================================================
   RESPONSIVE - TABLET
   ================================================ */
@media (max-width: 768px) {
    .share-dropdown {
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-4px);
    }

    .share-dropdown.active {
        transform: translateX(-50%) translateY(0);
    }

    .share-wrapper.share-bottom .share-dropdown {
        transform: translateX(-50%) translateY(4px);
    }

    .share-wrapper.share-bottom .share-dropdown.active {
        transform: translateX(-50%) translateY(0);
    }
}

/* ================================================
   RESPONSIVE - MOBILE
   ================================================ */
@media (max-width: 500px) {
    .share-dropdown {
        min-width: 160px;
    }

    .share-dropdown-item {
        padding: 0.45rem 0.7rem;
        font-size: 0.75rem;
    }

    .share-toast {
        bottom: 1rem;
        font-size: 0.75rem;
        padding: 0.4rem 1rem;
    }
}

