.toc-floating-wrapper {
    position: fixed;
    bottom: 25px;
    left: 15px;
    text-align: center;
    z-index: 100;
    display: none; /* مخفي افتراضيًا */
    flex-direction: column;
    align-items: center;
}

.toc-floating-text {
    background-color: #ff9800;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 5px 12px;
    border-radius: 10px 10px 0 0;
    position: relative;
}

.toc-floating-text::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 5px solid #ff9800;
}

.toc-floating-btn {
    width: 55px;
    height: 55px;
    background-color: #ff9800;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    font-size: 22px;
    animation: pulse 1.5s infinite ease-in-out;
}

.toc-floating-btn:hover {
    background-color: #e68900;
    transform: scale(1.1);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

#ez-toc-container {
    position: fixed;
    bottom: 1px;
    left: 10px;
    width: 90%;
    max-width: 350px;
    max-height: 200px;
    background: white;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 10px;
    overflow-y: scroll;
    display: none;
    z-index: 200;
    text-align: right !important;
    direction: rtl;
}

.ez-toc-visible {
    display: block !important;
}

.toc-close-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: red;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
}

.toc-close-btn:hover {
    background: darkred;
}

.ez-toc-title-container {
    margin-bottom: 15px !important;
}

@media (max-width: 768px) {
    .toc-floating-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    .toc-floating-text {
        font-size: 11px;
    }
    #ez-toc-container {
        width: 95%;
        left: 2.5%;
        bottom: 20px;
    }
    .toc-floating-wrapper {
        bottom: 15px;
        left: 15px;
    }
}

@media (max-width: 480px) {
    .toc-floating-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    .toc-floating-text {
        font-size: 10px;
    }
    #ez-toc-container {
        width: 98%;
        left: 1%;
        bottom: 20px;
    }
    .toc-floating-wrapper {
        bottom: 15px;
        left: 15px;
    }
}
