/* ============================================================
   MiMusicA Share — CSS
   ============================================================ */

/* ============ BULLE CONTEXTUELLE ============ */

#mms-context-bubble {
    position: absolute;
    z-index: 99999;
    background: rgba(20, 10, 40, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(180, 122, 255, 0.3);
    border-radius: 14px;
    padding: 6px;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translate(-50%, -100%) scale(0.9);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#mms-context-bubble.mms-bubble-visible {
    opacity: 1;
    transform: translate(-50%, -105%) scale(1);
}

.mms-bubble-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.mms-bubble-item:hover,
.mms-bubble-item:active {
    background: rgba(180, 122, 255, 0.2);
}

.mms-bubble-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(180, 122, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

/* Flèche de la bulle */
#mms-context-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(20, 10, 40, 0.96);
}

/* ============ MODAL PARTAGE ============ */

#mms-share-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.25s ease;
}

#mms-share-modal.mms-modal-visible {
    opacity: 1;
}

.mms-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.mms-modal-sheet {
    position: relative;
    background: linear-gradient(180deg, #1a0d40 0%, #0d0820 100%);
    border: 1px solid rgba(180, 122, 255, 0.2);
    border-radius: 24px 24px 0 0;
    padding: 24px 24px 40px;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mms-share-modal.mms-modal-visible .mms-modal-sheet {
    transform: translateY(0);
}

.mms-modal-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 auto 20px;
}

.mms-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.mms-modal-song-name {
    font-size: 0.85rem;
    color: #b47aff;
    margin-bottom: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Options de partage */
.mms-share-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.mms-share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px 8px;
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.mms-share-btn:hover,
.mms-share-btn:active {
    background: rgba(180, 122, 255, 0.2);
    transform: scale(1.05);
}

.mms-share-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

.mms-icon-instagram {
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

/* Loading */
.mms-modal-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #bbb;
    padding: 20px 0;
    font-size: 0.9rem;
}

.mms-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(180, 122, 255, 0.3);
    border-top-color: #b47aff;
    border-radius: 50%;
    animation: mms-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes mms-spin {
    to { transform: rotate(360deg); }
}

/* Bouton fermer */
.mms-modal-close {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #aaa;
    padding: 14px;
    border-radius: 14px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.mms-modal-close:hover { background: rgba(255,255,255,0.1); }

/* ============ INSTAGRAM — Instructions ============ */

.mms-ig-preview {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    max-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.mms-ig-preview img {
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: contain;
}

.mms-ig-instructions {
    font-size: 0.85rem;
    color: #ccc;
    line-height: 1.7;
    margin-bottom: 16px;
}

.mms-ig-instructions code {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #b47aff;
    background: rgba(180,122,255,0.1);
    padding: 6px 10px;
    border-radius: 8px;
    word-break: break-all;
}

.mms-ig-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.mms-btn-download {
    flex: 1;
    background: linear-gradient(135deg, #b47aff, #7040ff);
    color: #fff;
    text-decoration: none;
    padding: 14px;
    border-radius: 14px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.mms-btn-copy-link {
    flex: 1;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 14px;
    border-radius: 14px;
    font-size: 0.9rem;
    cursor: pointer;
}

/* ============ TOAST ============ */

.mms-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(20, 10, 40, 0.95);
    border: 1px solid rgba(180, 122, 255, 0.3);
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    z-index: 9999999;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
}

.mms-toast.mms-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#volumeToggle {
    cursor: pointer;
    margin-left: auto;
}

.volume-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 6px;
    padding-right: 0;
}

#volumeSlider {
    width: 80px;
    accent-color: #b47aff;
}